#2460 closed defect (fixed)
[PATCH] Savanna Ravine scenario AI makes no units
Reported by: | Patrick | Owned by: | Yves |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 16 |
Component: | AI | Keywords: | patch |
Cc: | wraitii, mimo | Patch: |
Description
Playing Alpha XV: Osiris with svn up done as of March 13,2014. Playing single player/matches/scenario/Savanna Ravine. I am the Hellenes, the Aegis Bot AI is playing the Celts with AI difficulty set to very hard. The scenario starts with no units, so you have to grow some right away to start. The AI never does this. By the time I get around to going over to the Celt camp, it still has created no units. That makes it less fun than it might have been. I've tried it twice, same result. It never creates any units.
Attachments (1)
Change History (13)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Is this behaviour the same with Petra? If there's adifferent behavior, the code can be compared, as it's still very similar.
follow-up: 4 comment:3 by , 10 years ago
- Behaviour is the same in Petra
- It still doesn't work if you use the developer console to allow "Control All Units" and then manually build a worker from the CC while in game.
- That is, the worker will successfully build, but it won't do anything with the unit.
- It does work if you use the map editor to give it a worker at the start of the game.
comment:4 by , 10 years ago
Replying to Silk:
- It still doesn't work if you use the developer console to allow "Control All Units" and then manually build a worker from the CC while in game.
- That is, the worker will successfully build, but it won't do anything with the unit.
That's because the AI 'tags' its units. When it creates a unit, it's for a specific purpose, and the unit gets tagged for that. If you, through the dev console, create a unit for the AI, the AI doesn't know how it should use the unit. Ideally, it should pick up the idle unit and assign it some task. But as triggers aren't in yet, and players aren't supposed to open the dev console, there's no real problem with that yet.
comment:6 by , 10 years ago
Yves, I don't think so.
The problem with #2446 is with all hele civs (spart, mace, athe, ...) and only with them. celts civs (gaul and brit) are not affected.
Futhermore, I've just tried with Petra, and I do not see the described behaviour: the AI starts to train units and affects them to tasks. So may-be it is an aegis issue when starting without any units.
Finally I thought hele and celts were not supposed to be playable ? at least when developping petra, I never take them into account when managing special buildings or civ specificities. I think we should change the civs in this scenario and replace celts by gaul or brit and hele by one of the hele civs.
by , 10 years ago
Attachment: | headquarters.js.patch added |
---|
Patch to solve aegis startup problem when no units are present
comment:7 by , 10 years ago
I did a rough port of testbot to the new common-api and it does not suffer from the problem as well. At a closer look, this seems to be a bug in the aegis code: When training villagers, the trained group size is set to 10% of the current pop (including queued), with a maximum of 5 units. As on Savanna Ravine, the initial pop is 0 and no units are queued up initially, aegis tries to train 10%*0 = 0 females at the same time. I haven't investigated what's going on in the unitAI scripts, but this might explain why the civic center training queue briefly shows a female with "100% complete" state.
I've created a patch which seems to solve this (still need to figure out how to combine patch attachment + comment text).
comment:8 by , 10 years ago
Keywords: | review patch added |
---|---|
Milestone: | Backlog → Alpha 17 |
Summary: | Savanna Ravine scenario AI makes no units → [PATCH] Savanna Ravine scenario AI makes no units |
Sent ticket into review queue for Alpha 17 (according to IRC, Alpha 16 is already in feature freeze).
comment:9 by , 10 years ago
Cc: | added |
---|---|
Milestone: | Alpha 17 → Alpha 16 |
Feature freeze doesn't mean commit freeze (bugfixes are still allowed), and this is clearly a bug.
comment:11 by , 10 years ago
Keywords: | review removed |
---|
comment:12 by , 10 years ago
Indeed, that fixes it and the explanation makes sense too. Well done!
I had another problem in mind that happened on this map months ago. Citizens were just standing around near finished buildings. Apparently this one got already fixed in another commit.
I haven't worked out what the actual bug here is yet, but what the AI seems to be doing is repeatedly queueing up a worker, then dequeuing it on the next update, such that nothing ever gets built.