|
General Bot Coding See what a pain it is to get those little mechs shooting around
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
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.
|
|
|
|
|
Council Member
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
|
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.
|
|
|
|
|
Summoner
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
|
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/
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
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 ?
|
|
|
|
|
Summoner
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
|
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..
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
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.
|
|
|
|
|
Summoner
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
|
Re: How to integrate bot in to the game dll ? -
08-07-2005
Just read the source code
PHP Code:
{{1.0, 1.4}, {1.4, 2.0}, {1.8, 2.6}, {2.0, 3.0}, {2.5, 3.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..
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
Re: How to integrate bot in to the game dll ? -
08-07-2005
Thanks Whistler if I have more questions I will ask again.
|
|
|
|
|
Council Member / E[POD]bot developer
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
|
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.
|
|
|
|
|
Summoner
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
|
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.
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Powered by vBulletin® Version 3.8.2 Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
|
|