Can this unit build this unit?

Can this unit build this unit?

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

Moderators: hoijui, Moderators

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

Can this unit build this unit?

Post by AF »

Can Builder A build unit B?

I have tracked down the cause of the bug breaking the AA buildtree and stopping me from releasing XE9RC22 to a function that was intended to answer this question. And the conclusion is that it isnt working.

I've recompiled with numerous completely different methods and I'm at a loss to explain why it occurs.

Thus can someone post a generic algorithm or check that would do this or explain the 'how' part of doing it.

Without this metatags in NTai dotn work and egarwean relies extremely heavily on them for his A buildtree so much so that without them all it does is endlessly build mexes and solars and walk to random places.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

So, it's the unit creation by units that's causing all the trouble. I guess that makes sense. I mean... what else does that? Gundam does have the ability, if I recall - but from the Commander.

How did you do it for Gundam?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

No thats somethign else entirely.

I've looked at AAI code and seen that it uses a very similair method to get the build options as I do so it mightnot actually be the problem but my logfiles disagree..

egarwaen has metatags so say instead of having 2 files one for the core comander and one for the arm with one saying armlab and the other saying corlab, he has instead defined a tag l1kbot=armlab,corlab and put l1kbot there instead.

Thus when NTai see this in the buildtree it chooses the appropriate one. But this relies on it being able to determine if the commander can build an armlab or a corlab and fitlering out the option it cant do. For example if it where a core commander it would say Core commander cannot build armlab so lets skip that but it can build corlab so lets build that, and vice versa for arm.

So you see if you cannot answer the question can Unit A build unit B then the whole system falls apart.

aka can a corlab build an armpw? can an armlab build a corak? can a corcom build a cormex? Can the lvl 1 kbot factory build a krogoth? Can it build a lvl 1 cnstr bot?


Normally it would be easier to select which item in the metatag to use randomly or by efficiency but that assume that the builder can build everything in the mtatag, and if no check was done to see if it can build everything in the tag then it might pick something it cant build and it would be discarded, which in egarwaens buildtree it would be disastrous. Imagine if it was in AA as arm and the corlab was chosen instead of the armlab? The command would continue through the system untill it was discarded and it would never build a first factory crippling the AI.


So please dont confuse "can unit A build unit B" with "shall unit A build unit B"
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

ps:: there's no gundam buildtree
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Is there a problem with just iterating through the unitDef->buildOptions? That worked fine for JCAI and probably AAI and KAI use the same
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

jcnossen wrote:Is there a problem with just iterating through the unitDef->buildOptions? That worked fine for JCAI and probably AAI and KAI use the same
bingo!
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

AF wrote:ps:: there's no gundam buildtree
I assumed since I'm pretty sure I've seen you tout NTai for every mod that there would be. My apologies.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Gundam uses the default buildtree and it appears so will AA, as despite my efforts my attempts at fixing metatags are proving a waste of time and the time and resources spent fixing them arent worth the effort.
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

XTA is also heavily dependant on metatags... And it would be very difficult to remove that dependency without sacrificing XTA performance.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

really? hmm thats a shame, as I'm about to post the link to the RC22 installer here
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

But if you insist on releasing soon, I could go through everything and remove everything that has to do with metatags.

At a largish hit to XTA performance.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

it's already uploaded and on darkstars and has been the last 30 minutes
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

You should warn me of emminent releases, so I can prepare the buildtree.

I have been thinking, and I think I could replace most/all of the custom metatags with normal metatags (they still work, right?) So could I have a list of all the normal metatags?

Once I have that, I could fix the buildtree in ~30 minutes.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I've been trying to message you on yahoo for the last 10 hours.

You'll have to send it to me for rc23, along with the improvements we discussed over mex placement.
Post Reply

Return to “AI”