AI option values?

AI option values?

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
allanmc
Posts: 13
Joined: 07 Sep 2009, 14:29

AI option values?

Post by allanmc »

I am developing an AI for Spring, and would now like to allow it to read some settings from a configuration files. I would believe that AIOptions.lua is meant to be used for this?

I am using the new C++ interface, and can very well read from the AIInfo.lua file using the following command:

Code: Select all

Info::GetInstance(ai->callback)->...;
My best guess for reading from AIOptions.lua, which is what i would like to do, is using the following command:

Code: Select all

OptionValues::GetInstance(ai->callback)->...;
But this doesn't seem to know anything about the options i have entered in AIOptions.lua - GetSize() returns 0.

So my question is: Is the AI supposed to be allowed to access AIOptions.lua, and if, how should this be done using the new C++ interface?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: AI option values?

Post by hoijui »

no, the AI should not ever have to access this file.
AIOptions.lua is meant to declare the options the AI supports to the outside world. eg, The lobby would read this file, and then show some graphical menues nad boxes and stuff, so you can set the options through a GUI. On game start, the lobby would then write the values selected by the user into the start script (script.txt). The values in there are what you can read out through the callback. As the lobbies do not yet support AI options, you have to write them manually into your test start script, as you can see it in the spring source under:
Documentation/SpringStartScript.txt
Post Reply

Return to “AI”