.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   hpb template 4 metamod & cleaned (http://forums.bots-united.com/showthread.php?t=3266)

dub 24-12-2004 06:49

hpb template 4 metamod & cleaned
 
download hpb template 4 converted to metamod & cleaned from http://dubb-coding.8bit.co.uk/botman_template_4_mm.7z :D .
"you might need to download 7-zip from http://www.7-zip.org to decompress the archive".

Pierre-Marie Baty 24-12-2004 09:35

Re: hpb template 4 metamod & cleaned
 
What do you mean by "cleaned" ? Were there bugs ?

Rifleman 24-12-2004 09:44

Re: hpb template 4 metamod & cleaned
 
wow , great job dude !

By the way , there are severe bug , you should reset the msec stuff every round ( I advised you to do so )

And this is an old bug of HPB_template

in bot_navigate.cpp the function BotChangePitch

pEdict->v.v_angle.x = current;

We have to add this line below the above line else the pitch angle we set wont have any use

pEdict->v.angles.x = pEdict->v.v_angle.x / 3;

dub 24-12-2004 11:34

Re: hpb template 4 metamod & cleaned
 
just take a look no extern vars every where now all defined in bot.h it`s so much more readable enjoy ;).

dub 24-12-2004 12:11

Re: hpb template 4 metamod & cleaned
 
added a couple of fixes thanks to rifleman & cleaned a little bit more.

dub 24-12-2004 12:14

Re: hpb template 4 metamod & cleaned
 
Quote:

Originally Posted by Rifleman
wow , great job dude !

By the way , there are severe bug , you should reset the msec stuff every round ( I advised you to do so )

done reset the msec at worldspawn when the gpGlobals->time starts from 0.0.

Pierre-Marie Baty 24-12-2004 21:07

Re: hpb template 4 metamod & cleaned
 
hmm, you'd better call this your own template, and not the "HPB template" anymore. This because botman did not want his bot to support Counter-Strike, and the msec problem you're talking about affects Counter-Strike (and thus round-based games) only.
Quote:

Originally Posted by Rifleman
And this is an old bug of HPB_template

in bot_navigate.cpp the function BotChangePitch

pEdict->v.v_angle.x = current;

We have to add this line below the above line else the pitch angle we set wont have any use

pEdict->v.angles.x = pEdict->v.v_angle.x / 3;

No, this is not needed because the bot's body angles are set already at the end of each BotThink, before the RunPlayerMove call. Doing it again here is redundant.

It's nice that you care about CS players, though, but I think you should fork from the official HPB template and call this another name instead.

Whistler 25-12-2004 07:19

Re: hpb template 4 metamod & cleaned
 
actually there's no need to reset the msec value every round at all, but if you defined the msec as global variable instead of the way the original HPB bot did you need to reset them to zero every map start.

Rifleman 25-12-2004 08:16

Re: hpb template 4 metamod & cleaned
 
Quote:

Originally Posted by Pierre-Marie Baty
No, this is not needed because the bot's body angles are set already at the end of each BotThink, before the RunPlayerMove call. Doing it again here is redundant.

Code:

  // make the body face the same way the bot is looking
  pEdict->v.angles.y = pEdict->v.v_angle.y;
 
  // save the previous speed (for checking if stuck)
  pBot->prev_speed = pBot->f_move_speed;
 
  BotFixIdealPitch (pEdict);
  BotFixIdealYaw (pEdict);
  BotFixBodyAngles (pEdict);
  BotFixViewAngles (pEdict);
 
  g_engfuncs.pfnRunPlayerMove (pEdict, pEdict->v.v_angle, pBot->f_move_speed,
                                                                0, 0, pEdict->v.button, 0, g_fMsecVal);
  return;
}

Pardon ?

Pierre-Marie Baty 25-12-2004 18:33

Re: hpb template 4 metamod & cleaned
 
well yes, you are right, it's my fault. I said this because it was really planned to put it there when botman allowed me to update his template but looks like I forgot to do it. And Whistler is right about the msecval too. The global msecval needs to be reset each time a new map starts. But since this is done in StartFrame already, there's no need to do it again in DispatchSpawn.

Rifleman 26-12-2004 01:24

Re: hpb template 4 metamod & cleaned
 
forget about it ... PMB , but maybe you mean the HPB_bot not the template :)

Rifleman 26-12-2004 01:50

Re: hpb template 4 metamod & cleaned
 
Yes man , I found another bug , you didn't intercept the hltv message at all in engine.cpp...

dub 26-12-2004 09:21

Re: hpb template 4 metamod & cleaned
 
uploaded the botman template 4 metamod final (fixed not hooking hltv bug)
http://dubb-coding.8bit.co.uk, added hlai_mm template v1.0 (much more easier to add mod support) & bot10 updated for HL SDK v2.3
Dubb :D.

Rifleman 26-12-2004 12:49

Re: hpb template 4 metamod & cleaned
 
the link does not work

Pierre-Marie Baty 26-12-2004 15:03

Re: hpb template 4 metamod & cleaned
 
botman doesn't need to intercept the HLTV network message because the HPB_bot is not meant for Counter-Strike, and this network message is Counter-Strike specific only.

dub 26-12-2004 18:42

Re: hpb template 4 metamod & cleaned
 
log onto http://dubb-coding.8bit.co.uk for downloads.
intalling hl2 right now went out and bought it today hopefully by the end of the week i will be able to get a bot template working, need to download the huge sdk first:'(.

Quote:

botman doesn't need to intercept the HLTV network message because the HPB_bot is not meant for Counter-Strike, and this network message is Counter-Strike specific only.
pm hooked for other bot coder`s the might want to do a CS bot.

dub 26-12-2004 20:13

Re: hpb template 4 metamod & cleaned
 
log onto http://dubb-coding.8bit.co.uk for downloads.
intalling hl2 right now went out and bought it today hopefully by the end of the week i will be able to get a bot template working, need to download the huge sdk first:'(.

PMB hooked for other bot coder`s that might want to do a CS bot.

The Storm 27-12-2004 00:02

Re: hpb template 4 metamod & cleaned
 
Quote:

Originally Posted by Pierre-Marie Baty
botman doesn't need to intercept the HLTV network message because the HPB_bot is not meant for Counter-Strike, and this network message is Counter-Strike specific only.

He can make a check function if we are running the bots on CS then to unclude HLTV.
Simple :)

dub 27-12-2004 00:18

Re: hpb template 4 metamod & cleaned
 
the template only hooks hltv message if mod id is cs, just been playing cs:source the new hl engine is amazing love the havoc physics engine.

Rifleman 27-12-2004 01:40

Re: hpb template 4 metamod & cleaned
 
I think you didn't intercept it correctly , I try logging sth when the hltv msg is sent , but nothing response , maybe its not your fault

dub 27-12-2004 02:15

Re: hpb template 4 metamod & cleaned
 
my bad typo error "HTLV" to "HLTV" all is fixed now.

Rifleman 27-12-2004 02:38

Re: hpb template 4 metamod & cleaned
 
Why always double-post ??!! Ignore this

Rifleman 27-12-2004 02:39

Re: hpb template 4 metamod & cleaned
 
no it isn't , your pfnStart.. should look like this , for CS

Code:

  if (ed)
          {
        index = UTIL_GetBotIndex (ed);
 
  // is this message for a bot?
  if (index != -1)
  {
        botMsgFunction = NULL;        // no msg function until known otherwise
        botMsgEndFunction = NULL;  // no msg end function until known otherwise
        botMsgIndex = index;          // index of bot receiving message
       
        if (msg_type == GET_USER_MSG_ID (PLID, "VGUIMenu", NULL))
        botMsgFunction = BotClient_CS_VGUI;
        else if (msg_type == GET_USER_MSG_ID (PLID, "ShowMenu", NULL))
        botMsgFunction = BotClient_CS_ShowMenu;
        else if (msg_type == GET_USER_MSG_ID (PLID, "CurWeapon", NULL))
        botMsgFunction = BotClient_CS_CurrentWeapon;
        else if (msg_type == GET_USER_MSG_ID (PLID, "AmmoX", NULL))
        botMsgFunction = BotClient_CS_AmmoX;
        else if (msg_type == GET_USER_MSG_ID (PLID, "AmmoPickup", NULL))
        botMsgFunction = BotClient_CS_AmmoPickup;
        else if (msg_type == GET_USER_MSG_ID (PLID, "Damage", NULL))
        botMsgFunction = BotClient_CS_Damage;
        else if (msg_type == GET_USER_MSG_ID (PLID, "Money", NULL))
        botMsgFunction = BotClient_CS_Money;
        else if (msg_type == GET_USER_MSG_ID (PLID, "ScreenFade", NULL))
        botMsgFunction = BotClient_CS_ScreenFade;
                        }
          }
  else if (msg_dest == MSG_ALL)
          {
                botMsgFunction = NULL;  // no msg function until known otherwise
                botMsgIndex = -1;          // index of bot receiving message (none)
 
                if (msg_type == GET_USER_MSG_ID (PLID, "DeathMsg", NULL))
                        botMsgFunction = BotClient_CS_DeathMsg;
          }
  else
  {
  // Steam makes the WeaponList message be sent differently
                botMsgFunction = NULL;  // no msg function until known otherwise
                botMsgIndex = -1;          // index of bot receiving message (none)
  if (msg_type == GET_USER_MSG_ID (PLID, "WeaponList", NULL))
          botMsgFunction = BotClient_CS_WeaponList;
                else if (msg_type == GET_USER_MSG_ID (PLID, "HLTV", NULL))
  botMsgFunction = BotClient_CS_HLTV;
  }

And theres some problem with the template hltv intercepting function (bot_client.cpp) , look for fixed one in the HPB_bot forum

And yes , another big bug in your template , all command like "waypoint" , "pathwaypoint", "observer" etc etc are unusable , only those you register with metamod is usable

dub 28-12-2004 14:19

Re: hpb template 4 metamod & cleaned
 
uploaded a fixed version, hltv message bug fixed & added a simple cmd parser
the only major problem is steam keeps exiting cs when i start up a lan server similar to what happens with an invalid game dll in liblist.gam maybe it`s a buffer overrun in metamod because the dir is very deep for steam.


All times are GMT +2. The time now is 09:22.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.