Latest Neocron News and Information

  • New test server patch #591 has been released to Vedeena

NcSource:Programming psi healing shields

From Neocron Wiki
Jump to: navigation, search

Ok, i (r2) am currently working on getting the basic PSI and DoT (damage over time) system implemented. There a several things i would want to discuss with you.

The Source-Engine has afaik an entities cap of 2048 entities. Having this cap we should avoid creating an entity for every single shields/heal/dot. So i thought that one could just implement one single logical entity serverside that keeps track of all the shields, heals and dots serverside. If someone casts a heal, the psi manager will be called and it creates a particle effect (an entity) which will be attached to the player and which (the particle effect) will also handle the hud thingy showing up on the client who got that heal. The time how long that heal will last will be controlled serverside but the user will see the progress bar we all know and love ;) The shields will be more or less silently be kept track of. Every second they will be checked whether they ran out or not and the entitys belonging to the specific gui elements on the clients will be updated. So the gui elements are the only entites which are created. The shield particle effect will be created once a player recieves damage and will fade out quite fast (like the shields in NC). So basically the main informations about the psi effects will be stored in structs serverside and the graphical effects will only be spawned as entities when needed. That way we may reduce the amount of entities. But the downside of this is that the Think function of the manager class, called once a sec, may(it doesn't have to just maybe) become more or less huge and time consuming.

The other possibility would be to drop the concept of the manager class more or less completely and spawn a new entity once a shield/heal/dot is casted. This maybe makes sense for the heals but the shields which spawn their particle effects just once in a while that may create an entity overhead. But this approach would distribute the processing time needed a little bit better, but it would also consume more processing power. Apart from that, it is harder to handle. --R2d22k 12:34, 1 March 2010 (UTC)