Jump to content

WIP new API for the AIs, along with new version of Aegis.


Recommended Posts

ERROR: JavaScript error: simulation/ai/common-api-v3/utils.js line 10
TypeError: a is undefined
SquareVectorDistance((void 0),[object Array])@simulation/ai/common-api-v3/utils.js:10
([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/attack_plan.js:676
([object Object],[object Object],[object Array])@simulation/ai/qbot-wc/military.js:562
([object Object])@simulation/ai/qbot-wc/qbot.js:218
([object Object],[object Object])@simulation/ai/common-api-v3/base.js:128
@:0

This was on the Atlas Mountains random map, tiny, 1 Aegis Bot opponent, standard settings.

Edited by zoot
Link to comment
Share on other sites

Amazing list of updates wraitii. Can't wait to test it out.

The addition of difficulty settings, basic naval support, and technology research is a massive step forward! (y)

You may experience a little lag when the map generation reaches 100%: that's from the AIs initializing. It should not feel too long.

It's much better to wait a few seconds before the map is generated, not at the start of the game where it's more noticeable as lag. Perhaps a message saying 'Initializing AIs' could be added at the 100% mark to explain the wait (although that's not important).

Link to comment
Share on other sites

I get this build error on linux:

../../../source/simulation2/components/CCmpAIManager.cpp: In member function ‘bool CAIWorker::TryLoadSharedComponent(bool)’:
../../../source/simulation2/components/CCmpAIManager.cpp:401:7: error: ‘callConstructor’ was not declared in this scope
../../../source/simulation2/components/CCmpAIManager.cpp: At global scope:
../../../source/simulation2/components/CCmpAIManager.cpp:362:7: warning: unused parameter ‘hasTechs’ [-Wunused-parameter]
make[1]: *** [obj/simulation2_Release/CCmpAIManager.o] Errore 1
make: *** [simulation2] Errore 2

Link to comment
Share on other sites

-___-

That's me being stupid when committing this morning and accidentally reverting a line. Sorry bout that, just change "if (callconstructor)" to "if (hasTechs)" in the meantime. Will fix in 1 or 2 hours.

Edit: ah nevermind, I'll actually do it right now...

Edit2: and done.

Pureon: exactly my opinion, but I don't think it deserves a "Initializing AI" screen unless we actually did this for the whole process.

Link to comment
Share on other sites

(just for fun, a little comparison between "now" and "then").

A screenshot I had posted in early august, back when I had just started work on what would become Aegis, of a victory against qBot on the RM Continent (I was blue, did nothing on purpose. qBot was red, Aegis green. Can't see the timer but it was at 41 minutes).

OxiPms.jpg HaVDxs.jpg B16yps.jpg

Screenshot of the same thing happening now (aegis blue, qBot red).

F7qe0Das.jpg 5PTWyecs.pngrvJiX34s.png

(You'll also notice Aegis sucked at attacking. It had won by 25:00).

  • Like 1
Link to comment
Share on other sites

Good things I noticed playing against 2 AIs, random map Persian highlands 3 player size:

-Less lag :)

-Faster at building economy (both had nice stats even defeated)

-Much more units trained :)

-Fast phase upgrading.

-Frequent attacks.

-Dropsite placement with defense tower to defend resources.

Not so good things:

-Didn't care much of defending "not-main" CCs (if you try to attack main CC you get a response)

-Didn't use cav against my siege units (it would be great if he tries to prioritize siege attacking with cav, don't know if this is possible yet)

-After killing all units of the last AI, I didn't win until I destroyed a CC foundation that obviously wasn't being constructed (I think this is not AI problem though :P)

-After taking down first AI CC, I received the following errors and he didn't try to build a new one:

post-13528-0-97754800-1362598724_thumb.p

No more errors, just some warnings about the plans, phasing, and some resources not found (but I think they're normal)

Overall a nice step forward, It was a fun match :D

Good work Wraitii!

Link to comment
Share on other sites

Thanks for the report, Enrique...

I'm getting a weird bug on occasion where the AI will crowd the map with useless dropsites which I'll have to fix. And there seems to be a few defense issue. Also, ballistas are pretty useless, though ram get used correctly. Will work on that.

Link to comment
Share on other sites

Wow, this AI is really huge improvement. It's even a lot better than the last patch you posted!

Well done! :thumbsup:

Some issues I've discovered in random order (Some are already known and we discussed most of them on IRC):

  1. Dropsite placement problem and related CC placement problem
  2. The AI does not seem to reclaim territory by building a CC after one CC got destroyed (maybe related to the dropsite issue)
  3. When the AI successfully destroyed something it attacked, it looks like the remaining units just keep standing around there with no further orders
  4. The AI does not seem to know about the build limit of towers. The message that the limit is reached keeps getting displayed.
  5. In AI vs AI fights it happens often that they build CCs just beside the enemy one. This happens twice on Belgian Bog for example when playing it with 1 Aegis vs 1 Aegis.
  6. Sometimes the AI gathers resources from far away and outside of its territory even though the same resource is available much closer (just beside a dropsite).
  7. Out of memory errors (we should probably increase the runtime size until the engine's pathfinder can be used for AI pathfinding)
  8. Units are standing around and doing nothing (This happend in very late-game and it didn't happen a single time in the early phase of the game)

EDIT:

The fight on Belgian Bog just ended because one AI destroyed the others main CC.

It did not defend it with the army standing quite close (check the attachment).

post-7202-0-30014300-1362680040_thumb.jp

Link to comment
Share on other sites

2 and 8 seem to be fixed, but if you check on Belgian Bog, the red player still builds masses of mills on the bottom-left corner.

EDIT:

Now the blue AI gets "stuck" somehow.

It still has some resources but I doesn't train any units. First it did train a few, but they were only sent into the enemy's territory and even though there were only about 5 women gathering, no additional workers were trained.

post-7202-0-40311300-1362697049_thumb.jp

Link to comment
Share on other sites

Yves: tried to reproduce the error, couldn't on that map because there were other errors that I fixed. It does happen to me in some cases, but it doesn't seem too reproducible or annoying. If you find a scenario where this happens again, do tell (or a RM with a seed).

I've been fixing tons of stuffs, and I think you'll find Aegis is much more efficient. Here's a little screeny of a 1v1 Aegis/Aegis (Sparta v Rome) which Aegis won (by destroying everything that Sparta had) at exactly the 40th minute. The big screenshot is at around 33 minutes, showing the maximal development of both players (that attack by Rome actually failed, but weighted too heavily on Sparta which was lagging behind since the beginning.)

51Qe7uRs.jpg MFqiJqqs.jpg 92xWFvks.png

Link to comment
Share on other sites

Changes committed to svn. Also added the support for "-autostart-civ" to set the civilization at start. Requires recompiling.

So basically the defense manager should react much better. Garrisoning should mostly happen when it makes sense, and the units should not attack you just because you stepped in their territory. Furthermore I did tons of change to the attack manager to make it actually able to attack.

Note that the AI absolutely sucks with ballistas. Any civ that has rams will work much better (that's basically all of them but Athen, I think).

The AI should be able to actually destroy its opponent if it takes the upper hand (seen it done in 30 minutes. Usually done by 40 minutes against qBot. Even if it has 5 fortresses to tear down). The problem of idle units doing nothing is also gone.

Aegis is still no rusher (earliest attack will be around 13/14 minutes) but it will generally attack every 3/4 minutes after, with increasingly sized waves if you don't kill it (after 25/30 minutes, they get seriously dangerous).

It seems to get stuck sometimes when attacked, will look into it.

(also, did a benchmark with a slightly different config.js: Aegis reaches 300 units in 21 minutes.)

  • Like 1
Link to comment
Share on other sites

I've tested on Belgian Bog again.

So far a lot of problems seems to be gone, but I've found two additional problems:

  1. The red AI stopped attacking. It had an army waiting in the middle of the map in neutral territory but it just kept standing there and waiting for something. It could have been waiting for two rams that were stuck in houses. You should probably adjust the placement of houses a bit (check the screenshot from later in the same game with some additional rams that are stuck in houses).
  2. The red player kept repairing a mill and a tower that were cut off from its territory.

post-7202-0-67797000-1362842113_thumb.jp

Link to comment
Share on other sites

Yeah, I know about 1. I've made the AI place buildings a little less far apart again, so this kind of happen. Normally attack plans should detect they are stuck and disband after a while (can be 3 minutes). But I should probably just place houses closer together.

Thanks for reporting 2 though, I had forgotten about that one.

Link to comment
Share on other sites

I have a question: why the AI plans some actions (advance phases, build fortress, and so on) based on time rather than on available resources? I mean the time approach could not be optimal when starting with a lot of resources (this way it could progress faster), or if natural resources are far away (slower).

(Also update readme.txt with the new command line).

Link to comment
Share on other sites

Okay, light update to fix a few issues that popped up. Fabio, readme.txt has been updated (Never knew about that file :) ).

Yves, this should fix the two bugs you reported above. 1 definitely is (it was actually faulty logic when the AI reached max pop), 2 should be mostly. I've slightly changed building placement, might help the pathfinder.

(also reverted accidentally committing a profanity into svn. Sorry bout' that.)

Link to comment
Share on other sites

Yes for me (I didn't do extensive testing however it's better than qbot). It's already the default on some maps (e.g. Acropolis 1 and Zagros Mountain 3) anyway.

The problem of idle units doing nothing is also gone.

The starting cavalry is still unused.

Edited by fabio
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...