Creating characters
by Daniel Buckmaster · in Torque Game Engine · 04/12/2008 (9:48 am) · 6 replies
This is kind of a tough question, and I'm just figuring out how to answer it. My game is an FPS, but I wanted it to include some RPGish elements - specifically, 'leveling up' in that if you hit people with your gun a lot, you get stronger, but if you shoot them instead, you get more skilled. Plus persistent stats like the total number of kills scored by the character, or battles participated in.
Also, there are additional features. For example - when you start up the game, all you can do is load a character. When you do that, you get pushed through to a character menu, which is different for every race a character can be.
My first trial run just saved characters off as text files. When you load a character, the scripts just set a bunch of global variables based on the information in the character file. When scripts need to do something (like load the character menu), they look up the global var. I'm having second thoughts about this system, but the problem is, I don't know any other way to do it. It's obviously wide open to client-side hacking; players could go in and edit all their character's values, which would make it no fun for other players online. But I don't think there's an option to store characters except for client-side. I guess that means encryption. But that's still not secure, right? Meh.
Apart from that, it's just sort of a clumsy system for loading and unloading characters. I thought of a whole lotof things I want to be able to do, such as swapping characters in between missions... and this system doesn't seem to cut it. I guess that a whole load/unload character script sequence would help. One that somehow clears everything that's going on, pops all the GUIs, then reconstructs everything with the correct character (race) settings. Seems like a lot of work, though :P.
Also, there are additional features. For example - when you start up the game, all you can do is load a character. When you do that, you get pushed through to a character menu, which is different for every race a character can be.
My first trial run just saved characters off as text files. When you load a character, the scripts just set a bunch of global variables based on the information in the character file. When scripts need to do something (like load the character menu), they look up the global var. I'm having second thoughts about this system, but the problem is, I don't know any other way to do it. It's obviously wide open to client-side hacking; players could go in and edit all their character's values, which would make it no fun for other players online. But I don't think there's an option to store characters except for client-side. I guess that means encryption. But that's still not secure, right? Meh.
Apart from that, it's just sort of a clumsy system for loading and unloading characters. I thought of a whole lotof things I want to be able to do, such as swapping characters in between missions... and this system doesn't seem to cut it. I guess that a whole load/unload character script sequence would help. One that somehow clears everything that's going on, pops all the GUIs, then reconstructs everything with the correct character (race) settings. Seems like a lot of work, though :P.
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
Torque school looks interesting, but just looking at the Character Creation for AFX 'course' - it's way overkill for what I need. It also seems to focus on the code side of things - rather than how to manage what I'm having trouble managing, which is the client side of things (race GUIs, character loading/unloading). The coding I'm getting better at :)
04/12/2008 (11:49 am)
I figured I was being kinda tame with this idea :P. I'm not going for MMO in any way or form - but there are elements of RPGs that I would like to include. While implementing those features is simple (scaling damage, tightening random projectile scatter cones, etc), you're right in that I don't have a good understanding of a few aspects.Torque school looks interesting, but just looking at the Character Creation for AFX 'course' - it's way overkill for what I need. It also seems to focus on the code side of things - rather than how to manage what I'm having trouble managing, which is the client side of things (race GUIs, character loading/unloading). The coding I'm getting better at :)
#3
in that case, these different values need to be on the server one way or another, no ?
so why not save & load them there ?
04/12/2008 (11:56 am)
Daniel, sounds like this is a multiplayer game ?in that case, these different values need to be on the server one way or another, no ?
so why not save & load them there ?
#4
Though you're right, getting data to the server is another thing I'm worried about. I guess onInitialControlObject (or something like that, it's called) could be a way to set initial stats for clients joining the game...
04/12/2008 (10:18 pm)
Yep, it is. But the data still has to be stored somewhere - I don't want to have to set up a persistent server for data to be stored on for everyone who plays the game.Though you're right, getting data to the server is another thing I'm worried about. I guess onInitialControlObject (or something like that, it's called) could be a way to set initial stats for clients joining the game...
#5
re getting the values to the server, how about just commandToServer ?
04/13/2008 (9:12 am)
You might be able to authenticate the client-side settings file with some public/private key type stuff, but i'm not sure if it'd be worth it. if it were me, i'd just go with some really simple encryption for starters, and then if/when client-side hacking becomes a problem, look at beefing that up.re getting the values to the server, how about just commandToServer ?
#6
commandToServer was my first thought, but then I got all paranoid about how easily the client-side can be hacked :P. But yes, server commnads are the way forward, I guess.
04/16/2008 (7:29 am)
I've been working up ideas for an encryption scheem, but I'm worried about it not being enough. Still, you're right - security can be an 'if and when' thing for now.commandToServer was my first thought, but then I got all paranoid about how easily the client-side can be hacked :P. But yes, server commnads are the way forward, I guess.
Torque 3D Owner Edward