Character Stats in a scalable/efficient form

Just started using Construct 2? Post your questions here

Post » Mon Jan 11, 2016 2:16 pm


I've been researching how best to create character "stats" in a game. From what I read, a dictionary was recommended and so I tried but came across an issue where, because everything is stored as a string, it wouldn't evaluate a number correctly. And I had to set it to and from a local variable before adding/taking from the dictionary.

It would be a semi complex stat system, where there is base stats (str, int, agi, etc) and skill stats (unarmed, gun, bow, etc) which can be manipulated (by a character adding points) along with other stats which aren't directly manipulated but do change depending on other stats (HP, evade, etc).

There would be multiple game levels and multiple save/load slots. It would also be nice if I could use these stats externally (future thinking) via AJAX/JSON. I may also change the formulas and add/remove/change stats as I work on the game (if that bears any significance).

Is a dictionary my best bet? (vs arrays, or something else?) If so, what would be the best way to implement this system?
On load could I transfer all dict keys/vars to instanced variables or global or something? Instanced/Globals I find are easier to work with than dictionaries, but they're also a bit messier than dictionaries.

I'm also thinking inventory/progress would probably be tracked in a similar way.

If anyone has any advice, or would like to tell me how they implemented a system like this themselves, I would very much appreciate it.

Posts: 4
Reputation: 248

Post » Mon Jan 11, 2016 5:59 pm

I'd use an array for this, maybe even put it in a container with the character..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
Posts: 6,160
Reputation: 19,775

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest