OTAI Thread
Moderators: hoijui, Moderators
well, symetric multi processing, of course :D
I never went into the real of threadsafe programming myself, but it would be worthwhile to check out, as it would really be cool to offload ALL ai load on the second core that way.
As dual core gets more and more common, that way you can have the whole cpu for the physics&gamelogic, plus can spend the whole cpu time of the other one for ai calculations/stuff.
Edit: just checked the new build:
i tested it on speedmetal and wideopencombat (yeah, i know, maps suck, but that doesnt matter).
It didnt crash on startup, but on speedmetal it crashed reproducably after about 2 minutes, and on wideopencombat after 5-10 minutes.
The crash is unusuall in the way the game contiunes for a minute or so while the "do you want to send crash information" window pops up until there is some kind of timeout, so i think its a protection fault in the ai dll.
Did you make sure that everything is thread-save? i.e. nothing can be catched in an non-well defined state during a synchronisation event?
I never went into the real of threadsafe programming myself, but it would be worthwhile to check out, as it would really be cool to offload ALL ai load on the second core that way.
As dual core gets more and more common, that way you can have the whole cpu for the physics&gamelogic, plus can spend the whole cpu time of the other one for ai calculations/stuff.
Edit: just checked the new build:
i tested it on speedmetal and wideopencombat (yeah, i know, maps suck, but that doesnt matter).
It didnt crash on startup, but on speedmetal it crashed reproducably after about 2 minutes, and on wideopencombat after 5-10 minutes.
The crash is unusuall in the way the game contiunes for a minute or so while the "do you want to send crash information" window pops up until there is some kind of timeout, so i think its a protection fault in the ai dll.
Did you make sure that everything is thread-save? i.e. nothing can be catched in an non-well defined state during a synchronisation event?
Well, im out of programming since around 2001, so my knowledge has become a bit rusty...
I would suggest browsing the msdn page about multithreading:
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
This should at least be a general introduction. The subject is vast and complicated, though.
I would suggest browsing the msdn page about multithreading:
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
This should at least be a general introduction. The subject is vast and complicated, though.
Here's the page for the threading stuff I've been using:
http://msdn.microsoft.com/library/defau ... readex.asp
http://msdn.microsoft.com/library/defau ... readex.asp
New version: 1.09
I've added a new section in mods.cfg so that it can start out with a build list. It's pretty primitive, but it does keep OTAI from stalling out on certain mods (Nanoblobs, Gundam, helps with AA).
I also fixed a potential Multithreading bug by having the BuildingOrganizer mark that a search structure was done after the coordinates had been written, rather than before.
I've added a new section in mods.cfg so that it can start out with a build list. It's pretty primitive, but it does keep OTAI from stalling out on certain mods (Nanoblobs, Gundam, helps with AA).
I also fixed a potential Multithreading bug by having the BuildingOrganizer mark that a search structure was done after the coordinates had been written, rather than before.
It's on FileUniverse, of course: http://www.fileuniverse.com/?p=listing&ID=104
Here's the word. OTAI does not yet work on 0.7. I will be putting out a version just as soon as:
a) I get spring working on my computer again.
b) I get all my includes to use the right files.
c) I either quit making my own UnitDefs or figure out that class-registering stuff that's been added in there.
As soon as these get done, I'll put out OTAI 1.10.
a) I get spring working on my computer again.
b) I get all my includes to use the right files.
c) I either quit making my own UnitDefs or figure out that class-registering stuff that's been added in there.
As soon as these get done, I'll put out OTAI 1.10.
no need, just do the following:
Take NTAI ro JCAI from the spring source
rip out all our code exept the main class and the itnerface
Shove all your code in there and add your files to the project
recompile
It should compile without needing all that nasty stuff you've ended up doing to get it to compile with unitdefs etc.
Also be aware that MS created their own version fo the STL rather than usign the standard version for soem reason which may be the route of all your problems especially when cosnidering you appear to be using codeblocks rather than VS .Net 2003
Take NTAI ro JCAI from the spring source
rip out all our code exept the main class and the itnerface
Shove all your code in there and add your files to the project
recompile
It should compile without needing all that nasty stuff you've ended up doing to get it to compile with unitdefs etc.
Also be aware that MS created their own version fo the STL rather than usign the standard version for soem reason which may be the route of all your problems especially when cosnidering you appear to be using codeblocks rather than VS .Net 2003
Ah, good idea. I should've thought of that. Thanks. I'll see if it works. What I do with the UnitDefs is kind of unorthodox, so it might not.
I did get that STL stuff working right, because I downloaded the 2003 thing from microsoft that I've been using as the compiler/source/libraries for Codeblocks.
I did get that STL stuff working right, because I downloaded the 2003 thing from microsoft that I've been using as the compiler/source/libraries for Codeblocks.