Okay, got a new version again, 1.13. I spent a lot of time trying out that MFC threading and getting frustrated before giving up on that. I also cut the max number of buffered commands from eight to four, although some commands aren't buffered at all.
@ignesandross: Feel free to test however you like. If you have any questions, send me a message or email.
About the D-Gun commands, I'm going to have to just ignore the 2nd, 3rd, etc. attackers until the commander has set off a d-gun shot, only the system never says when a shot is given off, so it's hard to tell.
I'm also going to have to crack down on a lot of these little bugs, especially the one where a unit is started and abandoned immediately, it can cause an Adv. Builder to have a mex demolished, and then never replace it!
I'm moving to a more object-oriented approach, and get the code moved into CUnit objects so that units are directly told what to do, instead of the huge amount of code I currently have in the GlobalAI.cpp file. Hopefully, I should be able to get everything cleaned up so that OTAI won't have so many problems.
OTAI Thread
Moderators: hoijui, Moderators
Great to hear!!!
You dont mind me packaging OTAI 1.14 with XE8? Give people something todo AI vs AI battles?
I agree that your code could do with such a cleanup, as I'm currently doing a little spring cleaning of NTai code myself in XE8.
XE8 currently fires off a dgun and sets a bool variable for that unti to true which then gets turned back to false when unitIdle() is called that way I can chekc if it's true when I fire the dgun and abort if so, so that it'll onyl fire one at a time and wotn fire a second till the first has been fired (unitIdle() is called when the dgun projectile has bene fired)
Did you attempt to implement predictive dgunning? What's your attack destination guestimator and how did it work?/did you intend it to work? It's just commented out atm.....
You dont mind me packaging OTAI 1.14 with XE8? Give people something todo AI vs AI battles?
I agree that your code could do with such a cleanup, as I'm currently doing a little spring cleaning of NTai code myself in XE8.
XE8 currently fires off a dgun and sets a bool variable for that unti to true which then gets turned back to false when unitIdle() is called that way I can chekc if it's true when I fire the dgun and abort if so, so that it'll onyl fire one at a time and wotn fire a second till the first has been fired (unitIdle() is called when the dgun projectile has bene fired)
Did you attempt to implement predictive dgunning? What's your attack destination guestimator and how did it work?/did you intend it to work? It's just commented out atm.....
http://www.fileuniverse.com/?p=showitem&ID=2994 OTAI 1.13
http://www.fileuniverse.com/?p=showitem&ID=2993 OTAI 1.13 Source
http://www.fileuniverse.com/?p=showitem&ID=2993 OTAI 1.13 Source
Alright... Plenty of questions here... All from AF...
If you want to package OTAI with XE8, I'd be perfectly fine with that. I like AI vs AI battles as much as anyone. As for code cleaning, right now I'm pulling most of the code out of the GlobalAI.cpp and putting it into individual unit type classes (CUnit, CAttackerUnit, CBuilderUnit, etc.), so that's going to take a while, so don't expect 1.14 for a while until I get things figured out. My UnitIdle function in my AI has been cut down from about a million lines of code to this:
And other functions of comparable size have taken similiar cuts, with the code going into the Unit classes after some heavy modification.
I see that you've found the direction predictor in my code, so I'll explain how it worked: Each several frames, I stored the location of a unit, up to five. With those five, I made four directions (1->2, 2->3, 3->4, 4->5). Then I took a weighted average by multiplying the oldest direction by 1, the second oldest by 2, the third oldest by 3 and the newest by 4, then added them together and divided by ten. This I used as the average direction and speed of the unit.
If you uncomment the code, you should see units being preceded by green lines, I think. And I think that there's something or other in GlobalAI.h that needs to be uncommented too.
I was making it to predict where a unit was headed so I could intercept it. (And now that I think of it, I could also predict where it was coming from. Hmm.) So, no, it wasn't for D-Gunning.
Anyway, It's one the many things in the AI that I made a little bit and then gave up on for a while, like the custom pathfinder, the airborne transport service, and the skywriting that got sketched out in the code but never completed. I intend to get back to them all...eventually.
If you want to package OTAI with XE8, I'd be perfectly fine with that. I like AI vs AI battles as much as anyone. As for code cleaning, right now I'm pulling most of the code out of the GlobalAI.cpp and putting it into individual unit type classes (CUnit, CAttackerUnit, CBuilderUnit, etc.), so that's going to take a while, so don't expect 1.14 for a while until I get things figured out. My UnitIdle function in my AI has been cut down from about a million lines of code to this:
Code: Select all
void CGlobalAI::UnitIdle(int unit)
{
myUnits.find(unit)->second->Idle();
}
I see that you've found the direction predictor in my code, so I'll explain how it worked: Each several frames, I stored the location of a unit, up to five. With those five, I made four directions (1->2, 2->3, 3->4, 4->5). Then I took a weighted average by multiplying the oldest direction by 1, the second oldest by 2, the third oldest by 3 and the newest by 4, then added them together and divided by ten. This I used as the average direction and speed of the unit.
If you uncomment the code, you should see units being preceded by green lines, I think. And I think that there's something or other in GlobalAI.h that needs to be uncommented too.
I was making it to predict where a unit was headed so I could intercept it. (And now that I think of it, I could also predict where it was coming from. Hmm.) So, no, it wasn't for D-Gunning.
Anyway, It's one the many things in the AI that I made a little bit and then gave up on for a while, like the custom pathfinder, the airborne transport service, and the skywriting that got sketched out in the code but never completed. I intend to get back to them all...eventually.