metal handler class release
Moderators: hoijui, Moderators
thanks!
I've put a lot of effort in it.
The next relase will be optimized,
and hopefully will support save and load of metal info,
some more defensive code and checks
and a flag to enable logging
note that if we get a unified metal class, we could put the metal info generator on the map creation tool and have all the map to include metal info, and also better hotspot (human placed, maybe)
I've put a lot of effort in it.
The next relase will be optimized,
and hopefully will support save and load of metal info,
some more defensive code and checks
and a flag to enable logging
note that if we get a unified metal class, we could put the metal info generator on the map creation tool and have all the map to include metal info, and also better hotspot (human placed, maybe)
i'll made the constructor of all mine class accept a class with this interface:
//custom logging
virtual void log(char *format, ...);
//custom callback
virtual IAICallback *getCallback();
or
when I've done some progress on the unit group manager and base builder subsystem I'll port all to a generalized Agent system, using a cleaner
(and virtual) callback/info interface
the first change will be to add a flag in the getMetalPatch to select between water / land patches (currently only land are returned)
//custom logging
virtual void log(char *format, ...);
//custom callback
virtual IAICallback *getCallback();
or
when I've done some progress on the unit group manager and base builder subsystem I'll port all to a generalized Agent system, using a cleaner
(and virtual) callback/info interface
the first change will be to add a flag in the getMetalPatch to select between water / land patches (currently only land are returned)

I have tweaked the last released version somewhat, I can think of only one addition to make but otherwise it's running fine, I no longer get any of the flukes where mexes are placed next to existing mexes or on areas with no metal at all, and accuracy does not fall off as you get further fromt eh first mex placed.
http://www.fileuniverse.com/?p=showitem&ID=1675
in getNearestRadius:
this doesn't make any sense.
in get metal amount:
those shouldn't be put here. This wiolates transparency and encapsulation. If you want to put a filter to give better metal weight distribution you shuld place it outside the class, on the returned values or as a metal map preprocessing filter. Or if you like to put it as a local change redistribute the mod as an extending class, so the codebase will remain the same for all. this will prevent the n*codefork problem and the mantainer hell.
I've got the save feature quite working, so you'll have to redo it for the next release, this time do it right, it's not a problem having my code modified, but if you want to release it to the public domain at least make it in a correct way, so everyone could take advantage of the full developing effort of us.
also I didn't like the all-out attack you did on my code, as it turned out to be a your mod that was causing much trouble. I remove the beta status on my code only when absolutely sure it works. As I'm the last entered on the ai scene, getting bad words from others will blacklist my ai forever, even if it would be a good one.
Code: Select all
if(v->size()<(cb->GetMaxMetal()*0.3f)){
delete(v);
return float3(0,-1,0);
}
in get metal amount:
Code: Select all
if(val<(cb->GetMaxMetal()*0.35f)) val *= 0.4f;
if(val>(cb->GetMaxMetal()*0.55f)) val *= 2.5f;
I've got the save feature quite working, so you'll have to redo it for the next release, this time do it right, it's not a problem having my code modified, but if you want to release it to the public domain at least make it in a correct way, so everyone could take advantage of the full developing effort of us.
also I didn't like the all-out attack you did on my code, as it turned out to be a your mod that was causing much trouble. I remove the beta status on my code only when absolutely sure it works. As I'm the last entered on the ai scene, getting bad words from others will blacklist my ai forever, even if it would be a good one.
The aim was to increase contrast on the mex matrix making the AI more accurate, I'm not sure that particular bit of code is the bit that made the improovement though.
However with that version, NTAI places each and every mex perfectly with no random flukes or botched attempts. albeit ti still crashes soemtimes on removeextractor() and addextractor.
As for the first bit, I found ti made more sense than simply putting '== 0'.
As for all out attack, I improoved it for my own AI and showed everyone else the changed code. When under ZcAIn I can play against ti on the pass v2, it is fine with OTA style maps, whereas the same code in NTAI gives very different results for reasons I dont know.
Eitherway I took the best available mex algorithm there was and made a few tweaks.
Other than that chill, if you wanna bad mouth an AI like you say then show replays of ZcAIn destroying JCAI or NTAI, or showing it lasting longer without a crash, afterrall those are the things people want more than arguements over code.
However with that version, NTAI places each and every mex perfectly with no random flukes or botched attempts. albeit ti still crashes soemtimes on removeextractor() and addextractor.
As for the first bit, I found ti made more sense than simply putting '== 0'.
As for all out attack, I improoved it for my own AI and showed everyone else the changed code. When under ZcAIn I can play against ti on the pass v2, it is fine with OTA style maps, whereas the same code in NTAI gives very different results for reasons I dont know.
Eitherway I took the best available mex algorithm there was and made a few tweaks.
Other than that chill, if you wanna bad mouth an AI like you say then show replays of ZcAIn destroying JCAI or NTAI, or showing it lasting longer without a crash, afterrall those are the things people want more than arguements over code.
Alantai, I don't think I am interested in working with you based on what I have seen here. Cain followed some of the basic tenets of good program design and collaboration. Generic > specific code, *especially* in classes.
Regarding your final comment regarding pitting one AI against another, and the performance of your own code, what about rebuilding metal extractors? I did not witness either behavior although I must admit my sampling was limited to a few games.
I think the scope of cain's work was to create a way for you and other developers to write an AI, by solving one of the hardest problems.
Regarding your final comment regarding pitting one AI against another, and the performance of your own code, what about rebuilding metal extractors? I did not witness either behavior although I must admit my sampling was limited to a few games.
I think the scope of cain's work was to create a way for you and other developers to write an AI, by solving one of the hardest problems.
I tried to improove it. And heck i violated certain principles of encapsulating and so on, that i had never been shown or told of before then.
I took his code and tried to make ti work better for my own AI then put it up for everybody else to see so the next version cian released could be perfect, which by his own admition it is not, and I get attacked for it. My intentions where never to disrespect his abilities or damage his reputation in any way, and I've said so, and yet people are giving me the evil eyes.
Is it any wonder I prefer to rewrite other peoples code rather than work on improving it?
Now while I may nto follow these basic tenets, have you considered I am nto aware of them? 6 months ago I didnt knwo how to use STL containers, or basic winsock, switch statements, I was iffy with pointers and the * and & operators whcih i confused a lot at the time, I couldnt open or write to files, I didnt knwo what delegates and member function pointers where, and I had very little experience.
And since then I've learnt a heck fo a lot, yet everybody expects me to ahve read everything on what good programmign design and practise is.
Can someone please point me to a vast repositiory of such documents so I dont fall into these pitfalls of bad programming unknowingly, as so far I've been working on the principles that it should look nice, and it should work.
So dont blast me for not doing things right. Tell me how I went wrong and show me the correct way fo doing thigns instead.
And daraknor, I have only said I will work with you to 2 people. Triaxx and cain, of which onyl triaxx still stands with me in any shape or form. My concern is feedback not coding partners, as every one else I've come across has either prooven themselves unreliable, untrustworthy, or has a problem with me and for some reason refuses to resolve things, which is somethign that anybody i'd work with needs to at least attempt.
I took his code and tried to make ti work better for my own AI then put it up for everybody else to see so the next version cian released could be perfect, which by his own admition it is not, and I get attacked for it. My intentions where never to disrespect his abilities or damage his reputation in any way, and I've said so, and yet people are giving me the evil eyes.
Is it any wonder I prefer to rewrite other peoples code rather than work on improving it?
Now while I may nto follow these basic tenets, have you considered I am nto aware of them? 6 months ago I didnt knwo how to use STL containers, or basic winsock, switch statements, I was iffy with pointers and the * and & operators whcih i confused a lot at the time, I couldnt open or write to files, I didnt knwo what delegates and member function pointers where, and I had very little experience.
And since then I've learnt a heck fo a lot, yet everybody expects me to ahve read everything on what good programmign design and practise is.
Can someone please point me to a vast repositiory of such documents so I dont fall into these pitfalls of bad programming unknowingly, as so far I've been working on the principles that it should look nice, and it should work.
So dont blast me for not doing things right. Tell me how I went wrong and show me the correct way fo doing thigns instead.
And daraknor, I have only said I will work with you to 2 people. Triaxx and cain, of which onyl triaxx still stands with me in any shape or form. My concern is feedback not coding partners, as every one else I've come across has either prooven themselves unreliable, untrustworthy, or has a problem with me and for some reason refuses to resolve things, which is somethign that anybody i'd work with needs to at least attempt.
Cain: I understand your problem. You should make clear, that only your versions are clean, and not AI dependant, and that all other released versions are AI specific.
AF: Make sure you mention that your revisions of Cain's metal class are specifically for NTAI.
Daraknor: Relax. AF is new at this, and can't be expected to pick it all up overnight. Instead of telling him what he should, and shouldn't do, make a suggestion as to how to do what you mean. If he doesn't know how, he's doing it the best way he knows how.
AF: Make sure you mention that your revisions of Cain's metal class are specifically for NTAI.
Daraknor: Relax. AF is new at this, and can't be expected to pick it all up overnight. Instead of telling him what he should, and shouldn't do, make a suggestion as to how to do what you mean. If he doesn't know how, he's doing it the best way he knows how.
One of the things I do for a living is tell people how badly they are screwed up and suggest how they can do it better. I work in political and stressful environments, at a company that does legal document processing when white collar crooks are often going to jail. Our job is to collect the evidence, and we must do a good job. I often note how things can be improved, and how ... territorial people can become. There is a blame game, and a shunting of responsibility game. These are scenes straight from Dilbert. (Btw: I had a dual role as Programmer and Systems Analyst)
So.. I am defensively sensitive to certain kinds of behavior, and while I understand that not everyone here is a working professional I also try to avoid the worst situations based on my experience.
I often suggest changes, and I try to make the suggestions abstract. Things like, "an ideal algorithm would account for X Y Z" instead of "your code is all fucked up!" Both may be accurate, but I strive to be diplomatic while still making optional (in my job - necessary) improvements in the form of suggestions.
I will say again that my issues with joining Alantai had nothing to do with his code, programming skills or development path. I think I would prefer a more Bazaar style open organization, and a more compatible personality type as project lead. I notice Alantai is different in personal vs public communication, I try to be symmetrical not only in presentation but what I am willing to say. I often use private communications, but I am always willing for my private words to be publicly read. The decision between public and private communication is between the idiom, "hanging out your laundry for all to see" and what people are actually interested in.
I don't want to be critical or judgmental, but there is a definite difference in style and Bazaar vs Cathedral.
So.. I am defensively sensitive to certain kinds of behavior, and while I understand that not everyone here is a working professional I also try to avoid the worst situations based on my experience.
I often suggest changes, and I try to make the suggestions abstract. Things like, "an ideal algorithm would account for X Y Z" instead of "your code is all fucked up!" Both may be accurate, but I strive to be diplomatic while still making optional (in my job - necessary) improvements in the form of suggestions.
I will say again that my issues with joining Alantai had nothing to do with his code, programming skills or development path. I think I would prefer a more Bazaar style open organization, and a more compatible personality type as project lead. I notice Alantai is different in personal vs public communication, I try to be symmetrical not only in presentation but what I am willing to say. I often use private communications, but I am always willing for my private words to be publicly read. The decision between public and private communication is between the idiom, "hanging out your laundry for all to see" and what people are actually interested in.
I don't want to be critical or judgmental, but there is a definite difference in style and Bazaar vs Cathedral.
My thoguht at the time was:
Cain says his class isnt perfect and needs work
Cain said soemthing along the lines of having a short amount of time everyday to code and would ahve liked mroe
NTAI needed accurate placement
Cains class was the best on offer
Cains class had a core that did exactly what ti was supposed to do perfectly, ti was the outer core that adjusted for radii that was the problem.
So I thought I'd look through adn se eif ym eprspective could pick out any improovements cains perspective couldnt.
This resutled in an improoved class, still based upon cains core code, but nonetheless it didnt place as many flukes as it used to.
So i showed everyone this code, in hopes that cian would see it then take form ti what he needed and release an even better version than what I had released.
But instead I was harassed, and people looked down on me for tryign to improove.
So should I look through cains code and see possible changes imo would have made it better? And then kept quiet and never said anything? If I where cian I would have liked that someone else chose my code to work on, and I'd be glad that what I had has bene improoved.
All in all I was discouraged from helping improove code, and the message put across was let the author deal with the code, if it doesnt work for you, start your own class from scratch.
daraknor, I had not read the cathedral and the bazaar, I only managed to start reading it today, of which the pritner stopped at page 24 of 35.
But I know enough to see that things need to change and the AI dev community for spring is not a healthy one.
If cain had a problem with people editing his code he should have said so, but he didnt say so.
Since I made that post, cain has not said one word to me in reply save the last post he made above.
Cain says his class isnt perfect and needs work
Cain said soemthing along the lines of having a short amount of time everyday to code and would ahve liked mroe
NTAI needed accurate placement
Cains class was the best on offer
Cains class had a core that did exactly what ti was supposed to do perfectly, ti was the outer core that adjusted for radii that was the problem.
So I thought I'd look through adn se eif ym eprspective could pick out any improovements cains perspective couldnt.
This resutled in an improoved class, still based upon cains core code, but nonetheless it didnt place as many flukes as it used to.
So i showed everyone this code, in hopes that cian would see it then take form ti what he needed and release an even better version than what I had released.
But instead I was harassed, and people looked down on me for tryign to improove.
So should I look through cains code and see possible changes imo would have made it better? And then kept quiet and never said anything? If I where cian I would have liked that someone else chose my code to work on, and I'd be glad that what I had has bene improoved.
All in all I was discouraged from helping improove code, and the message put across was let the author deal with the code, if it doesnt work for you, start your own class from scratch.
daraknor, I had not read the cathedral and the bazaar, I only managed to start reading it today, of which the pritner stopped at page 24 of 35.
But I know enough to see that things need to change and the AI dev community for spring is not a healthy one.
If cain had a problem with people editing his code he should have said so, but he didnt say so.
Since I made that post, cain has not said one word to me in reply save the last post he made above.
And yes I sometimes behave differently on the forum to what i do personally communications wise. This is because I am a paranoid person who has so far been very protective of what he knows, and is fearful fo fulyl contributing to everybody else for fear of reprisal.
Any wodner I stopped releasing code to NTAI? Maybe I was paranoid the competition would take what I had and apss it off as their own and claim they did it first, I wanted NTAI to be succesful for the most part and I felt that keeping evrythign open was damaging, especially when everyone else was keeping quiet too.
But things need to change once and for all. Zaphod, sub cain everyone else, you need to read cathedral and bazaar too, maybe you'll see what you'e doing for what ti really is.
For this purpose I've 2 archives here, that I'm uploading to fileunvierse.
The first archive is the NTAI 0.27 with a few minor fixes, complete exception handling, as far as I am aware, completely errorless.
The second archive is a 1MB file containign my Dev folder. This would eb the source for NTAI, including a helpers fodler with lots of other minor experiments, such as the Build Agent with ym modified closestBuildSite() variant that slows the engine down, and modified JCAI build code, the declarations for my new Map GUI class, an attempt to integrate the TOOL interpreter into NTAI, an autoupdate class I ahvent finished porting to NTAI, a few files with useful functions, etc.....
As daraknor said in an email, I'm the gatekeeper, the project manager, the programmer, I'm suign a cathedral based approach, and why? Because I had been pushed into it by the way the others behaved, making me paranoid (its easy tog et me paranoid and I get very defensive because of it).
I'm tired of people using inferior class's because the one Alantai wrote isnt 'just right', or being harassed because I tried to help. I dotn want to have to write all my own classes from scratch to prevent reprisal from other AI devs or being accused of stealing code.
So from now on we use the bazaar model, and if you dotn I'll go ahead and do it that way anyway. I'll give the people what they want as best I can and I wont flame people who try to help, I'll show everyone my ideas and I wont lock them away in an invite only forum.
And wether AAI or whatever cain throws out after zcain 0.2 gets better than NTAI, people will know I'll be honest about what i'm doing, and they'll know where I'm going and what to look forward to, and they'll have their say. I'm here to stay and I wont be gone for a long while. I was here before the rest of the AI devs posted code, and I'll be here when you've gone.
Any wodner I stopped releasing code to NTAI? Maybe I was paranoid the competition would take what I had and apss it off as their own and claim they did it first, I wanted NTAI to be succesful for the most part and I felt that keeping evrythign open was damaging, especially when everyone else was keeping quiet too.
But things need to change once and for all. Zaphod, sub cain everyone else, you need to read cathedral and bazaar too, maybe you'll see what you'e doing for what ti really is.
For this purpose I've 2 archives here, that I'm uploading to fileunvierse.
The first archive is the NTAI 0.27 with a few minor fixes, complete exception handling, as far as I am aware, completely errorless.
The second archive is a 1MB file containign my Dev folder. This would eb the source for NTAI, including a helpers fodler with lots of other minor experiments, such as the Build Agent with ym modified closestBuildSite() variant that slows the engine down, and modified JCAI build code, the declarations for my new Map GUI class, an attempt to integrate the TOOL interpreter into NTAI, an autoupdate class I ahvent finished porting to NTAI, a few files with useful functions, etc.....
As daraknor said in an email, I'm the gatekeeper, the project manager, the programmer, I'm suign a cathedral based approach, and why? Because I had been pushed into it by the way the others behaved, making me paranoid (its easy tog et me paranoid and I get very defensive because of it).
I'm tired of people using inferior class's because the one Alantai wrote isnt 'just right', or being harassed because I tried to help. I dotn want to have to write all my own classes from scratch to prevent reprisal from other AI devs or being accused of stealing code.
So from now on we use the bazaar model, and if you dotn I'll go ahead and do it that way anyway. I'll give the people what they want as best I can and I wont flame people who try to help, I'll show everyone my ideas and I wont lock them away in an invite only forum.
And wether AAI or whatever cain throws out after zcain 0.2 gets better than NTAI, people will know I'll be honest about what i'm doing, and they'll know where I'm going and what to look forward to, and they'll have their say. I'm here to stay and I wont be gone for a long while. I was here before the rest of the AI devs posted code, and I'll be here when you've gone.
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29