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.
NTai for Linux
Moderators: hoijui, Moderators
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:
I have left out errors that seem to be caused by the first error in the file.
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
[...]
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;
}
}The latter errors are in files that shouldnt be compiled. My next commit shall remove them.
There exists an operator[] overload to access them.
Code: Select all
DamageArray damageArray;
float sum = 0.0f;
for (...) {
sum += damageArray[index];
}
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:
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?
from infolog.txt:
and the NTai-logrts/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.
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?
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.
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.
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.
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.
