.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 2 SDK (http://forums.bots-united.com/forumdisplay.php?f=62)
-   -   I don't like this! (http://forums.bots-united.com/showthread.php?t=3281)

stefanhendriks 26-12-2004 22:50

I don't like this!
 
http://www.chatbear.com/board.plm?a=...4991&v=flatold

check the latest post of botman... :'(

Lazy 26-12-2004 23:27

Re: I don't like this!
 
I don't have the HL2 SDK yet ( Hl2 disc 4 came broken, bah ) but does this mean bots cannot be made with a plugin but they can if they are built into the mod?

Wouldn't CBaseEntity be broken only on mods that break the offsets of existing members? like...

original:
+0 m_pEnemy
+4 m_iPlayerclass

Other:
+0 m_iAlwaysnull
+4 m_pEnemy
+8 m_iPlayerclass

Too bad only people who bought hl2 can get the sdk, I would like to read it while I wait to get my replacement copy of hl2.

Pierre-Marie Baty 27-12-2004 01:58

Re: I don't like this!
 
I don't understand what botman says (maybe because I don't have the SDK yet). Is he meaning that they took the equivalents of CreateFakeClient and RunPlayerMove out of the "enginefuncs" or whatever it is called now ?

I want to ignore all that server plugin stuff. I see an engine and a server gamedll. Both of them exchange stuff: data, functions. There's an interface to both. If we were to realize a hook DLL, first HPB_bot style, WHAT would we get ? Is it possible, first ? I strongly believe it is. The function we need to find to create a bot don't even count up to ten. And the only game DLL hook we need to get started is StartFrame, or whatever it is called. Does anyone have a clue how the engine attaches its DLLs, and couldn't we make a simple hook DLL featuring a transparent interface, for a start ?

Just tossing. Perhaps I need to finish downloading HL2 before rambling around like that.

stefanhendriks 27-12-2004 08:38

Re: I don't like this!
 
well, you can do CreateFakeClient, but thats about it. YOu can't have access to player data as much as you used to.

i tried cexports.exe already on the server.dll and client.dll on hl2 , but they only give me either 1 (exportinterface) or 3 'exports'... :S

i bet the exportinterface that is exposed, is the same as you hook in with your serverplugin thingy, but don't count me on that.

stefanhendriks 27-12-2004 08:45

Re: I don't like this!
 
* rofl, look at the latest post of botman there

Quote:

I believe it can be done, but bots written as plugins for Half-Life2 won't be as easy as they were for Half-Life1 (and those took me 3-4 months to get running with hundreds of engine crashes along the way).


@$3.1415rin 27-12-2004 10:39

Re: I don't like this!
 
sad news :/

I still don't get why mods have to modify the CBasePlayer, since they can derive another class and then modify it ... so there would be a nice and suitable way to access the data for each player ... but let's see what botman gets to know, somehow I always have the feeling that he got quite some more info than all of us :P

stefanhendriks 27-12-2004 11:45

Re: I don't like this!
 
same here, but when he says that, i am afraid its not something we should think to easily about. I think this will be pretty tough.

botman 27-12-2004 15:49

Re: I don't like this!
 
"Is he meaning that they took the equivalents of CreateFakeClient and RunPlayerMove out of the "enginefuncs" or whatever it is called now ?"

CreateFakeClient() is still an engine function pfnRunPlayerMove() became PlayerRunCommand() and is now part of the player.cpp file. Player movement is handled by something called MoveHelperServer() whos code is now part of the game DLL (not part of the engine). It looks like all of the engine functions that handled player movement are now handled in the game DLL. I believe that all collision checking is still handled in the engine (but I haven't researched this yet).

"If we were to realize a hook DLL, first HPB_bot style, WHAT would we get ? Is it possible, first ?"

No, it's not. Here's why. Under Half-Life1, you renamed the game DLL (mp.dll or hl.dll), you copied your hook DLL into the 'dlls' folder and your hook DLL loaded the game DLL. Remember everytime you upgraded a MOD, you had to go through this step all over again? With Steam, the server.dll (which replaced mp.dll or hl.dll) is updated almost once a week (there have been updates constantly since Half-Life2 was released). The frequency of the updates to server.dll will decrease over time, but each time the server.dll is updated, it will overwrite your hook server.dll and the player will have to re-install things.

The game DLL to engine interface is COMPLETELY different for Half-Life2. In Half-Life2, you have ONE function exported from the game DLL (called CreateInterface). Here's the output from 'dumpbin' on server.dll
Code:

Dump of file server.dll
 
  File Type: DLL
 
    Section contains the following exports for server.dll
 
          00000000 characteristics
          41AD220F time date stamp Tue Nov 30 19:44:47 2004
                  0.00 version
                    1 ordinal base
                    1 number of functions
                    1 number of names
 
          ordinal hint RVA          name
 
                    1        0 0016A490 CreateInterface
 
    Summary
 
            9F000 .data
            98000 .rdata
            53000 .reloc
            2B4000 .text

The CreateInterface function is used by the engine to pass in an "interface factory" function pointer. This "interface factory" is used to obtain function pointers to engine interfaces. You basically pass in a ID number of the type of interface you want and the engine returns you a pointer to the interface that matches what you asked for. For example, if you want an engine interface called "IGameEventManager" (which notifies you of game events like, player deaths, flag captures, etc), you might pass in 0x507 as the ID for the Game Event Manager (this ID is defined in the SDK header files). You get back a pointer to this interface so that you can call functions on that interface. Now let's say Valve decides to add a new function to this interface but doesn't want to break any existing MODs. They create interface 0x508 which has a different set of functions that 0x507 did. MODs that ask for interface 0x507 get that. Newer MODs that ask for interface 0x508 get it and can use the new functions. This allows the engine to be easily upgraded without breaking ANY existing MODs.

So you no longer have a 1-to-1 interface between the game DLL and the engine code. You have an N-to-N interface since your hook has to support all the latest and greatest engine interfaces in order to not break newer MODs (and this problem existed previously with bots in Half-Life1, but the engine interface RARELY changed, with Steam, the engine interface could be changing on a weekly basis).

Like I said on VERC, I believe that a server plugin type bot DLL would be possible, but it will be EXTREMELY difficult to get at the information that bots will need (it's difficult right now just to get at the other player's origin and angles).

botman

sfx1999 27-12-2004 17:22

Re: I don't like this!
 
But here is what I was thinking. What if you make the bots actual monsters, and find a way to get them on the scoreboard?

botman 27-12-2004 18:48

Re: I don't like this!
 
Why would that be any easier? The hard part is getting plugins to be able to collect information about real players AND to be able to get some entity (bot or monster) moving around in the world properly. Bot or monster makes no difference here.

botman


All times are GMT +2. The time now is 16:24.

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