#1964 closed defect (fixed)
AI can spawn units before the needed technologies are researched
Reported by: | sanderd17 | Owned by: | wraitii |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 16 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
Even with the new AI interface, Aegis bot can still spawn some of the units without researching the needed technology.
For example, it can spawn champion units from barracks before it's even in city phase, so it couldn't have researched the "champion units" technology.
I don't know if there are other places where a technology limits unit creation. There's one I know, with Athenian triremes, but as the AI can't do naval warfare yet, that won't matter. But it'd be worth handling this on an a more abstract level, so all future similar cases will be handled correctly.
Change History (10)
follow-up: 4 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Well, there are 2 AI interfaces, can't the old one get a property like cmpPlayer.IsAIv2(). That way, old bots like demo bot or qbot would still work.
And meanwhile give a property IsAIv3() to Aegis bot, because there could (and probably will) be newer iterations anyway.
comment:3 by , 11 years ago
Milestone: | Backlog → Alpha 14 |
---|
Now the AI is broken, but it should certainly be fixed for A14.
Since the barracks are in village phase, it would mean the AI can already produce champion units when in village phase.
comment:4 by , 11 years ago
Replying to leper:
The proper way of handling this would be to remove the IsAI() checks, but that would break qbot and would require us to either fix it or drop it.
I think it's to the point where we want to consider that. Maintaining these different APIs is a nightmare, and with wraitii's rewrite coming soon...
comment:5 by , 11 years ago
Milestone: | Alpha 14 → Alpha 15 |
---|
comment:6 by , 10 years ago
Milestone: | Alpha 15 → Backlog |
---|
comment:9 by , 10 years ago
Milestone: | Backlog → Alpha 16 |
---|
That's because of the
|| cmpPlayer.IsAI()
checks in Commands.js with a TODO next to it. As we still have qbot and that doesn't support technologies the checks are still there.The proper way of handling this would be to remove the IsAI() checks, but that would break qbot and would require us to either fix it or drop it.