Although we are not ready for this yet, i suggest to start a thread about it. I have read JOE's pdf file lately and it introduces a few interesting things. However, i think it is wise to introduce a standard we all use and some code that is easy to implement.
In the days when Tub was with RB, Tub ran a project MEMM. Multi-Engine Multi-Mod compatible system. He already got bots loaded in CS, but he never worked on it again as far as i know.
Perhaps i can start with a little
concept here, later on a official document and source code can be written about this. I just think it is wise to discuss this subject intensively before writing a single line of code.
Compile/Flag switches?
Will the wrapper be coded using a 'detection system' which looks similiar to mod_id in botmans code and therefor executes the proper code? Or will it be 'compiler switched' so you only compile the code for the dll for the game you want to compile it for? (or a combination of both?)
Layout
Seen in most games, they work all with a
game.dll file. With botmans template we resulted in a
engine <-> bot.dll <-> game.dll situation. Here we should ask ourselves, will this remain possible for other engines? Sure i think Quake 1/2/3 will probably get this to work. But if you want to code a bot for Unreal i think it aint this 'easy'.
Vectors
Although i can't imagine a game using different x,y,z positions (x,z,y, like HL) there should be something you can rely on when coding. Logically there should be a vector definition somewhere in the code that gives enough functionality. Perhaps the current HL vector.h file will do.
Entities
Here the hard part starts. Entities represent everything in the world, from players to world-switches, spawn points to goal/triggers. Question is, what do you need to know about an entity? What is really important? Only that should be in our 'own entity' structure.
Wrapping
I guess this is self-explenatory, but hence: A layout for the whole picture would probably like:
+ layer identifies game (either by compiler or by detection system)
- engine sends message
+ layer recieves message
+ layer identifies message as 'take damage @ entity xyz'
+ layer wraps entity to own entity:
Code:
// HL wrapper?
void cWrapper::TakeDamage(cEntity *pEntity, edict_t *pEdict)
{
pEntity->health = pEdict->v.health;
}
etc.
I bet it will be a helluva work to wrap every single thing of a HL specific entity. When you want to make it work for another engine, you should ask yourself what should be wrapped and how long it will take to do so. Perhaps the above is not a to bright sollution, but it gives the idea.
Essential is that the bot only has access to the 'general defined' variables and not the game specific ones.
Another point of view
Someone once told me he wanted to code a bot which ran as a seperated EXE file and just logs in like a real player does. It gets connected, although on a LAN server this would be a loopback he was confident he could get it to work. I still have contact with him, but he did not tell me how progress went. The idea however is quite ambitous imo. It would be cool if you just could ran the program and let it connect to any internet game and let it battle for you when you are away
Anyway, with this thread i hope to give a start at this subject and to get some things rolling. Before everybody starts to code their own implementations and we all end up inventing the wheel 4 times in a row