Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm building an RPG style game, but i have some trouble with storing data from entities. These entities can carry data including but not limited to their location, their graphics, whether they are solid, and so on.

I have thought about just storing it as a list of numbers, but this means that a single change (adding a variable for example) will break the entire saving system.

Is there an easier and more versatile way to store this information?

EDIT: Ok i did a bit of searching and i found a bunch of questions basically the same as this one. Feel free to ignore this question ;)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Assign each entity an ID, then store each component (location, solid, etc) in a separate table indexed by the entity ID.

Or just use JSON.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.