Page 1 of 1

Can this unit build this unit?

Posted: 13 Aug 2006, 13:52
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.

Posted: 13 Aug 2006, 23:16
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?

Posted: 14 Aug 2006, 12:20
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"

Posted: 14 Aug 2006, 12:21
by AF
ps:: there's no gundam buildtree

Posted: 14 Aug 2006, 22:23
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

Posted: 15 Aug 2006, 00:15
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!

Posted: 15 Aug 2006, 02:39
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.

Posted: 15 Aug 2006, 11:12
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.

Posted: 15 Aug 2006, 19:03
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.

Posted: 15 Aug 2006, 20:07
by AF
really? hmm thats a shame, as I'm about to post the link to the RC22 installer here

Posted: 15 Aug 2006, 20:12
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.

Posted: 15 Aug 2006, 20:21
by AF
it's already uploaded and on darkstars and has been the last 30 minutes

Posted: 15 Aug 2006, 20:24
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.

Posted: 15 Aug 2006, 20:28
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.