need help with an Ai working for a fun mod

need help with an Ai working for a fun mod

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

need help with an Ai working for a fun mod

Post by Optimus Prime »

Hi

i want to have an AI for an existing war evo modification. Actually i added the race arm with just very few units and buildings.
I want the ai to spam the factories and units and send them towards the players.
There is just energy for the AI to use cause the commander gets enough metal for everythingand i think thats the problem for at least the AAI.
It builds a solar panel and tries do get more metal but there is no metal extractor building, so it stops.

Anyone who can help me here? If you have experience with that, it would be nice if you can do the AI for me (or config it). Just send me an PM with you mail and i will send you the .sdz file for the mod.

thanks
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

you could just add a mex to keep AAI happy
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

NTai RAI and KAI
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

NTAI, KAI and RAI dont work. They crash at start saying wrong global AI version. Also AAI dont works if i add a mex building. Perhaps its cause of the new spring version?

Isnt there anyone who wants to make such an AI work for this mod? Its not just a win for the mod but also for your AI because this is perhaps the first mod which will be played against an AI even with enough human players. Think about it...
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

AIs have to be recompiled for 0.73b3 yes (due to new safety measures to prevent problems like what happened between b1 and b2). However, KAI-0.12 and AAI are included with Spring.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'll recmpile the latest NTai ocne my building palcement algorithm is fixed.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

Tobi wrote:AIs have to be recompiled for 0.73b3 yes (due to new safety measures to prevent problems like what happened between b1 and b2). However, KAI-0.12 and AAI are included with Spring.
if they are included, there must be another problem i cant fix cause i tried them and it crashed right after start.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Did you test version 0.74b3? The one released yesterday night?
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

Ok it seems that the only AI which doesnt crash is KAI. It also builds factories and spams units, BUT only tech 1 factories. I gave the tech 1 factory a unit restriction limit of 4 and after that the commander tries and tries to build another factory instead of building a tech 2 factory. How can i force him to build tech 2 after 4 tech 1 factories.
Also the units the AI builds dont attack. They just guard the area next to the base...
Any way to fix that myself?
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

so no one can help?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Be patient.

KAI will eventually do what you want

NTai could do it now if you wrote a config and I fixed the remaining issues
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

i tried NTAI but it crashed right after start when i wanted to edit this config file. I didnt even get to the point where i could use this "editor". When i tried to open the empty config for the mod, it crashed.
But i will wait for KAI...

thx
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I did say NTai isnt ready. The public version atm is incompatible with the latest spring.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

ok. But i tried it before the latest spring version ;)
never mind. I m happy as long as there is someone working on that :)
User avatar
hrmph
Posts: 1054
Joined: 12 May 2005, 20:08

Post by hrmph »

Have you tried KAI on several different maps? I've found that it sometimes gets a bit 'stuck' somtimes...
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

hrmph wrote:Have you tried KAI on several different maps? I've found that it sometimes gets a bit 'stuck' somtimes...
good point. I will try it the next days, but i think the problem with KAI that the Ai will stop building when it reached the unit restrictions will stay...
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

KAI doesn't take per-unit restrictions into consideration when deciding what to build, so it'll keep trying ad infinitum to start construction which the engine then aborts due to the limit having been reached. Directly forcing it to level 2 isn't really feasible though since that would counteract KAI's stalling safeguards, but I'll see if I can come up with an alternative solution.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

what about a restriction check?
I dont know if its possible, but it should because its not just in this mod. A lot of mods will have restrictions for super units and so on.
Isnt it bad if the AI stops working when reaching the restriction instead of building something else?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Yes, I agree. The problem is that an AI cannot simply ask the engine how many units of a given type there are on its ally-team, so such a check would require internal bookkeeping (unless someone were to *cough* patch *cough* the AI interface), which is a bit more work to implement.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It can be read via TdfParser believe it or not. And it need only be read once then cached.

This suits an AI such as AAI very well, since AAI already precaches UnitDefinitions.

I suggest a second interface be added for these sorts of things so that there underlying implementation can change as the AI interface adds dedicated support.

Although I thought unit restrictions where a part of UnitDef class? Thus counting how many peewees you have then comparing it to the maximum number allowed gave you the desired result.
Post Reply

Return to “AI”