Problem creating skirmish AI

Problem creating skirmish AI

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
johanhagelback
Posts: 13
Joined: 17 Sep 2009, 10:49

Problem creating skirmish AI

Post by johanhagelback »

Hi,

After some struggles I managed to create an empty skirmish AI based on NullLegacyCppAI and solved all compile and link errors. The files included are:
TestGlobalAI.h and .cpp
AIExport.h and .cpp
All LegacyWrapper .h and .cpp files.

This compiles and links without errors in Visual C++ 2008. The problem comes when running the AI in a skirmish game. Just when the game starts it crashes and the following line is found in the logfile:

Code: Select all

09/17/09 10:42:24 / ERROR(1): Failed loading AI Library from file "C:\Program Files\Spring 1944\AI\Skirmish\BTH\data\SkirmishAI.dll": no "handleEvent" function exported
The EXPORT functions are present in AIExport.h and .cpp, so any idea why this isnt working?

Regards,
Johan Hagelbäck
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Problem creating skirmish AI

Post by hoijui »

i guess the problem lies in the changes you made to get rid of the compile errors.
Basically, it would be best if you find someone else that uses visual studio to develop his AI. The only one i caa think of right now is AF.
An other option is to compile with MinGW, and use Visual Stuido only as sort of an Editor.
johanhagelback
Posts: 13
Joined: 17 Sep 2009, 10:49

Re: Problem creating skirmish AI

Post by johanhagelback »

One of the issues I have with mingw compilation is that it requires a lot of steps and installation of programs for it to work.

My plan is to use Spring as a research and education tool for master level students in game AI. It would therefore be very handy to just have to supply a Visual Studio project, a coding environment everyone is familiar with.

I would therefore be happy if anyone else have experience with the errors mentioned above and have an idea about how to solve it.

Regards,
Johan Hagelbäck
johanhagelback
Posts: 13
Joined: 17 Sep 2009, 10:49

Re: Problem creating skirmish AI

Post by johanhagelback »

I get the following errors in infolog:

Code: Select all

[      0] 0x1a300000	SkirmishAI
[      0] 0x734a0000	dbghelp
[      0] Stacktrace:
[      0] (0) Unknown [0x00000000]
[      0] (1) C:\Program Files\Spring 1944\spring.exe [0x00926279]
[      0] (2) C:\Program Files\Spring 1944\spring.exe(skirmishAiCallback_Unit_CurrentCommand_0ARRAY1VALS0getParams+0x106aa) [0x009499DA]
[      0] (3) C:\Program Files\Spring 1944\spring.exe(aiInterfaceCallback_DataDirs_getWriteableDir+0x2d29) [0x0095E4D9]
[      0] (4) C:\Program Files\Spring 1944\spring.exe(skirmishAiCallback_Unit_CurrentCommand_0ARRAY1VALS0getParams+0x11534) [0x0094A864]
[      0] (5) C:\Program Files\Spring 1944\spring.exe [0x004A3983]
[      0] (6) C:\Program Files\Spring 1944\spring.exe [0x004040E7]
[      0] (7) C:\Program Files\Spring 1944\spring.exe [0x0041FA09]
[      0] (8) C:\Program Files\Spring 1944\spring.exe [0x00421E32]
[      0] (9) C:\Program Files\Spring 1944\spring.exe [0x008BA365]
[      0] (10) C:\Program Files\Spring 1944\spring.exe [0x008C3A94]
[      0] (11) C:\Program Files\Spring 1944\spring.exe [0x008B914C]
[      0] (12) C:\Program Files\Spring 1944\spring.exe [0x008B9336]
[      0] (13) C:\Program Files\Spring 1944\spring.exe(aiInterfaceCallback_DataDirs_getWriteableDir+0x4008) [0x0095F7B8]
[      0] (14) C:\Program Files\Spring 1944\spring.exe [0x0040124B]
[      0] (15) C:\Program Files\Spring 1944\spring.exe [0x004012B8]
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Problem creating skirmish AI

Post by hoijui »

maybe consider using the Java Interface, as it is considerably easier to use -> you can just install spring from an installer on the download page, and you can generate a simple dev environment for your students with the ant file of the Java AI Interface, and hand it out.
This way the students with linux will have no problem (from my experience, half of IT students use windows and the other half linux). Also.. a master IT student that can not setup MinGW with the instructions we have on the wiki ...
and it is yet easier on linux, if the OS has a comfortable package management like Ubuntu or Gentoo.
For windows, it is only downloading and extracting a few packages, whihc you could prepare on your machine, as there is no installer you have to run or something, and thne setting two environment variables.
It is some work for you, and really little and basic work for the students, and in the end you will save a lot of time, cause things are really not well tested with VisualStudio, but everyone uses GCC and MinGW.

sidenote: you should always post the full content of infolog.
best is attaching it as a file to your post, or using pastebin.com.
translated stack trace:
http://buildbot.eat-peet.net/spring/sta ... 65311.html

in case the buildbot guessed your version correctly, it means you use outdated sources. You should use either latest master git source or.. in your case probably better: latet release sources, which would be 0.80.4.1

I am not sure about what there problem is there, but you could try disabling shadows in the settings. If it is not that, make sure your CPU supports SSE1, and update your graphic drivers.
If you post the whole infolog, we can probably tell you if your graphic card is likely to be the problem, as it should be listed in there.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Problem creating skirmish AI

Post by AF »

Are you using the old interface + the legacy wrapper? Or the raw C API?

Try to build the existing AIs in Visual studio. NTai should build, although hoijui may have made changes to the API since I last updated spring, but it should teach you more and give you a better idea of where to start.
johanhagelback
Posts: 13
Joined: 17 Sep 2009, 10:49

Re: Problem creating skirmish AI

Post by johanhagelback »

I used a copy of NullLegacyCPP and modified it with another name. I'll try the NTAI when I get back to the office next week.

The main issue is not that I dislike mingw, but rather that the technicians handling the student lab computers arent very happy about us teachers telling them to install additional programs. VC++ and Java is standard so unless NTAI works smoothly I'll take a look at the Java interface.
Post Reply

Return to “Engine”