#969 closed enhancement (fixed)
[PATCH] Territory support for the AI
Reported by: | Jonathan Waller | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 8 |
Component: | UI & Simulation | Keywords: | |
Cc: | James Baillie, lexa | Patch: |
Description
This patch gives the AI a map of the territories in the game.
The main issue with the patch is that territory data is regenerated each turn which is inefficient. I have tried looking at the DirtyID for the grid generated but it is always 0.
As historic_bruno mentioned build restrictions data needs to be added to the gamestate. Currently I don't think is is urgent since only docks and CCs are different and they need special handling already by an AI script.
There is a post on the forums here.
Attachments (4)
Change History (11)
by , 13 years ago
Attachment: | AI Territories.patch added |
---|
comment:1 by , 13 years ago
Milestone: | Backlog → Alpha 8 |
---|---|
Summary: | Territory support for the AI → [PATCH] Territory support for the AI |
by , 13 years ago
Attachment: | AI Territories23-9.patch added |
---|
comment:2 by , 13 years ago
I have used the method you suggest for the dirty testing. It seems to work now. I also renamed map to passabilityMap in various places, the C++ code is now completely switched to the new name.
In the base.js file I currently set both .map and .passabilityMap so that AI scripts don't break immediately. I thought it would be best to make the transition easier.
comment:3 by , 13 years ago
Cc: | added |
---|---|
Keywords: | review added |
Uploading some new patches for review that add territory support for AIs, based on the above. The first updates the API to support territories. The second patch changes existing AIs (Jubot, Testbot) to take advantage of this.
by , 13 years ago
Attachment: | ai_territory_support-09282011.patch added |
---|
by , 13 years ago
Attachment: | ai_buildrestrictions-09282011.patch added |
---|
comment:4 by , 13 years ago
Cc: | added |
---|
comment:5 by , 13 years ago
Keywords: | patch added |
---|
I would like to see this patch sooner so we can have better AI bots
comment:6 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 13 years ago
Keywords: | review patch removed |
---|
Thanks :)
For the DirtyID problem, we can take a cue from
CCmpRangeManager
which stores a local DirtyID and callsCCmpTerritoryManager::NeedUpdate(DirtyID)
to test if a new territory grid is available.CCmpAIManager
could do the same. (The internal grid for territory manager gets deleted on update, causing the new grid's DirtyID to be reset to 0, but the actual value is returned byNeedUpdate()
).I also think
map
should be renamed topassabilityMap
to better distinguish it fromterritoryMap
.