Skip to content

Ares engine lacks randomization of targets #237

@Scott-TT

Description

@Scott-TT

Hello, I'm unsure if this is intended but the combat engine currently uses a fully predictable combat resolution, essentially taking each target in ascending value of total juice. In short the smallest targets are consistently shot first, while the strongest ones are never considered.

Quick testing showed this is solved by looping over shuffled targets during the "Calculate Regular Fire!" parts of
both attacks and defenses
foreach(shuffle_forces($DefShipsForce_Copy) as $TKey => $TForce)

With any acceptable shuffle (i.e. key-preserving), for instance

function shuffle_forces($list) { 
    if (!is_array($list)) return $list; 
    $keys = array_keys($list); 
    shuffle($keys); 
    $random = array(); 
    foreach ($keys as $key) { 
        $random[$key] = $list[$key]; 
    }
    return $random; 
}

Metadata

Metadata

Assignees

Labels

feature_requestAll issues containing feature requests to add new functionalitiesfeature_request:approvedAll feature requests reviewed and approved by the maintainers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions