Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#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)

comment:1 by leper, 11 years ago

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.

comment:2 by sanderd17, 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 sanderd17, 11 years ago

Milestone: BacklogAlpha 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.

in reply to:  1 comment:4 by historic_bruno, 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 leper, 11 years ago

Milestone: Alpha 14Alpha 15

comment:6 by historic_bruno, 10 years ago

Milestone: Alpha 15Backlog

comment:7 by wraitii, 10 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 14639:

Improve some building placement. May improve dropsite usage slightly.
Should fix #1964

comment:8 by sanderd17, 10 years ago

In 14640:

Removing the AI check for producing un-allowed units. Should be fixed in the AI side with r14639. Refs #1964.

comment:9 by sanderd17, 10 years ago

Milestone: BacklogAlpha 16

comment:10 by sanderd17, 10 years ago

In 14641:

An addition to r14640, also refs #1964

Note: See TracTickets for help on using tickets.