.:: 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 04: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 10: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 11: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 11:08

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

botman 25-03-2004 14:50

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

botman

Rick 25-03-2004 21: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 01: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 13: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 14: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 14: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 :|

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

Re: HPB_bot template #4 released!
 
Will Day at metamod maintains an always up-to-date SDK package, with fixes to compile on Linux with recent compilers and all the undisclosed SDK patches from Valve. You can find it at the "files" section of the metamod website.

cruft 28-03-2004 08:20

Re: HPB_bot template #4 released!
 
I noticed that namefunc.cpp source file is gone, the one that had the LoadSymbols function. Is this no longer needed?

Rick 28-03-2004 16:04

Re: HPB_bot template #4 released!
 
That file was only in the 'full' hpb bot, this one is the template and doesn't have this file like the previous templates.

Pierre-Marie Baty 28-03-2004 17:27

Re: HPB_bot template #4 released!
 
hmm yes, but right now I wonder if it shouldn't have been better included in the template... this is an advanced hack, but it nonetheless does fix a bug in the bot.

MarD 03-04-2004 20:24

Re: HPB_bot template #4 released!
 
Heyyo,

Thanks for the update! :)

I'm actually downloading the source SDK kit, and a C++ compiler, and I'mma try to mod HPBBot, and see what I can do. ;)

FrostyCoolSlug 07-04-2004 06:40

Re: HPB_bot template #4 released!
 
Quote:

Originally Posted by MarD
Heyyo,

Thanks for the update! :)

I'm actually downloading the source SDK kit, and a C++ compiler, and I'mma try to mod HPBBot, and see what I can do. ;)

Good luck, i've had a play before, did some interesting things with it, nothing that i released thou ;)

birchoff 24-04-2004 19:15

Re: HPB_bot template #4 released!
 
I found a link to valves hl sdk 2.3 here and was wondering what the difference is between this valve SDK and the one here in the filebase

Pierre-Marie Baty 24-04-2004 21:36

Re: HPB_bot template #4 released!
 
The differences are that the official Valve SDK has not been updated since it was released (a long time ago) and hence it lacks quite a few of the recent engine changes. More than this, the official SDK doesn't compile anymore on Linux (due to GCC updates). Ours include the latest fixes, the latest engine update and compiles perfectly on Windows and Linux. It's basically the same SDK that Will Day makes available on the metamod website.


All times are GMT +2. The time now is 07:02.

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