.:: 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 ::. > Developer's Farm > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
I don't like this!
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default I don't like this! - 26-12-2004

http://www.chatbear.com/board.plm?a=...4991&v=flatold

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


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: I don't like this! - 26-12-2004

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.
  
Reply With Quote
Re: I don't like this!
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: I don't like this! - 27-12-2004

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.



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: I don't like this!
Old
  (#4)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 27-12-2004

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.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#5)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 27-12-2004

* 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).


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#6)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: I don't like this! - 27-12-2004

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


  
Reply With Quote
Re: I don't like this!
Old
  (#7)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: I don't like this! - 27-12-2004

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.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: I don't like this!
Old
  (#8)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: I don't like this! - 27-12-2004

"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

Last edited by botman; 27-12-2004 at 15:53..
  
Reply With Quote
Re: I don't like this!
Old
  (#9)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: I don't like this! - 27-12-2004

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?


sfx1999.postcount++
  
Reply With Quote
Re: I don't like this!
Old
  (#10)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: I don't like this! - 27-12-2004

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
  
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