Game Development Community

Wich is best for displaying health as text

by Richard Preziosi · in Torque Game Engine · 09/24/2009 (7:13 am) · 4 replies

I was looking into displaying health as text and surprisingly ran into quite a few resources, one done completely with script and a few others with source code changes, will list them below.

My question is, script would be easier as I don't like modifying the engine, but would it be more efficient to do it through engine modification. It seems like the game would run better and bog the system down less is the source is modified, is this a general rule or am i just delusional?

Anyways here are the resources

Scriptable
www.garagegames.com/community/resources/view/12064

Source Modification
www.garagegames.com/community/resources/view/1860
www.garagegames.com/community/resources/view/15295

The scriptable one says it works in multiplayer, so I think that's my best bet. However it says it constantly updates the player health, how bad is that going to bog things down?

Thanks

#1
09/24/2009 (7:25 am)
Don't be afraid to test a few out. Poorly written script or source could bog any engine down.
#2
09/24/2009 (8:12 am)
The scripted one will work, I've done something similar. Except what I did was to make it event based instead of having it on a recurring schedule -- the reason being that unless you're being damaged/healed/killed/spawned you don't need to constantly monitor health... you would just have to test and see if it was bogging you down -- it should be fairly simple to switch it over to being event based if it does.

So far as the source modifications go I would say that the Plastic Gem is the better way of doing it. It's simple, and best of all, it doesn't duplicate existing functionality but simply gives an existing control an extra option. I use this one myself (the dropshadows are just cool!), and with a little bit of extension you can have it displaying energy as text also.

The other source mod that you listed is actually all script, did you mean to link to something else?

Best advice is to test them out and go with the method that works best for you.
#3
09/24/2009 (8:52 am)
Decided to use the scripted one, as it was easier to implement, not a big fan of modifying the source as it usually takes a few hours of fixing errors and fails to get them working.

Michael I'd love to see your code for making it event based. I don't notice it bogging me down at all, but I've got a pretty hoss computer and no way to test the game on a lower end computer. It seems event based would be better anyways as it wouldn't use as many resources.

Thanks
#4
09/24/2009 (3:51 pm)
@Rich
I don't know if I will be able to get to it today, but I'll make a stab at converting that scripted resource and post the necessary changes here -- if more than a day or two passes just bump this thread to remind me ;)