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

Consider shuffling unitDefIDs #1787

Open
sprunk opened this issue Nov 27, 2024 · 0 comments
Open

Consider shuffling unitDefIDs #1787

sprunk opened this issue Nov 27, 2024 · 0 comments

Comments

@sprunk
Copy link
Collaborator

sprunk commented Nov 27, 2024

unitDefIDs happen to be assigned to unit defs in an alphabetical order according to their name, so many unit defs tend to receive the same unitDefID within a game even if the set of units changes between matches, e.g. armaak in BAR or amphaa in ZK are basically always ID 1 regardless of modoptions or updates. Newbie devs often notice this, and with most engine interfaces providing and expecting the numerical ID they often end up hardcoding numbers in wupgets instead of going via the name. Then later the ID changes after all and they get screwed.

Consider shuffling the IDs per-match to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant