GetEntityState is a performance-critical function in the GUI when a large number of units are selected. The goal of this patch is to increase the efficiency of it without modifying the returned states visible to rest of the GUI in any way (it renames a few properties of entities states or moves them around, but the information they contain and the way to access it remain the complete same) As explained the comments, certain parts (the template data) of an entity state are "predictable" and can be reused between entities with the same template. What one has to account for, however, is that values of the template data can be modified. This happens on two different levels: Firstly, player-wide modifications, which apply to all entities owned by that player. This includes stuff like bonuses from researched techs, civs bonuses, team bonuses. And secondly, entity-local modifications, which apply to individual entities. This includes buffs or debuffs from status effects or auras (of other entities). So we can construct a whole entity state by first just computing the dynamic state (stuff like current hitpoints, which differs from entity to entity) and then adding the (potentially already cached) template data to it, which can be reused between entities with the same template and owning player. And then overwrite the values affected by entity-local modifications, which are usually just a few and even they can be cached and reused for entities with the same owning player, template, and entity-local modifications (identified by the "modifications ID"). This saves the effort of retrieving/computing a ton of data each turn and also saves the time it takes the engine to clone the data from the simulation to the GUI (as the return value of the GUI interface call), which previously took just as long as retrieving the entity states themselves. Since only the dynamic state is read from the components, a number of small getter methods have become unused; they are kept (for now at least) since they might be useful again in the future or for mods. |
||
|---|---|---|
| .gitea | ||
| binaries | ||
| build | ||
| docs | ||
| libraries | ||
| source | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .groovylintrc.json | ||
| .lfsconfig | ||
| .markdownlint.yaml | ||
| .pre-commit-config.yaml | ||
| .shellcheckrc | ||
| .yamllint.yaml | ||
| eslint.config.mjs | ||
| LICENSE.md | ||
| license_dbghelp.txt | ||
| license_gpl-2.0.txt | ||
| license_lgpl-2.1.txt | ||
| license_mit.txt | ||
| package.json | ||
| README.md | ||
| ruff.toml | ||
0 A.D. Introductory Information
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform real-time strategy game of ancient warfare.
This is currently an incomplete, under-development version of the game. We're always interested in getting more people involved, to help bring the game towards completion and to share the interesting experience of developing a project of this scope.
There are several ways to contact us and find more information:
- Web site: https://play0ad.com/
- Forums: https://www.wildfiregames.com/forum/
- Gitea (development info, bug tracker): https://gitea.wildfiregames.com/
- IRC: #0ad on irc.quakenet.org
Running precompiled binaries on Windows
A precompiled, ready-to-play development version of the game is available from
a checkout of the nightly-build SVN repository. If you are using the git
repository, you have to follow the steps below.
In a checkout of the nightly-build SVN repository, open the "binaries\system" folder.
- To launch the game: Run pyrogenesis.exe
- To launch the map editor: Run Atlas.bat or "pyrogenesis.exe -editor"
Compiling the game from source code
The instructions for compiling the game on Windows, Linux and OS X are at BuildInstructions.
Reporting problems
Bugs should be reported on Gitea. For information on reporting problems and finding logs, see ReportingErrors.
Contributing Code
If you want to help out programming for the game, have a look at GettingStartedProgrammers or contact us on #0ad-dev on irc.quakenet.org
Contributing Artwork
If you want to make artwork for the game, have a look at For Artists or visit the forums.
Translating
You can help translating the game at https://www.transifex.com/projects/p/0ad for more information, see Localization