.:: 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 ::. > Cyborg Factory > HPB_bot
HPB_bot The trusty good ole mechs by botman HLDMTFCOpposing ForceDMCFront Line Force

Reply
 
Thread Tools
HPB_bot template #4 released!
Old
  (#1)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default HPB_bot template #4 released! - 25-03-2004

Hi !

As suggested by botman, *somebody* (= not him) found the time to finally update the old HPB template to make it support Steam.
The template bot has now the latest entities list for all the MODs it supports, the latest engine interface hooks from Valve (automatically shortening the function table if it doesn't detect Steam), the SV_GetBlendingInterface hitbox fix, obsolete parts of the code removed, and all the known CS issues fixed.

The template supports
-Half-Life deathmatch STEAM/non-Steam
-Team Fortress Classic STEAM/non-Steam
-Opposing Force STEAM/non-Steam
-Front Line Force (non-Steam)
-Counter-Strike STEAM/non-Steam (but the bots don't buy weapons, it's still up to you to program it)

A good news for programmers who want to create their own bot, so be sure to check it out !

http://hpb-bot.bots-united.com



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#2)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: HPB_bot template #4 released! - 25-03-2004

Does the template already support metamod or is this up to the programmers to do?
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: HPB_bot template #4 released! - 25-03-2004

No, the template is a standalone hook DLL, like the original HPB_bot was. I believe it's better, more pedagogic this way



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#4)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: HPB_bot template #4 released! - 25-03-2004

I HATE pedagogic . (irony)
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#5)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: HPB_bot template #4 released! - 25-03-2004

Thanks for taking the time to do this PM.

botman
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#6)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: HPB_bot template #4 released! - 25-03-2004

Nice
Just 1 question;
Code:
   // test if we're running Steam or not and shorten the engine functions table if we aren't
   if ((access("valve/steam.inf", 0) != -1) || (access("FileSystem_Steam.dll", 0) != -1))
	   memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); // steam
   else
      memcpy(&g_engfuncs, pengfuncsFromEngine, 144 * sizeof(uint32)); // non-steam
Why is this ??
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: HPB_bot template #4 released! - 26-03-2004

This is needed to make the bot compatible with both Steam and non-Steam HL engines. There have been non-official changes to the HL SDK for the Steam engine, notably the adding of a bunch of new functions in the enginefuncs interface to support the Condition Zero carreer mode. The interface has thus grown from 144 function pointers (unsigned int), to 160 or 170, which makes more bytes to copy from one place to another in memory. But since older engines expect only 144 *4 bytes to be copied, if you memcpy() more and send them the WHOLE function table (including the new engine functions from Steam), chances are that the destination space will overflow and you will overwrite into forbidden memory, leading to a crash.

That's why, if we detect Steam, we send the engine the whole function list, and if we don't, we only send the engine the 144 first functions (that used to make the previous interface).

I should tell Will Day about this



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#8)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: HPB_bot template #4 released! - 26-03-2004

Uhm...but if you're not running steam the table shouldn't be bigger then 144 * 4 bytes right? So whats the use of this then ??? You never copy to much then heh.
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#9)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: HPB_bot template #4 released! - 26-03-2004

The problem is that you can't tell how big the ENGINE thinks the table is.

In the Bot source code (actually in the bot's version of the engine header files), you have the enginefuncs_t structure. You can only have ONE of these structures with this name in your bot source code. When you compile the bot, the table will either be 144*4 bytes (if you are using the non-Steam engine header files) or it will be larger (if you are using the Steam engine header files).

When it comes time to copy the table, if you used the Steam engine header files to build your bot and you are actually running on the non-Steam engine, you will copy TOO MUCH data and wind up clobbering something else in memory. So you have to change how much stuff gets copied at run-time once you know which version of the engine you are running.

Alternately, you can build 2 different bot DLL files, one that is for non-Steam only Half-Life (with the smaller enginefuncs_t structure) and one that is Steam only (built with the larger enginefuncs_t structure). This will confuse users since many of them won't even know if they are running Steam or not, all they know is they bought the game at the store, installed it, and started playing and now they want some bots to play with.

botman
  
Reply With Quote
Re: HPB_bot template #4 released!
Old
  (#10)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: HPB_bot template #4 released! - 26-03-2004

ah now I get it I didn't noticed (and didn't thought of)the new functions in enginefuncs_t. My 'version' stopped after 'pfnGetPlayerAuthId'. But the one in the new hpb_bot has some more...Well I'm not sure if I have to update all this stuff but I guess it won't hurt todo so.
Thanx for your replies

Oh and btw how did you find out those new steam stuff? I thought there wasn't a new SDK

Last edited by Rick; 26-03-2004 at 15:45..
  
Reply With Quote
Reply


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

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