Krogothe's Metal Class v2
Moderators: hoijui, Moderators
yeah, im working on it (even if slowly)! Before i was just tweaking the existing code and seeing the best personalities, which wasnt really useful code, so i deleted the whole attacking and building code and am working on the infrastructure, eg buildmaps, a unified unit class,economy etc...
gonna be a while till its playable again, hopefully just after then next spring release.
gonna be a while till its playable again, hopefully just after then next spring release.
Alright, let's get back to the topic. AF, if you want his source, send him a PM, or E-mail and ask him for it.
That's why you want to keep the file as small as possible Kelson, to make the loading times as rapid as possible. That's why you'd apply the extractorRadius algorithm's after you load the file, instead of trying to store them with the co-ordinates. And if you have a metal vein, you only store a few co-ordinates, instead of every single one.
That's why you want to keep the file as small as possible Kelson, to make the loading times as rapid as possible. That's why you'd apply the extractorRadius algorithm's after you load the file, instead of trying to store them with the co-ordinates. And if you have a metal vein, you only store a few co-ordinates, instead of every single one.
Actualyl I have pm'ed hims everal times and he promised to release but he never did, and that was quite a while ago, he then tried to say we didnt need source for newer versions to work on AAI code because we could bugfix it ourselves rather than use his current source. That and every post he makes about standards seems to try to quash what I say in favor of single AI standards rather than community standards.
Much worse thigns have been said here, and I'm not posting a huge rant like I could do, and I am certainly not whining, I am annoyed by submarines lack of source code combined with what I remember him saying, and if it was really I want I want I want, then why am I not harassing Krogothe for KAI 0.0 source? He hasnt promised its release to me or anyone else, he hasnt touted it as opensource, if anything I'm not annoyed by krogothe, I think friendly rivalry is more appropriate and I wouldnt mind giving him code with none in return as he has done with his metal class. So no it isn't 'I want I want', and it isnt whining else I would ahve amde lots of posts consistently throughout the forum, instead I amde a few comments in a single post that people then tried to capitolize on to flame me, so i defended myself and tried to further explain my actions.
Eitherway Bvdorp, if you know me, you'll know I'm here to stay and I'll be here a loooong time....
Much worse thigns have been said here, and I'm not posting a huge rant like I could do, and I am certainly not whining, I am annoyed by submarines lack of source code combined with what I remember him saying, and if it was really I want I want I want, then why am I not harassing Krogothe for KAI 0.0 source? He hasnt promised its release to me or anyone else, he hasnt touted it as opensource, if anything I'm not annoyed by krogothe, I think friendly rivalry is more appropriate and I wouldnt mind giving him code with none in return as he has done with his metal class. So no it isn't 'I want I want', and it isnt whining else I would ahve amde lots of posts consistently throughout the forum, instead I amde a few comments in a single post that people then tried to capitolize on to flame me, so i defended myself and tried to further explain my actions.
Eitherway Bvdorp, if you know me, you'll know I'm here to stay and I'll be here a loooong time....
Krogothe said v1 could do with some changes, optimizations and general structure improvements basically.
Considering that, mex spots found by this class are not entirely adequate. Just try runnign NTAI XE on brazillian battlefields and looking where it palces the yellow triangles on the map. That and it's always in the top left corner of the mex spot on OTA style maps, with the radius only just covering the spot, which soemtimes it doesnt cover at all.
Considering that, mex spots found by this class are not entirely adequate. Just try runnign NTAI XE on brazillian battlefields and looking where it palces the yellow triangles on the map. That and it's always in the top left corner of the mex spot on OTA style maps, with the radius only just covering the spot, which soemtimes it doesnt cover at all.
look at brazillian battlefields whcih si a prime example.
Also the order in whcih mex spots are placed is questionable. The commander doesnt always goto the nearest mex to the starting pos, sometimes skipping it on some maps and going for something a screens worth of distance away instead.
Which si dod sicne I changed the wraparound I have to search through them all and find the closest mex spot......
Also on comet catcher remake there's a mex spot according to this class that's right down in the bottom right hand corner past the start pos down there, but there isnt one.....
Also the order in whcih mex spots are placed is questionable. The commander doesnt always goto the nearest mex to the starting pos, sometimes skipping it on some maps and going for something a screens worth of distance away instead.
Which si dod sicne I changed the wraparound I have to search through them all and find the closest mex spot......
Also on comet catcher remake there's a mex spot according to this class that's right down in the bottom right hand corner past the start pos down there, but there isnt one.....
This means IT WILL NOT FIND THE MOST APPROPRIATE SPOT, only give you a vector with all the spots, ordered by metal amount. I cannot be expected to guess which spot would be the best one for your AI to pick, it could be based on threat, accesibility, proximity, best builder, amount of metal... This isnt your complete metal solution. It does what it says on the tin: a vector with all the spots on the map, ordered by metal amount. You have to do the rest of the work yourselfAgain, this is the barebones stuff, only returning the spots. This is intended since there are n ways to find the most appropriate spot at any given time.

I tested it on CC remake AND brazilian battlefields. All spots were correctly found, and there were no imaginary ones. I placed every single one of the 81 mexes on that map myself and checked their positions against the ones found by KAI to test it out. I took half an hour double checking it just to be sure. Yes, the spots are shifted to the top left, but they should extract the full metal either way.
Try the latest version of the class, chocapic had some trouble with an older version (a similar problem, imaginary mex on corner).
sorry if im being rude, but wasting time isnt my cup of tea, get the version posted above and try it as it is. If that doesnt work then i must have messed it up somehow in the upload process. Sending me some TGAs and the saved files would help too.
ahem, look at the code for XE, and test out XE on brazil battlefields, and look at where the markers are with relation to the map.
And yes you are correct about the mexes that're to the top left corner, but onyl on OTA maps. On a spring style metal map it can make a big difference.
XE will place yellow spinning triangles wherever there are mex spots found by your class regardles sof wether its the most appropriate. It is the equivilant of the ingame "debugvectoredspots.tga" but animated so you can see for yourself how accurate it is.
However i will rummage around later and take a screenshot and post it tomorrow. The metal cache I used is available in the XE 2/3 installers along with 5 or more other cached metal files. XE 2+3 use v2 of your class.
And yes you are correct about the mexes that're to the top left corner, but onyl on OTA maps. On a spring style metal map it can make a big difference.
XE will place yellow spinning triangles wherever there are mex spots found by your class regardles sof wether its the most appropriate. It is the equivilant of the ingame "debugvectoredspots.tga" but animated so you can see for yourself how accurate it is.
However i will rummage around later and take a screenshot and post it tomorrow. The metal cache I used is available in the XE 2/3 installers along with 5 or more other cached metal files. XE 2+3 use v2 of your class.
How do i enable those markers?AF wrote:ahem, look at the code for XE, and test out XE on brazil battlefields, and look at where the markers are with relation to the map.
It places spots where you get the most metal, it places them in the corner for OTA maps because its the first spot to give full metal amount. On spring metal maps it simply places them where it will give the most metal, so it wont harm the placement since it will always get the spots with the most metal.AF wrote: And yes you are correct about the mexes that're to the top left corner, but onyl on OTA maps. On a spring style metal map it can make a big difference.
I had a look at your caches and they seem fine, are you sure its not ClosestBuildSite getting in the way? Your cache has 81 spots on CC remake, so if your AI is placing imaginary mexes its its own fault since the caches are correct. I dont really need to see your markers, i checked the caches and theyre perfect on CC remake, so NTAI is making up the spots. Check your building code maybe?AF wrote: However i will rummage around later and take a screenshot and post it tomorrow. The metal cache I used is available in the XE 2/3 installers along with 5 or more other cached metal files. XE 2+3 use v2 of your class.
Checking if the spots are wrong on BB would take a longer look, and im not willing to do that since i already lost enough time. Open the cache file, look at the coords for the top 5 spots, place a mex in each of them (make sure you do it exactly) then note down the combined metal output. If you or an automated method can top that, then ill have a look at it, otherwise ill remain convinced its not my class' problem, but NTAIs. Keep in mind that AFAIK this is not my problem, so doing some work to prove there actually is a problem would be nice instead of wanting me to sort your AI out.
I admit I may ahve bene testing a wrong version on cometcatcher at that time, however the brazillian battlefield sis definately v2.
The yellow triangles ALWAYS get shown by NTAI, no matter what you do. At the very beginning it'll draw them where the metal clas shas found spots, they will dissapear never to return after 20 seconds however and to get them back you need to restart the game. The spots on brazilian battlefields do generate metal but they're hardly adequate for obvious reasons if you look why.
Also closestbuildsite shouldnt affect those markers since they're directly taken from your class. And the metal extractors built by NTAI are palced where the markers where and not in the locations I or cains original algorithm would have chosen. While cains original algorithm would be better on brazliian battlefields than your algorithm, his was slower and performed worse on metal maps and want as acurate as yours on patch metal style maps.
The yellow triangles ALWAYS get shown by NTAI, no matter what you do. At the very beginning it'll draw them where the metal clas shas found spots, they will dissapear never to return after 20 seconds however and to get them back you need to restart the game. The spots on brazilian battlefields do generate metal but they're hardly adequate for obvious reasons if you look why.
Also closestbuildsite shouldnt affect those markers since they're directly taken from your class. And the metal extractors built by NTAI are palced where the markers where and not in the locations I or cains original algorithm would have chosen. While cains original algorithm would be better on brazliian battlefields than your algorithm, his was slower and performed worse on metal maps and want as acurate as yours on patch metal style maps.
just give me a TGA or do what i said if you want help. Im through with this "my mex class is the best" crap, so if you dont like it feel free not to use it, however so far Im yet to see it mess up. I havent received complaints from anyone else yet thus im not really inclined to note down locations of triangles and test them myself, even because they arent helpful info since some spots will naturally have less metal than others. Its a TGA or the 5 mex test, if you want help
ok I'll get you a screenshot then, adn no I wasnt touting my mex algorithma s better. Cains algorithm si slow unwieldy, doesnt have a working save function and is best at doing spring style maps, falls down on metal maps completely, and performs poorly on patch maps, whereas yours loads fast, saves and loads correctly, performs best on patch style maps which most maps are, and is easy to use.
I find that marking the locations fo triangles to get their positions si pointless, you can see easily that the mex positions your class chose on brazil battlefields are far from the most optimal just by pressing f4 and looking where the triangles are, or even waiting for NTAI to build mexes as they're always where the triangles are. If ti cant do ti then it runs closestbuildsite() which has a search radius of 60, so it'll be close anyway.
I find that marking the locations fo triangles to get their positions si pointless, you can see easily that the mex positions your class chose on brazil battlefields are far from the most optimal just by pressing f4 and looking where the triangles are, or even waiting for NTAI to build mexes as they're always where the triangles are. If ti cant do ti then it runs closestbuildsite() which has a search radius of 60, so it'll be close anyway.
heh dont worry AF im not mad or anything, i was arrogant and annoying before, blinded by my pride, so no need for that first paragraph
Ill be going on holiday for a week tomorrow and really havent got the time to do the triangle check, even because i cant be sure they were drawn exactly on the spots found. Delete the cache, make it again then send me a TGA or a documented 5-mex test tonight still, its the only way ill be able to help you mate. Mexes placed by NTAI and triangles could be biased so i need the raw output of the class to be tested.

Ill be going on holiday for a week tomorrow and really havent got the time to do the triangle check, even because i cant be sure they were drawn exactly on the spots found. Delete the cache, make it again then send me a TGA or a documented 5-mex test tonight still, its the only way ill be able to help you mate. Mexes placed by NTAI and triangles could be biased so i need the raw output of the class to be tested.
i really dont think its a good idea if several ai devs use the same data files. on the first hand i want to make sure that if aai crashes it is due to MY fault and not someone else messing around in its learning files. second im changing my files all the time, i want to be flexible and beeing able to change things quickly whenever i think its necessary.AF wrote:I remember asking him fi I could use his learnign code as a template to start my own learnign code and one of his replies was, dotn use the learning data AAI stores, make your own data.

Those yellow triangles are all generated using raw data taken directly from the vector<float3> in your class.
They're generated by taking that point, and then creatign 3 new points. 1 for each triangle corner, the first is created by taking away R from the Z alue fo the centre point, then that point is rotated twice 120* around the centre point to get the 2 other corner, then it's rotated x degrees every 2 frames. As you cans e ethey're not optimal points, and NTAI has started an imperial metal extractor under one fot he triangles, which means that ti still has the same position even though that raw data has been ran through a selection process to generate the position for the mex.
The triangles are the quivilant to the big green markers that where palced, by either you or veylon i cant remember which as a debugging test. The data for those markers is present in the XE 2+3 installes as cached data.
EDIT:: That shto was taken in OTA view but reorientated so ti was as close to a 90* down angle as I could get to minimize paralax error. Those triangles are all the same height above the terrain at their centre point, which si around 30.
Would you guys be interested in some maps made just for extractor placement testing?
I could do maps with;
No metal at all. - This caused pc resets last time I tried!
Metal patches that are on difficult terrain, a few flavours,
a) sweet spot unbuildable due to steepness - will nearest buildable site be used?
b) sweet spot buildable but inaccessible - will nearest buildable site be used?
c) mixed a) b) and "normal spots"
Graduated density - will a distant hight yield spot be favoured over a nearer low yield spot?
I could do maps with;
No metal at all. - This caused pc resets last time I tried!
Metal patches that are on difficult terrain, a few flavours,
a) sweet spot unbuildable due to steepness - will nearest buildable site be used?
b) sweet spot buildable but inaccessible - will nearest buildable site be used?
c) mixed a) b) and "normal spots"
Graduated density - will a distant hight yield spot be favoured over a nearer low yield spot?
- Lindir The Green
- Posts: 815
- Joined: 04 May 2005, 15:09
Ahem, they are totally inadequate. The point of krogothes clas sis it returns the hotspots, the patches of metal, the places that are the ideal palces to put emxes wetehr you cna build there or not.
The actual which extractor can be palced at those spots, is ti within radius of an existing extractor, can it actually be built on there si the wraparound classes job, and it shouldnt have to change the results of krogothes class in that sort of way. There is an ideal place to put those markers, they should be on the spots that a human would ideally palce them it's the obvious, even cains original algorithm put them in the right place, as did Zaphods algorithm, and the version submarine originally used before he switched, and the OTAI algorithm veylon used, they all gave optimal results that krogothes class is clearly not giving.
So dotn anybody lecture me on havign a faulty wraparoudn class. It's been tested across multiple algorithms and based heavily on code from cain who knows much more than you or krogothe does about code.
Your other chance is to see how the next OTAI deals with this, sicne it's presumably goign to sue the newer version with onyl changes beign binary versus ascii save format and OTAI logging integration. Veylon wrote his own wraparound class to deal with choosing which mex spot to put the next mex on.
The actual which extractor can be palced at those spots, is ti within radius of an existing extractor, can it actually be built on there si the wraparound classes job, and it shouldnt have to change the results of krogothes class in that sort of way. There is an ideal place to put those markers, they should be on the spots that a human would ideally palce them it's the obvious, even cains original algorithm put them in the right place, as did Zaphods algorithm, and the version submarine originally used before he switched, and the OTAI algorithm veylon used, they all gave optimal results that krogothes class is clearly not giving.
So dotn anybody lecture me on havign a faulty wraparoudn class. It's been tested across multiple algorithms and based heavily on code from cain who knows much more than you or krogothe does about code.
Your other chance is to see how the next OTAI deals with this, sicne it's presumably goign to sue the newer version with onyl changes beign binary versus ascii save format and OTAI logging integration. Veylon wrote his own wraparound class to deal with choosing which mex spot to put the next mex on.