Game Development Community

Character Stats

by Wayne Eversole · in Torque Game Engine Advanced · 02/07/2010 (9:36 am) · 3 replies

I know there are a few stat samples out there but the ones I have found do not work with multi player so
does anyone have an example of a character stats setup that works with php?

Thanks

#1
02/07/2010 (11:17 am)
PHP is sort of incidental in this, since you're probably just using it as a transport mechanism. There is an old resource called "variable player aspects" or similar that shows how to create variables in the source that are networked, with appropriate network masks and such. It's very helpful, and if you want networked variables, this resource is a great read.
#2
02/09/2010 (6:18 am)
Maybe i'm misunderstanding, but can't you use tagged fields, global variables and/or a database to achieve what you want without touching the engine ?
#3
02/09/2010 (9:29 am)
Well, you can use the tagged fields in a datablock, but then changing it changes it for every object using that datablock. Globals, if used for multiple players, can get messy, plus are more exposed if there are hacks made for the game.

I use a database now to store the variables, but if you want them networked and truly independent, then you'll want to do something like the link above. Also, another way related to tagged fields is to use the dynamic fields (which are also called tagged fields when you dump, I believe). They're not as "reliable" as networked variables, though, but I still use them for variables on the client and server sides (the server pulls from the database every once in a while and when zoning, and the client doesn't need to be fully reliable since everything happens on the server).