Page 1 of 1
NTai for Linux
Posted: 20 Aug 2007, 01:30
by koshi
Hi.
I have compiled svn source (rev 4214) of NTAI for linux (x86). You can get it here: spring.unknown-files.net/file/3469/NTAI_-_linux_build/
It was compiled against the spring source from the 0.75b2 tag.
I had to change some lines to get it to compile (using g++ from within Netbeans 5.5.1). Here is my attempt at a diff of directory AI/Global/NTai/AI/NTai:
http://www.graasmilk.net/spring/ntai_linux.txt
If that is not useful, the changes were:
- Core/include.h (line 273): #include "../Helpers/CWorkerthread.h" --> #include "../Helpers/CWorkerThread.h"
- Helpers/CWorkerThread.h (line 156): void ThreadPool::stop() --> void stop()
- Helpers/CWorkerThread.h (line 170): void ThreadPool::wait() --> void wait()
- Helpers/Terrain/CBuildingPlacer.cpp (line 471): FeatureDef* fd = G->cb->GetFeatureDef(f
); --> const FeatureDef* fd = G->cb->GetFeatureDef(f);
Changes number 2 and 3 were done just to get it to compile. No idea if they break some functionality.
If it is helpful I could replicate the error messages i had gotten.
I haven't gotten around to actually play against it, but it starts up fine.
Any input is appreciated.
Posted: 20 Aug 2007, 01:47
by AF
fixed
Posted: 20 Aug 2007, 11:44
by Tobi
If I try to compile it on MinGW (by removing NTai from the line in SConstruct that excludes it from compiling) I get a bunch of errors too, maybe you are interested in them:
Code: Select all
rts/Sim/Misc/DamageArray.h: In member function 'bool Global::LoadUnitData()':
rts/Sim/Misc/DamageArray.h:43: error: 'float* DamageArray::damages' is private
AI\Global\NTai\AI\NTai\Core\helper.cpp:1272: error: within this context
rts/Sim/Misc/DamageArray.h:43: error: 'float* DamageArray::damages' is private
AI\Global\NTai\AI\NTai\Core\helper.cpp:1274: error: within this context
AI\Global\NTai\AI\NTai\Agents\Unit.cpp:5: error: 'Task' has not been declared
[...]
AI\Global\NTai\AI\NTai\Agents\CBuilder.cpp:5: error: 'CBuilder' has not been declared
[...]
I have left out errors that seem to be caused by the first error in the file.
Posted: 20 Aug 2007, 12:27
by AF
Code: Select all
if(pud->weapons.empty() == false){
for(vector<UnitDef::UnitDefWeapon>::const_iterator k = pud->weapons.begin();k != pud->weapons.end();++k){
//ef += k->def->
float av=0;
int numTypes;// = cb->getk->def->damages.numTypes;
cb->GetValue(AIVAL_NUMDAMAGETYPES, &numTypes);
for(int a=0;a<numTypes;++a){
if(a == 0){
av = k->def->damages.damages[0];
}else{
av = (av+k->def->damages.damages[a])/2;
}
}
ef += av;
}
}
How am I supposed to calculate average dps then if that field is now private in svn?
The latter errors are in files that shouldnt be compiled. My next commit shall remove them.
Posted: 20 Aug 2007, 12:31
by Tobi
There exists an operator[] overload to access them.
Code: Select all
DamageArray damageArray;
float sum = 0.0f;
for (...) {
sum += damageArray[index];
}
Posted: 20 Aug 2007, 12:32
by AF
If its in svn but not 0.75b2 then your somewhat stuck as upgrading my sources to svn would prevent me releasing anymore versions fo NTai till after the mid september release
edit:: nm I dont need svn for the overloaded operator
Posted: 20 Aug 2007, 12:34
by Tobi
The operator overload exists for a long time already, definitely in 0.75b2.
I just made the member private a while ago.
Posted: 21 Aug 2007, 21:35
by koshi
Finally found the time to play test it both with XTA and NOTA config on Tabula. In neither case NTai builds anything.
from infolog.txt:
rts/System/Platform/Linux/SoLib.cpp:41: SoLib::FindAddress: /usr/share/games/spring/AI/Bot-libs/NTAI.so: undefined symbol: IsCInterface
/usr/share/games/spring/AI/Bot-libs/NTAI.so has C++ interface
AI has enabled cheating.
and the
NTai-log
At first i've put the configs in my springdatadir (read-write, inside home folder). Failing that I copied it to the the read-only dir, yet no change.
The NTai commander/command tower will however attack any of my units that come into range.
Any ideas?
Posted: 21 Aug 2007, 21:43
by AF
well NTai obviously loaded, looked in the right palce for a config, then found nothing.
You dont stick configs in the spring folder or the home folder, you stick them in the /AI/NTai/ folder such that theres /AI/NTai/config.tdf and /AI/NTai/configs/config.tdf Those 2 files are NOT the same file.
Posted: 21 Aug 2007, 23:25
by koshi
NOTA config is working now. Apperently I (or the GUI I used) messed up the archive extraction by overwriting the AI/NTai/NOTA.tdf with the AI/NTai/configs/NOTA.tdf
Still nothing with XTA though. I have confirmed that AI/NTai/XTA_BT2.tdf points to an existing AI/NTai/config/XTA_BT2.tdf, tried XTA v8.1 (with both core and arm) instead of XTA v9, playing on different maps and tried deleting the learning file. Not everything at once of course.
Still there is the error message about the empty tasklist.
Posted: 22 Aug 2007, 01:31
by AF
It says that about the empty task list because its looking inside the Tdfparser storing the config which is of course empty.
If its not working for you on linux despite what I've said I suggest you find someone who does have it working under linux as I dont have linux and I wouldnt know what else to do.