[DGD] Heartbeat

birgit.schulte at philips.com birgit.schulte at philips.com
Tue Jan 14 12:34:56 CET 2003


One rather basic possibility to design a combat-system could look like this:

This suggestion assumes that you consider combat as a possible state of a living, which will be valid
until either the living dies or uses some means to explicitely leave the state of combat.
You create an object which takes care of combat in general, let's call that the combat-daemon.
This daemon contains the basic functions for combat, among them one which might be called
combat_action(object player, object enemy, ...whatever...)

This function would call itself via call_out every few seconds, and as long as the state
combat is valid for 'player'. The intervall in which it calls itself may depend on the characteristics
of the player, like a fat troll reacts slower than a nimble elf, and may even change depending
on what happens in the fight.

Upon execution, it might check if the player has issued a special combat-command in the meantime
to be executed (some fancy special manoeuvre maybe), else it might just do a default-combat action
(bash the enemy over the head with my club).

Good luck designing :-)

Birgit



                                                                                                                               
                                                                                                                               
                                                   To:   dgd at list.imaginary.com                                                
                                                   cc:   (bcc: Birgit Schulte/HBG/SC/PHILIPS)                                  
                                                   Subject:    [DGD] Heartbeat                                                 
                                                                                                                               
               "Jamin Vander Berg"                 Classification:                                                             
               <jaminv at softhome.net>                                                                                           
                                                                                                                               
               Sent by:                                                                                                        
               dgd-admin at list.imaginary                                                                                        
               .com                                                                                                            
                                                                                                                               
               01/14/2003 11:19 AM                                                                                             
               Please respond to dgd                                                                                           
                                                                                                                               
                                                                                                                               




Alas, it has gotten to the point where I have items, rooms, players, weapons, and even ammunition. And I can't truly test the weapon part out until I've got, at the very least, the frame work of a combat system laid down. So... here's the question:

Any recommendations or things I should know about (but apparently can't find) about setting up a timer/heartbeat, or anything similar, for purposes of combat.

I understand combat is a pretty broad and complicated thing. In generally, however, combat does not insue as a series of responses to two living objects hitting each other, all happening instantly. Of course, the combat system should give a second or two
for the player to rattle off some commands, maybe run, maybe heal, whatever. I suppose its possible (and relatively easy) to just wait for a certain time before executing the next action, but that'd have to run as another thread so commands could still be
parsed.

I'm looking for any general ideas/concepts/suggestions for starting up such a system. Any help is greatly appreciated.

--jaminv



_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list