#2156 closed defect (fixed)
[PATCH] Improve UnitAI range query performance
Reported by: | historic_bruno | Owned by: | dumbo |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 16 |
Component: | UI & Simulation | Keywords: | simple patch |
Cc: | Patch: |
Description
Currently, citizen soldiers' UnitAI can have two active range queries: one for finding attackable enemy entities, the other for finding gaia entities capable of attack (see SetupGaiaRangeQuery
). This is a waste because it basically doubles the amount of work CmpRangeManager
must do for those units. Instead, we could combine these into a single range query for gaia+enemies, then filter out non-attacking gaia entities from the query results in UnitAI.
Of course, it should be profiled before and after the change to ensure an improvement.
Attachments (2)
Change History (11)
comment:1 by , 11 years ago
comment:2 by , 10 years ago
Keywords: | simple added |
---|---|
Milestone: | Alpha 15 → Alpha 16 |
by , 10 years ago
Attachment: | 2156_unitAI_range_queries.patch added |
---|
[PATCH] for #2156 – UnitAI.js range queries, NOT profiled
comment:3 by , 10 years ago
The patch looks good, but you broke the tests though. (the test binary is in the same directory as the pyrogenesis binary, run it in a terminal to see where it breaks).
Btw, while you're on it. It might be nice to prefer attacking units over animals (in the AttackEntitiesByPreference method).
Also, see this: SubmittingPatches
comment:4 by , 10 years ago
Owner: | set to |
---|
comment:5 by , 10 years ago
Keywords: | patch added |
---|---|
Summary: | Improve UnitAI range query performance → [PATCH] Improve UnitAI range query performance |
by , 10 years ago
Attachment: | 2156_unitAI_range_queries_testpass.patch added |
---|
now passes a test also. thanks for sanderd
comment:6 by , 10 years ago
Keywords: | review added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:9 by , 10 years ago
Keywords: | review removed |
---|
There's a similar case for BuildingAI