.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
How to integrate bot in to the game dll ?
Old
  (#1)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default How to integrate bot in to the game dll ? - 05-07-2005

Ok I now have a new little project. I start to make a bot for http://www.sandsofwar.net/
I get the source code of Sands of War and I think it will be better to integrate the bot in to the sow.dll file. I started from HPB bot teamplate 4 (the hook dll version). I now want to know what stuff of the bot I don't need to compile it with the sow.dll file.

P.S I will work on both SoW bot and E[POD]bot so don't worry EPB fans.
Now just waiting for MarD to test the new version 5 of EPB.
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#2)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: How to integrate bot in to the game dll ? - 05-07-2005

Hah following my good advice about integrated bots eh? Get "Bot 10" made by botman(http://hpb-bot.bots-united.com/releases/bot10src.zip) and see what he needed to do to make it work.
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#3)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to integrate bot in to the game dll ? - 05-07-2005

also check the TheFatal's HL bot framework, which is simpler but contains everything you need to get the bot work:
http://www.telefragged.com/thefatal/
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to integrate bot in to the game dll ? - 07-07-2005

Ok I download bot10 by botman but now I need by some tutorial. So I get the first bot spectating in game. Now first I need by some help to get the bot to navigate weapons. So I find in bot.cpp this lines :
Code:
// weapon firing delay based on skill (min and max delay for each weapon)
float primary_fire_delay[WEAPON_TEARGASGRENADE+1][5][2] = {
   // WEAPON_NONE - NOT USED
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_CROWBAR
   {{0.0, 0.1}, {0.2, 0.3}, {0.3, 0.5}, {0.4, 0.6}, {0.6, 1.0}},
   // WEAPON_GLOCK (9mm)
   {{0.0, 0.1}, {0.1, 0.2}, {0.2, 0.3}, {0.3, 0.4}, {0.4, 0.5}},
   // WEAPON_PYTHON (357)
   {{0.0, 0.25}, {0.2, 0.5}, {0.4, 0.8}, {1.0, 1.3}, {1.5, 2.0}},
   // WEAPON_MP5 (9mmAR)
   {{0.0, 0.1}, {0.1, 0.3}, {0.3, 0.5}, {0.4, 0.6}, {0.5, 0.8}},
   // WEAPON_CHAINGUN - NOT USED
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_CROSSBOW
   {{0.0, 0.25}, {0.2, 0.4}, {0.5, 0.7}, {0.8, 1.0}, {1.0, 1.3}},
   // WEAPON_SHOTGUN
   {{0.0, 0.25}, {0.2, 0.5}, {0.4, 0.8}, {0.6, 1.2}, {0.8, 2.0}},
   // WEAPON_RPG
   {{1.0, 3.0}, {2.0, 4.0}, {3.0, 5.0}, {4.0, 6.0}, {5.0, 7.0}},
   // WEAPON_GAUSS
   {{0.0, 0.1}, {0.2, 0.3}, {0.3, 0.5}, {0.5, 0.8}, {1.0, 1.2}},
   // WEAPON_EGON
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_HORNETGUN
   {{0.0, 0.1}, {0.25, 0.4}, {0.4, 0.7}, {0.6, 1.0}, {1.0, 1.5}},
   // WEAPON_HANDGRENADE
   {{1.0, 1.4}, {1.4, 2.0}, {1.8, 2.6}, {2.0, 3.0}, {2.5, 3.8}},
   // WEAPON_TRIPMINE
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_SATCHEL
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_SNARK
   {{0.0, 0.1}, {0.1, 0.2}, {0.2, 0.5}, {0.5, 0.7}, {0.6, 1.0}},
   };

float secondary_fire_delay[WEAPON_TEARGASGRENADE+1][5][2] = {
   // WEAPON_NONE - NOT USED
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_CROWBAR - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_GLOCK (9mm)
   {{0.0, 0.1}, {0.0, 0.1}, {0.1, 0.2}, {0.1, 0.2}, {0.2, 0.4}},
   // WEAPON_PYTHON (357)
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_MP5 (9mmAR)
   {{0.0, 0.3}, {0.5, 0.8}, {0.7, 1.0}, {1.0, 1.6}, {1.4, 2.0}},
   // WEAPON_CHAINGUN - NOT USED
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_CROSSBOW
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_SHOTGUN
   {{0.0, 0.25}, {0.2, 0.5}, {0.4, 0.8}, {0.6, 1.2}, {0.8, 2.0}},
   // WEAPON_RPG - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_GAUSS
   {{0.2, 0.5}, {0.3, 0.7}, {0.5, 1.0}, {0.8, 1.5}, {1.0, 2.0}},
   // WEAPON_EGON - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_HORNETGUN
   {{0.0, 0.1}, {0.2, 0.3}, {0.3, 0.5}, {0.5, 0.8}, {0.7, 1.2}},
   // WEAPON_HANDGRENADE - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_TRIPMINE - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_SATCHEL
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}},
   // WEAPON_SNARK - Not applicable
   {{0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0}}
   };
So can someone explain me what each number doing and how I must modifi them ?
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#5)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to integrate bot in to the game dll ? - 08-07-2005

these are delay times of firing weapons in the HL for different level of bots.

the weapon handling in bot number 10 is hardcoded in bot_combat.cpp, just read the source code at there

also if you want to make a good bot, I'd advise _not_ to use botman's bot number 10, just use TheFatal's minimal framework and do most of the work yourself. However if you simply want a work bot (even if it's "stupid"), bot10 is a good way with only a few changes for the mod's game rules.

Last edited by Whistler; 08-07-2005 at 10:55..
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to integrate bot in to the game dll ? - 08-07-2005

Whistler I don't want to make fully new bot. I just want to make a simply functional bot for this mod. I don't have enough time to start from the zero and code all by myself. However I don't see any text that explain each number for what is. Yes I know that this numbers are the fire delay but I need to know each number what do.
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#7)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to integrate bot in to the game dll ? - 08-07-2005

Just read the source code

PHP Code:
  {{1.01.4}, {1.42.0}, {1.82.6}, {2.03.0}, {2.53.8}},
  
best skill          -------------->            worst skill 
and the delay time is RANDOM_FLOAT(1.0, 1.4).

Last edited by Whistler; 08-07-2005 at 13:11..
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#8)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to integrate bot in to the game dll ? - 08-07-2005

Thanks Whistler if I have more questions I will ask again.
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#9)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to integrate bot in to the game dll ? - 09-07-2005

I need by some help. So I have problems with getting the bot to join in game.
Here my code placed in the start of BotThink()
Code:
if (not_started)
	{
		for (int index = 1; index < gpGlobals->maxClients; index++)
		{
			CBasePlayer *pPlayer;

			pPlayer = (CBasePlayer*)UTIL_PlayerByIndex( index );

			if (!pPlayer)  // if invalid then continue with next index...
				continue;

			if (IsAlive())
				continue;

			if ((create_time + 0.5 <= gpGlobals->time) && (pPlayer->pev->flags & FL_FAKECLIENT))
			{
			    pPlayer->m_iTeam = 1;// Join Team 1
				pPlayer->m_iNextTeam = 1;
			    pPlayer->m_iClass = 1;// Select class 1
				pPlayer->m_iNextClass = 1;
				pPlayer->Spawn();// Spawn the bot
				not_started = 0;
				create_time = gpGlobals->time;

			    g_engfuncs.pfnRunPlayerMove( edict( ), pev->v_angle, f_move_speed,
											 0, 0, pev->button, 0,
											 gpGlobals->frametime * 1000 );
				return;
			}
		}
	}
So after all only the first bot join in game. After I type add bot again the others bots stay spectators. If you can tell me where is the my mistake.
not_started is settet to 1 when new bot connect.
Btw I'm using bot10 by botman for integrating the bot in to the sow.dll file.
  
Reply With Quote
Re: How to integrate bot in to the game dll ?
Old
  (#10)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to integrate bot in to the game dll ? - 10-07-2005

well I know nothing about that MOD, but you can read the source code of the MOD to figure out how the MOD deal with joining games.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com