ID:265854
 
Okay, so right now I'm creating a hack and slash game where players will be forced to go up against massive numbers of enemies. As such I was testing out S_Damage to see how well it worked with my game. It works just fine for single target and even triple target damage, however there are certain spells player can cast with the potential of hitting 25 mobs at the same time. This causes the game a great amount of duress and will take the game approximately 1-2 seconds of paused game, before the rest of the spell resolves. Will this inevitably happen while using S_Damage? I think the answer is yes, because there's no lag without it. AS such, what's a good viable solution for showing the player how much damage he did in an AoE attack.
If you're calling s_damage 25 times simultaneously, there would be a little bit of lag, yeah -- it creates anywhere from 1 to 4 objs above a target, then flick()s the appropriate animations. Worst-case scenario, that's 100 objects being created simultaneously over 25 targets, then 100 objects being deleted a few ticks later.

Sadly, I doubt there's any better way to display area-effect damage, although if anyone wants to rewrite s_damage using more modern DM programming practices, they can be my guest -- as long as they don't call it "s_damage". That would increase the efficiency somewhat, I'd bet.
I wouldn't bother creating and deleting objects like Jtgibson said s_damage does.

Instead, I'd create one global image. Whenever a unit is damaged, the image would be modified and added to the unit's overlays. When it is time to remove the display, the image would undergo the same modification and be removed from the overlays. The second modification is important because other damages could have changed it during the wait and you need to make the image the same as the unit's overlay to successfully remove it. (There could be another method using an overlay list hack, but if there is then there's no guarantee that the implementation it relies on will always stay the same.)

I'm not sure if you'd be able to mimic the flicked animation's single loop. I'd like to say that setting the icon's loop settings would help, but the truth is that I have not had a reason to mess with them yet.