Android Question Advice about structuring data and file formats

oliverm

Member
Licensed User
Longtime User
Hi chaps

I'm working my way through creating a little text based adventure game. However I want to allow for easily adding additional stories via some kind of easily editable structured data, I'm thinking XML or JSON.

Currently I'm parsing the XML in to an array (list) and at a basic level it's ok. However I'm finding that as I expand the XML the list is becoming more complex and dealing with the one-to-many nature of rooms containing objects and exits and the like is proving hard.

I could use a small DB instead of SQL which would make querying the data, and handling the structure, much easier but make creating the adventures much harder.

I could parse the data from an XML in to a DB and then query that but then...well...my brain starts to melt.

Not really looking for answers but if anyone has any advice on this kind of thing then I'd love to hear them.

Thanks

Olly
 

sorex

Expert
Licensed User
Longtime User
Olly,

not sure how your game is supposed to work but I think it's...

screen/rooms
objects
texts belonging to screen/rooms
texts belonging to objects
table for actions between objects

you could split up the xml into multi dimensional arrays(ROOMS as roomid, roomposition in map.) to link stuff to the other mdir arrays (ROOMTEXTS as room id, text)

you could go for the sqlite method but the logic will be the same even worse when something in the logic changes you need to update the sqlite structure(s) if people have an old one.
 
Upvote 0
Top