<i>This post was originally made by <b>danij</b> on the dengDevs blog. It was posted under the categories: Beta 5, Games, jDoom, jHeretic, jHexen, Version 1.9.</i>
I'm currently working on commonising the method for object respawn in multiplayer (that is the implementation to handle respawning items into the game world after some time in multiplayer, such as powerups health packs etc).
I would like to internalize this control in both jHeretic and jHexen to offer more direct control and more advanced customization (eg user modifiable respawn times via the GUI).
Currently this can only be implemented in jDoom as the object respawn process is controlled 100% internally in the jDoom library.
In jHeretic and jHexen the object respawn process is split, the routine is initiated within the respective game library but then control is handed to a few user customizable (DED) STATEs with two limited actions which are called to end the object respawn wait and to create the item in the world again (unhide).
There is only two advantages to having this controlled externally in the current implementation in jHeretic and jHexen:
<li>User controlable respawn time:This will be replaced using internal settings via the multiplayer game setup menus.</li>
<li>The respawn states can have custom state execute commands so that special actions can be set to occur when an object starts/ends the respawn process</li>
How should I go about this to retain backward compatibility with any existing mods and what should become of the existing STATEs and Actions used to control this in jHeretic and jHexen?
My first thoughts are to use a hybrid technique controlled 100% internally by the game library but to change to dissappearing/reappearing states momentarily before the action occurs (these STATEs will have no direct control over the object though. ie. their frame time will not be used to control the respawn wait time). The old unhide actions will become NULL action ptrs with no affect.