Opened 15 months ago
Closed 15 months ago
#6735 closed defect (fixed)
Frantic activity of AI-controlled relics
Reported by: | Langbart | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 27 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description (last modified by )
to reproduce
- start a map with ai controlled players and some relics (currently at [27531] there is a bug, wait till Phab:D4934 has been merged)
# 1v1 AI match with 14 relics; small map; pay attention to the relics being captured pyrogenesis -autostart-size=128 -autostart="random/mainland" -autostart-ai=1:petra -autostart-ai=2:petra -autostart-victory=capture_the_relic -autostart-reliccount=14 -autostart-player=-1
- move the game speed to 20x
- wait till some captured relics reach the civic center
- notice the frantic movement of the relic trying to find a spot
replay
reproducible
- issue is not reproducible on A23b
- a bit observable in A24b and A25b, but they find their position more quickly and are not trapped in an endless loop
- issue is reproducible in A26
bisect
(none)
Attachments (5)
Change History (15)
by , 15 months ago
comment:1 by , 15 months ago
Description: | modified (diff) |
---|
comment:2 by , 15 months ago
comment:3 by , 15 months ago
by , 15 months ago
comment:4 by , 15 months ago
Turning off the CC
obstruction, it shows us the position to which the AI sends the relics.
-
binaries/data/mods/public/simulation/templates/structures/athen/civil_centre.xml
a b 14 14 units/{civ}/cavalry_javelineer_b 15 15 </Entities> 16 16 </Trainer> 17 <Obstruction> 18 <BlockMovement>false</BlockMovement> 19 </Obstruction> 17 20 <VisualActor> 18 21 <Actor>structures/athenians/civil_centre.xml</Actor> 19 22 </VisualActor>
The AI orders them in the center of the CC
, get the exact position.
-
binaries/data/mods/public/simulation/ai/petra/victoryManager.js
a b PETRA.VictoryManager.prototype.pickCriticalEntRetreatLocation = function(gameSta 474 474 if (bestBase.accessIndex == accessIndex) 475 475 { 476 476 let bestBasePos = bestBase.anchor.position(); 477 warn(uneval(['bestBasePos', bestBasePos])) 477 478 criticalEnt.move(bestBasePos[0], bestBasePos[1]); 478 479 } 479 480 };
possible solutions ?
(1) Passability Class
Reducing the PassabilityClass
stops the effect also, but the units are overlapping too much.
-
binaries/data/mods/public/simulation/templates/template_unit_catafalque.xml
a b 50 50 <Formations disable=""/> 51 51 </UnitAI> 52 52 <UnitMotion> 53 <PassabilityClass> large</PassabilityClass>53 <PassabilityClass>default</PassabilityClass> 54 54 <WalkSpeed op="mul">0.55</WalkSpeed> 55 55 <Acceleration op="mul">0.275</Acceleration> 56 56 <Weight op="mul">10.0</Weight>
(2) obstructionRadius
-
binaries/data/mods/public/simulation/ai/petra/victoryManager.js
a b PETRA.VictoryManager.prototype.pickCriticalEntRetreatLocation = function(gameSta 474 474 if (bestBase.accessIndex == accessIndex) 475 475 { 476 476 let bestBasePos = bestBase.anchor.position(); 477 criticalEnt.move(bestBasePos[0], bestBasePos[1]); 477 const {max} = gameState.getEntityById(bestBase.anchorId).obstructionRadius(); 478 criticalEnt.moveToRange(bestBasePos[0], bestBasePos[1], 0, max); 478 479 } 479 480 };
by , 15 months ago
Attachment: | obsRad.png added |
---|
by , 15 months ago
by , 15 months ago
Attachment: | relics.png added |
---|
comment:5 by , 15 months ago
Milestone: | Alpha 27 → Alpha 28 |
---|
The actual bug might have been introduced by one of the unit motion changes from wraitii
, all the above solutions rather "hide" the actual problem.
Pushing back 1 milestone.
git log A23...A24 --author wraitii -i --grep="unit.*motion" --oneline | wc -l # a total of 58 commits from @wraitii containing UnitMotion in the commit message 58
comment:6 by , 15 months ago
The 'back and forth' behaviour looks a little buggy, not sure it's related to pushing or just unitmotion itself. It's a little odd that we only really see it happen to Catafalques to me, which aren't really anything special.
Investigating should determine why the unit (probs UnitAI) doesn't run into a 'stop' condition if this happens forever.
--
With that being said, I think it is a correct fix to do solution 2 above. The AI should order the unit to move in range of the entity, and not to a fixed position. This will let UnitAI make better decisions, and handles some other cases like mods that make moving CCs etc. This is independent of fixing a possible underlying issue in unit motion.
comment:7 by , 15 months ago
The flip-flop can be reproduced with rams (task them to the center of a large CC) as well. But sometimes it is kind of hard. ^^
comment:9 by , 15 months ago
(One may close this ticket due to the linked commit and make a new one, or keep this open for the rest of the issue.)
comment:10 by , 15 months ago
Milestone: | Alpha 28 → Alpha 27 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
#6741 was created to keep track of the problem, which is more generally described as this ticket was.
Looks like unit pushing in combination with the AI tasking the relic. We might need to check what the AI wants the catafalque to do. (E.g. if it tasks to a very specific spot, don't do that.)