Page 3 of 6

Posted: 06 Feb 2006, 21:34
by IMSabbel
By the way, i wonder...
If otai uses threads... does it benefit from SMP? I.e. can the ai work swapped out to another cpu /core?

Posted: 06 Feb 2006, 21:57
by Veylon
I have no idea. I just learned how to do stuff with _beginthread() a couple weeks ago and thought I'd try it. I don't even know what SMP is.

Posted: 06 Feb 2006, 22:02
by IMSabbel
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?

Posted: 07 Feb 2006, 15:36
by AF
veylon, can you post the links to where you learnt about threads? and IMSabbel, you seem to know stuff, are there any godo places I can learn about it?

Posted: 07 Feb 2006, 16:16
by IMSabbel
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.

Posted: 07 Feb 2006, 18:05
by Chocapic
beware that multi threading adds a ton of issues while accessing shared data, wich without the specific care leads to inconsistent data.
oh btw the libs the use in multithreaded projects are also multi threaded libs wich are diferent from the ones used regularly

Posted: 09 Feb 2006, 22:46
by Veylon
Here's the page for the threading stuff I've been using:
http://msdn.microsoft.com/library/defau ... readex.asp

Posted: 12 Feb 2006, 23:24
by mynthon
I dont know why but sometimes, after big battle (when AI loses a lof of units) computer sends commander to "my base".

Posted: 13 Feb 2006, 01:45
by Chocapic
mynthon wrote:I dont know why but sometimes, after big battle (when AI loses a lof of units) computer sends commander to "my base".
LOL, payback time!! :-)

Posted: 13 Feb 2006, 17:32
by AF
mwha, XE 2 spawns a new thread when it tries to create then display the threatmatrix, onyl the game still pauses when system("threat.tga"); is called

Posted: 13 Feb 2006, 21:32
by Veylon
@ mynthon

I don't know for sure why this would happen, but I suspect that OTAI wants your metal patch.

Posted: 23 Feb 2006, 19:58
by Veylon
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.

Posted: 23 Feb 2006, 20:17
by AF
Any download links?

And are these primitive buildlists in the same form as NTAI XE as in list of commar seperated unit names? If so do NTAI buildtrees work in OTAI?

Posted: 23 Feb 2006, 20:26
by FizWizz
It's on FileUniverse, of course: http://www.fileuniverse.com/?p=listing&ID=104

Posted: 25 Feb 2006, 00:07
by QMan
One quick question which I didn't see here or in the readme. What is the difference between the regular and LL version?

-QMan

Posted: 27 Feb 2006, 18:46
by Veylon
The LL version puts out the log files. The regular one does not. Otherwise, they are both the same.

It does say so in the readme file at the very top, but maybe I should make it more obvious.

Posted: 01 Mar 2006, 05:04
by QMan
Doh, I figured everything above --Features-- was credits and contact info. :)

Also, any word on an OTAI for Spring 0.7?

Posted: 03 Mar 2006, 20:53
by Veylon
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.

Posted: 03 Mar 2006, 21:08
by AF
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

Posted: 03 Mar 2006, 21:19
by Veylon
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.