| Q3 Bot Realising togather a Q3 bot |
| |
|
• Q3 Bot
We are several here to want tot realize a QIII bot in wich we can plug our AI methods. I propose in this thread to study 2 things :
- How to interface AI code (in a lib) with Q3 engine
- What are the functions Q3 provides and what do they do
All remarks are welcome
|
11 posts.
Thursday 23 May, 07:20
Reply
|
|
|
• Navigation functions
The source code of Q3 seems to contain a lot of navigation functions, which seem to be of high level like. They can be found in be_ai_move.h file. Their code is in fact not present in the distribution. These functions seems to command the pathfinder :
- Move to a goal with BotMoveToGoal
- Move in a direction with BotMoveInDirection
- Avoid a place with BotAddAvoidSpot
- General movestate functions
It should be really interesting to test these functions in a bot !
Some higher level functions can be found in ai_demq3.c. These functions use the precedent ones to manage the bot behavior (choose weapon, attack, navigate). They can be modified for minor changes...
|
11 posts.
Thursday 23 May, 07:33
Reply
|
|
• Bot movestate
In my opinion, you have to do this first :
-Alloc a move state with BotAllocMoveState
-Initialize this movestate with BotInitMoveState
Then you can use other functions. For example BotAddAvoidSpot add an area to avoid during the compiutation of your path (this is done for you by the main engine of Q3). You have to specify :
-the movestate you want to modify (cf the one you create)
-the center coordinates of the area you want to avoid
-the radius of this area
-the type of action you want to use on this area :
// avoid spot types
#define AVOID_CLEAR 0 //clear all avoid spots
#define AVOID_ALWAYS 1 //avoid always
#define AVOID_DONTBLOCK 2 //never totally block
If you have any information...
|
11 posts.
Tuesday 04 June, 04:30
Reply
|
|
|
• Interface code with Q3 for a new bot
I am not sure and have not tested this yet. But after studying the source code, I think it is possible to create a new bot. To do this we need to create a neww entity class and modify some settings to tell the game it is a bot.
I would like to know what these settings are, and if this solution seems correct. Someone has any idea ?
|
11 posts.
Thursday 23 May, 07:36
Reply
|
|
|
• Compile with a lib
I have tried to compile the game code with a lib of my own. The compiler used by Q3 has some major limitations :
- no class
- no default value (void function(int nb = 0) for example)
- no ref argument (void function(int &nb) for example)
So I expurged my include file from these errors, and the core game dll seems to compile including my lib (already compiled) which contains C++ code interfaced with simple C functions. I need a basic bot framework to test if it really works, but I do not know exactly how to do this...
Any remarks, ideas ?
|
11 posts.
Thursday 23 May, 07:45
Reply
|
|
|
• Framework
Why the 4 messages?? hehe ;)
It seems to me you need (and are having trouble getting) a basic bot in the game that does nothing, apart from existing.
I believe the existing bot framework does this. I've only taken a quick look, but it's definitely possible! You should take a look at how the existing bots are inserted.
Once you've done this, you could extend it by applying a simple think procedure to it, which has already been done somewhere in the code.
You can also remove the navigation as you see fit, or use the existing AAS code.
I'm going to be looking into Q3 in the near future, I'll let you know when I have something working!
|
1019 posts.
Sunday 26 May, 15:38
Reply
|
|
• Getting started writing / modifying a bot
I will also start to write a bot at some point (for more info see: http://ai-depot.com/Games/965.html), so please let me know when you crack the problem, and actually start to insert your own bot.
It would be nice, to have your own bot playing against the standard bot, so it would be nice, if this could be done without messing up the existing bots.
Btw. my email is lukesky@diku.dk, feel free to write me.
|
14 posts.
Friday 05 September, 09:46
Reply
|
|
• having custom bots play q3 default bots
I don't think you have to worry about leaving the quake 3 bot code intact if you want your bots to play against them as long as your bot can connect as a client to the game. You can set up a server with the standard bots on it and have your bot connect as a client. If you only have 1 computer, it should still work if you make a dedicated server and then start the game in a new window.
|
15 posts.
Sunday 07 September, 22:32
Reply
|
|
• Using the ASS code
It would be a great thing, to make a bot, that is completely disconnected from the game code.
But then you would miss all the advantages, that you have in the quake3 source. Here I am mostly talking about the Area Awareness System (AAS), that is used for navigating the maps. It would be really nice if you didn't have to write everything from scratch.
|
14 posts.
Monday 08 September, 03:31
Reply
|
|
• Q3 Bot finished
Thanks for your help, but my bot is finished now... It is not an aggressive one, but it can create a map of the level it is in.
So if any of you have questions do not hesitate...
For now, I create my bots using the addbot command and sending a special name (SpirOps). I have modified the command code, so when it matches SpirOps it creates my kind of bot, with a special script file (could be passed as a third parameter to the command).
Again thanks, and if you have any question, post them here !
|
11 posts.
Monday 08 September, 11:53
Reply
|
|
• Source code
Sounds interesting...
This is exactly the thing I need. To be able to add your own bots together with the standard quake3 bots.
Is the source code available for your bot? It would be a good starting point for a bot.
You can email the source to me at lukesky@diku.dk
|
14 posts.
Monday 08 September, 17:44
Reply
|
|
• Source code
I can put the code in public on this site if Alex agrees.
The main problem is that the code is not well commented, but I have made only a few changes in main files, gathering all my stuff in different .c and .h files.
What do you think about writing some kind of article on how I have plugged SpirOps AI module in Quake III bot ?
Alex, are you interested ? Where can I put the whole stuff on your site ?
|
11 posts.
Tuesday 09 September, 03:44
Reply
|
|
• Source code
Please post here, if the source code goes public.
Regards,
Steffen
|
14 posts.
Tuesday 09 September, 07:41
Reply
|
|
• Source Code
Yes please if you do get it up, it would be great to build off of a bot. Please try do get your source code up or send the file to me via email: adagram@hotmail.com
Thanks Alot!
Adam
|
8 posts.
Friday 28 January, 21:47
Reply
|
|
|
• code source to plug your AI in Q3
Here is a kind of tutorial, sorry but there seems to be no way to attach a file, so here it is:
Tutorial: how to plug your own AI in Quake III (Axel Buendia)
1]Files and versions
IA is in the game part of the q3 project. Specifically in files:
g_bot.c
ai_main.c
For this tutorial, I am working on the 1.29 sources, with the 1.32 verison of the game.
2]Add your bot
1) Edit g_bot.c
Function: G_AddBot
at the end of the function, call your initialization code
you have to call it once again after (just before the end of the function):
static void G_AddBot( const char *name, float skill, const char *team, int delay, char *altname) {
................
if( delay == 0 ) {
// Add your intialization code here
ClientBegin( clientNum );
return;
}
AddBotToSpawnQueue( clientNum, delay );
// Add your intialization code here again
}
2) Edit ai_main.c
Function: BotAI
at the end of the function, you have to replace the call to the standard AI by your own function:
int BotAI(int client, float thinktime) {
................
//get the area the bot is in
bs->areanum = BotPointAreaNum(bs->origin);
//the real AI
// Call your ai think function here and replace default
//BotDeathmatchAI(bs, thinktime);
//set the weapon selection every AI frame
trap_EA_SelectWeapon(bs->client, bs->weaponnum);
//subtract the delta angles
for (j = 0; j < 3; j++) {
bs->viewangles[j] = AngleMod(bs->viewangles[j] - SHORT2ANGLE(bs->cur_ps.delta_angles[j]));
}
//everything was ok
return qtrue;
}
3) Edit g_client.c
If you want special initialization during respawn, edit g_client.c
Function: ClientSpawn
at the end of the function, add a call to your own respawn function:
void ClientSpawn(gentity_t *ent) {
................
// clear entity state values
BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue );
// Add your own respawn code here
}
4) Debug
Do not hesitate to edit g_svcmds.c to add your own console commands
To add a console command, 2 steps:
-Add your command in at the end of the ConsoleCommand function:
qboolean ConsoleCommand( void ) {
................
if ( Q_stricmp (cmd, "MyCommand") == 0 ) {
Svcmd_MyCommand_f();
return qtrue;
}
}
-Then create your command function:
void Svcmd_MyCommand_f(void) {
// Add your command code herr
}
5) Manipulate the bot and use q3 data
To manipulate the bot, there are several functions all in those 2 files:
ai_dmq3.c
ai_dmnet.c
Try to inspire from them, and remember all hidden core functions start with trap_, do not hesitate to use them.
That's all, you can now plug any AI in Quake 3...
|
11 posts.
Tuesday 01 February, 04:27
Reply
|
|
• creating a new bot
I'm also trying to build a new bot.
The tutorial is a bit difficult to understand without an example, can you please email me the source code?
westrajoostAThotmail.com
|
1 posts.
Tuesday 20 September, 09:44
Reply
|
|
• creating new AI
Indeed, I'm in the middle of writing a mod for Quake 3 and i wanted to edit to the source code to effect all bots. I wanted to employ some fuzzy-esque state machine. But i've looked at the code and i'm a little lost.
That tutorial is a bit lost on me, if i could basically find out how to make a dumb bot spawn that does nothing and work from there it'd be a help. I even did a pretty diagram for folk that i've bored already :P
Diagram
Is that kinda thing plausible, feasible, attainable?
email me at : dgreenaway@gmail.com if you can help.
thanks guys
|
1 posts.
Thursday 20 October, 12:02
Reply
|
|
|
• I have trouble to use the Q3A source code
I want to make my own bot but when i build the project
and try to run the debuger ,it occur some error
folowing are error massage, can someone tell me what i forget to do ?
Q3 1.27g win-x86 Dec 4 2000
----- FS_Startup -----
Current search path:
E:\Game\quake3\source\game/baseq3
----------------------
0 files in pk3 files
Running in restricted demo mode.
----- FS_Startup -----
Current search path:
E:\Game\quake3\source\game/demota
----------------------
0 files in pk3 files
----- CL_Shutdown -----
-----------------------
Couldn't load default.cfg
and VC++ have following error massage
Loaded 'E:\Game\quake3\quake3.exe', no matching symbolic information found.
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shimeng.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\AppPatch\acxtrnal.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\d3d8.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\d3d8thk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\AppPatch\acgenral.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msacm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\userenv.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\Syncor11.dll'
Loaded 'C:\WINDOWS\system32\vct3216.acm', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msctf.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msctfime.ime', no matching symbolic information found.
The thread 0xDA8 has exited with code 0 (0x0).
The thread 0xCAC has exited with code 0 (0x0).
The program 'E:\Game\quake3\quake3.exe' has exited with code 0 (0x0).
|
2 posts.
Monday 28 November, 00:32
Reply
|
|
| |