NTAI 0.28.10 final - Page 4

NTAI 0.28.10 final

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

Moderators: hoijui, Moderators

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

Post by AF »

I'm thinking the switch to krogothes mex class should fix that.
User avatar
sintri
Posts: 55
Joined: 30 Nov 2005, 18:38

Post by sintri »

nothing runs on iceburgs, no land, for the ais to build their precious kbot facts
MasterChiefRulZ
Posts: 15
Joined: 07 Dec 2005, 02:52

Post by MasterChiefRulZ »

Anyone have any links to this AI file?

All the links I've tried in this thread seem broken. :?:
Iax
Posts: 16
Joined: 17 Nov 2005, 06:51

Post by Iax »

one more thing to look into in the AI, is that if you have multiple NTAI's running I think it generates the metal info for the map mutiple times.
Because it seems to take much more time the more NTAIs you add.

Infact it seems to generate the metal info file everytime you play the same map.

Maybe you should include something so it only has to do it once.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

cains class attempts to save the data to a file so ti doesnt ahve to recalculate.

In the event that 4 NTAI\'s are running, the first NTAI will generate the data then save it, the second NTAI will see the data the first generated and laod it etc..

But cain never managed to get laoding working so it always generates the data and saves it. This should be fixed hwoever sicne Krogothe has a workign save/load/cache mechanism, and according to krogothe, hsi class generates the data quicker than cains, but i cant comment any further on that till I\'ve ran a good test run of it.

If you\'re on an all water map then NTAI shall attempt to run all the alnd atsks and find no available build psoitions. Thus the oynl thgint he comamnder will build is a shipyard and the shipyard should work fine buit may end up stalling.

For the next version, I would like someone who knows more about AA to help me create a side build tree specifically for AA, aswell as one to take advantage of the techforge. Also if somebody could generate an alternative commander build order based on a watermap environment, I knew nothing much about howto do the naval stuff in NTAI using XTA, I just stuck a wide variety of stuff and plenty of skeeters and con ships.

I also know work is being done on a WD build order. Also alternative buidl trees for the kbot labs and vehicles, so that NTAI can go down either path instead fo always rlying totally on kbots, and always buildign the same kbots, perhaps a buildtree for the core adv lab that just built cans, lots and lots fo them, givign the possibility NTAI might do a can rush but not necessarily always. Maybe even a late game versus early game build tree? All these would help NTAI be all the more challenging.

I\'ll generate some documents showing what the current build tree is for all of those of you who find an if statement clouds your head up too easily. Then maybe those fo you who know more can suggest changes, as I am not an expert in XTA strategy and I havent been playing multiplayer for months either. Also remember that you can expect parts of the buildtree to be built for no reason but for backup, sucha s the mexes before the adv kbot lab under core are too many, but you can expect some to be blown up so they balance out.

Also extra thigns such as what ratio fo con untis should ven eb given a build tree? Lets say for every 5 con units 1 is sent to guard the factory that built it ro another unguarded factory.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

I am not sure if my class is faster than cains since i havent tried it, so dont get the wrong idea...
But it is a fact that mine finds spots with 100% accuracy (so far) in the quickest possible time for any spot finding class. Well there is a 5-10% optimization possible that saves the AI calculating some square roots in exactly half of the spots.
If Cains is faster it cannot be more accurate, thats all Im saying... (sub-100% accuracy could be okay too for a speed tradeoff!)
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

how do you know? can you mathematically proove that no algo exists, that can solve the problem faster?!?
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

because to find a spot you need to go through all pixels in the metal map, and scan all the pixels around it in the extractor radius to get the amount of metal produced were an extractor be placed on that pixel. That is a mathematical fact and how the spring engine itself works out the metal in a spot.

After a spot is taken, you must take into account that the metal around that spot is removed, so you need to recalculate a lot of spots, precisely all spots between 1r and 2r, where r is the extractor radius. Points further away cannot be affected and points inside that radius are already set to zero. If you want to find ALL spots youll have to repeat that until no metal is left on the map.That is a mathematical and logical fact.

My class does exactly that, not checking a single pixel more or less than it should in all its millions of calculations.

The only ways to do that job better would be to optmize the actual processing of the points, by using the square-inside circle method i explained to you that saves the AI calculating square roots by just doing a range check in some points. Other things like using a vector instead of 2 arrays for the spots would also speed it up, but it would not change the core structure, which is (unless theres a new discovery in maths or some extremely complex pattern-learning-intelligent-spot-finding-AI) 100% accurate and as efficient as it can be since it processes the exact amount of pixels necessary.

Of course this is an assumption based on what I view as facts. Id be glad if anyone came with proof that there is a faster AND as accurate way of doing it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Not at all, zaphods original algorithm was able to discard entire sectors of the mex map as useless.

Somethign akin to generating a grid on the map and finding the average mex value. If the average was zero then no more procesing was done on those sectors. Findign the mean value was thus a lot better than processing the entire map.
Oh and that previous post got my internet access taken away from me in school.
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

Before studying algorith, I didn't understand how we can sort a tab faster than with a bubblesort with flags...
There is always a way to make it quicker.
For exemple, you can switch your algo if it's a ota patch style or spring style.

For ota style patch, you can divide the map by 4 square, a bit like AF said, and then for each sqare, if there is metal, divide it by 4 again, and again...etc
I don't really know if it work, but it's to show there is a lot a way to do the same thing.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

You could do a quicksort on the metal map then eliminate pixels that are next to eachother, thats how TAI 0.1 did it, but there was a bgu that meant the for loop iterated idneifnately then crashed so I cant comment any further on that. Then you'd just strike of mex spots from the top.

Better yet you could icnrementally parse the map, sector at a time absed on when it's needed. Lets say aprse alls ectors around a position, if no spots are found extend the radius and try those and so on.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

The solutions you guys propose still either eliminate possible mex spots, such as spots in between hight metal areas with no metal on the spot itself (eg many places in smalldivide).
There are places with ZERO metal that still make wonderful spots since they lie between metal-high areas...
I rest my case, your methods will reduce accuracy in some maps...
If the metal extractors worked by only taking the metal off one pixel, then yes a quicksort or something similar would be faster (but it wouldnt be needed since getting just the values of the pixels takes milissenconds)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Not at all, all our methods would do fien when placed as the core fo cains metal class. cains class core doesnt deal with that either, these are just fidnign hotspots. Cains class deals with extraction ranges and where the actual placement of the mex goes.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

What is the definition of a hotspot?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

A hotspot is a mex spot as you see it on the map.

A hotspot gives you metal, a lto fo it, and these are palces you want to palce mexes on. However it is possible to ahev a hotspot you cant build a mex on.

mexspots are the spots the code palces a mex on in roder tog et as near to a hotspot as possible.

As long as you cna provide cains class with a vector<float3> array called hotspots then you can get all the additional benefits it gives such as how ti deals with extraction ranges etc.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

hotspots are ABSOLUTELY related to extraction radii in pretty much ALL but metal and tiny spot maps!!
you CANNOT work out proper hotspots in maps like corrosive pits and smalldivide if you dont take averages and take the extraction radii into consideration like i said!
Placing a mex next to the best spot requires all but a simple ClosestBuildSite, but if you cant find the best spots in first place it wont work...
maybe you didnt see what my class does (simply return an array of the best spots to build a mex on), maybe im speaking chinese by accident again... either way Im not getting into another argument with you AF, its not gonna go anywhere...

Try making this sector-based class and we can then build mexes on say the top X spots and see which class made the most metal on them. Youll never beat mine (its mathematically impossible) but kudos for you if yours can do what mine does in a shorter time...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

hmmm? Thats nto what i was saying at all, you've totally missed the point. Yes you could use closestbuildsite then tick the hotspot off the list btut hat wouldnt be goo? What fi 2 hotspots are a mex's distance apart? Or an existing mex already has an extraction range that covers half of the spot?

It's more complicated in some cases than just using closestbuildsite, and what if the mex spot uses spring style metal map and the extraction range doesnt cover enough to take full advantage of the spot, perhaps 3 mexes could cover the whole area. Look at how cains class deals with ti and how ti works in practice. Why it places fluke spots if the radii multiplier is too low, and what efefct ti has.

You keep thinkign I dont udnerstand you. But I do, it's your interpretation of me that is at fault. Eitherway I'm obviously speaking japanese cause your not udnerstandign anythign I'm saying, your misinterpreting it all.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

Exactly :)
we cannot communicate properly when debating so its best to just leave it...
Time will tell if theres a more efficient spot finder out there...
User avatar
Masse
Damned Developer
Posts: 979
Joined: 15 Sep 2004, 18:56

Post by Masse »

damn u folks just chill and sitback and wait for christmas :lol:
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'm just tired of this.

Krogothe please be more modest, I never itnended for you to hijack my thread, so please dont do anymore the best this will win, or my stuf cna do this and that, you keep mentioning your class this and your class that, I've already said I'm switching to it, what more do you want? I was tryignt o explain and you went off on one. Calm down, and try not to get up in arms over everythign.

If you dont udnerstand soemthing say so dotn assume, and dotn assume I'm the oen who doesnt understand all the time.
Post Reply

Return to “AI”