.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   HPB_bot (http://forums.bots-united.com/forumdisplay.php?f=35)
-   -   HPB_bot template #4 released! (http://forums.bots-united.com/showthread.php?t=1180)

Pierre-Marie Baty 25-03-2004 05:03

HPB_bot template #4 released!
 
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

Terran 25-03-2004 11:25

Re: HPB_bot template #4 released!
 
Does the template already support metamod or is this up to the programmers to do?

Pierre-Marie Baty 25-03-2004 12:03

Re: HPB_bot template #4 released!
 
No, the template is a standalone hook DLL, like the original HPB_bot was. I believe it's better, more pedagogic this way :)

Terran 25-03-2004 12:08

Re: HPB_bot template #4 released!
 
I HATE pedagogic :P. (irony)

botman 25-03-2004 15:50

Re: HPB_bot template #4 released!
 
Thanks for taking the time to do this PM.

botman

Rick 25-03-2004 22:57

Re: HPB_bot template #4 released!
 
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 ??

Pierre-Marie Baty 26-03-2004 02:35

Re: HPB_bot template #4 released!
 
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 :)

Rick 26-03-2004 14:52

Re: HPB_bot template #4 released!
 
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.

botman 26-03-2004 15:30

Re: HPB_bot template #4 released!
 
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

Rick 26-03-2004 15:42

Re: HPB_bot template #4 released!
 
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 :|


All times are GMT +2. The time now is 12:21.

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