Re: Interface Redesign
Posted: 07 Aug 2008, 10:39
sorry, still no update. i had some practical C++ problems, but i solved them now. aehm.. i am still on it! working.
Open Source Realtime Strategy Game Engine
https://springrts.com/phpbb/
Code: Select all
aikey=C#0.1_KAIK#0.13
Code: Select all
aikey=RAI
Code: Select all
aikey=Java#0.2_RAI#0.700
Code: Select all
aikey=RAI
aikey=RAI#0.700
aikey=Java_RAI
aikey=Java_RAI#0.700
aikey=Java#0.2_RAI
aikey=Java#0.2_RAI#0.700
Don't. Do. This., it is hackish and error-prone (I might like to usehoijui wrote: the lobbies will have to put something like this into script.txt:but it could also be just:Code: Select all
aikey=C#0.1_KAIK#0.13
in which case th engine will figure out which interface and version to use. in this example, RAI would be expanded by the engine to:Code: Select all
aikey=RAI
all valid keys would be:Code: Select all
aikey=Java#0.2_RAI#0.700
Code: Select all
aikey=RAI aikey=RAI#0.700 aikey=Java_RAI aikey=Java_RAI#0.700 aikey=Java#0.2_RAI aikey=Java#0.2_RAI#0.700
That makes the Lua files redundant. The idea was to have all theboth. interfaces and AIs export static properties (map<string, string>), eg shortName, version, description, infoURL, ...
in addition to that, they export a set of possible options (comparable to modOptions).
these two things can be querried from an Interface or AI lib.
Define "usually", this just causes more confusion than it prevents. Ex.:as pointed out earlyer in this topic, we should not always load and querry all libraries, when we want that info, cause then each library had the possiblity to crash the whole application. thats why we wanted to use the LUA files, to store this info. the idea is, to primarly get properties and options from LUA files, but beeing able to actualize or generate the LUa files by requesting that info directly from the libs. so usually, we will rely on the LUA files.
You have already introduced a "<spring_root>/AI/Skirmish/data/" dirthis way, as an AI dev:
* i do not have to write anything in LUA -> the AI interface are cleaner (a single language, which one ever)
* i can, but do not have to ship any LUA info files with my AI
* we could have a command line argument to actualize all AI info, eg: spring.exe --actualize-all-ai-info
this would try to load all AI Interface libs and AIs and generate the LUA info files for them. if something goes wrong with one of them, we could output an error for that AI or interface, and go on with the others.
* we coul have an other option: spring.exe --generate-missing-ai-info, which would only generate the missing info
If the AI dev is lazy in that sense, allow the engine to be as well.i can, but do not have to ship any LUA info files with my AI
Code: Select all
ai=name;
Code: Select all
aikey=Java#0.2_RAI#0.700
Code: Select all
generating missing AI info files
================================
generating info for AAI ...
../AAIinfo.lua successfully generated
generating info for RAI ...
../AAIinfo.lua successfully generated
generating info for hoijui ...
SEGFAULT
Code: Select all
C#0.1_RAI#0.600
Java#0.2_RAI#0.600
Code: Select all
aikey=RAI
aikey=RAI#0.600
Code: Select all
aikey=RAI
aikey=RAI#0.600
Code: Select all
aishortname=RAI
aiversion=0.600 # optional
Code: Select all
char[][2]
Code: Select all
char** keys, char** values, int keycount