From: Chad Fowler Date: 2003-04-28T11:01:20+09:00 Subject: Re: Generating a DLL file? ----- Original Message ----- From: "Daniel Carrera" To: "ruby-talk ML" Sent: Monday, April 28, 2003 7:05 AM Subject: Re: Generating a DLL file? > I would probably understand your responses better if I know what a "bot" > is. Also, what is a MOD? > The way the game half-life works (and several other Quake derivatives) is that there is a somewhat brainless rendering engine which makes calls out to a separate DLL (or set of DLLs) which handle all of the game logic. The rendering engine is essentially just a view, with the "game rules" living in this DLL. Under the covers, it's a client server architecture, with a good amount of separation between these two layers. So, all of the code for monsters, weapon logic, "AI" opponents, etc. are in this DLL. There is generally one main exposed function in the DLL that is used to invoke game logic. A bot is an artificially intelligent opponent that is programmed and compiled into this DLL. It usually would behave like a human player in a multiplayer game. If you wanted to write this in Ruby, you have a couple of possibilities: 1. You could make a C wrapper for the DLL's main entry point as well as the callbacks to the rendering engine. After that, you would need to port all of the existing essential game logic to Ruby from C. 2. You could create a wrapper for the bare minimum you need for your modification, which would mean you would have to load your external ruby script and provide any necessary callback functions. This is probably the path of least resistance. Ultimately, though, you're going to need to learn how to program in C to do this. It can't be avoided. Chad > On Mon, Apr 28, 2003 at 10:31:19AM +0900, Rich wrote: > > > Well... if you don't know what a DLL is, how do you you want one? :) > > > > "I felt that it should be possible to create a DLL that sits between the > > Half-Life engine and the MOD and pass function calls from one to the other." > > (Quote taken from Botmans HPB_bot_src_2_1 found at: > > http://www.planethalflife.com/botman/downloads.shtml) > > (Botman is considered one of the founding 'bot' creators for HL) > > > > In the end that's how he does it - with a DLL. > > > > > > > > I'm confused. Why do you want to make a DLL out of a Ruby program again? > > > > > > > I don't want to learn C. > > I know enough of OCaml, but there isn't great support for DLL generation. > > (I might have missed what little exists) > > I love Ruby. > > I want to create a Bot. > > I thought I'd try to bring the two together... oh well, no worries! :-) > > > > > What makes you think that you want to make a DLL? How does that relate > > > Half-Life? > > > > > > > See previous question... and add that if it were known that a bot was > > written in Ruby... > > ... and the bot were written for HL/CS... (CS has more servers running than > > all of the > > other online FPS games _combined_ ... ) > > > > I'm just trying to spread the good word and have some fun at the same time! > > :-) > > > > No worries if I can't do it - I just thought I'd ask. > > > > Thanks anyway! > > > > -Rich > > > > > > -- > Daniel Carrera > Graduate Teaching Assistant. Math Dept. > University of Maryland. (301) 405-5137 >