Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ares engine lacks randomization of targets #237

Open
Scott-TT opened this issue Jul 9, 2022 · 1 comment
Open

Ares engine lacks randomization of targets #237

Scott-TT opened this issue Jul 9, 2022 · 1 comment
Assignees
Labels
feature_request:approved All feature requests reviewed and approved by the maintainers feature_request All issues containing feature requests to add new functionalities

Comments

@Scott-TT
Copy link

Scott-TT commented Jul 9, 2022

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; 
}
@Scott-TT Scott-TT added bug All bug reports bug:unconfirmed All new bug reports that are yet to be confirmed (eg. by providing more details) labels Jul 9, 2022
@mdziekon
Copy link
Owner

Hi @Scott-TT, thanks for reaching out.

Long story short - yes, total lack of randomisation in Ares is an intentional design choice, as I wanted to make the engine's result stable and predictable (and therefore, reduce the need to use simulators multiple times, and cut down on execution time - the original OGame engine randomises almost everything, which makes it quite badly suited for custom servers with eg. x1000 game speeds).

However, that was long time ago, and I definitely see the shortcomings of such approach. I'm not oposed to the idea of some sort of randomness in the engine, as long as there's an option to choose which variant of the engine should be used (so that every admin of their server can make a choice). I suppose this could be introduced as a simple parameter in Ares, and a new configuration entry (provided at install).

Feel free to open up a Pull Request if this is something you would like to work on, community contributions are always welcome. Since this is not a bug, I'll retag this issue to "Feature request".

@mdziekon mdziekon added feature_request All issues containing feature requests to add new functionalities feature_request:approved All feature requests reviewed and approved by the maintainers and removed bug:unconfirmed All new bug reports that are yet to be confirmed (eg. by providing more details) bug All bug reports labels Jul 11, 2022
@mdziekon mdziekon changed the title [BUG] Ares engine lacks randomization of targets Ares engine lacks randomization of targets Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request:approved All feature requests reviewed and approved by the maintainers feature_request All issues containing feature requests to add new functionalities
Projects
None yet
Development

No branches or pull requests

2 participants