Good format for game data

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

Post Reply
User avatar
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Good format for game data

Post by ancestral »

So I'm working on porting an old classic game called Realmz into Javascript and there's a lot of old practices that were used for storing game data. All the data is in binary files, which made sense 15 years ago so you could fit stuff on floppies. However, there are a lot of llmitations as there's a fixed number of bytes in sequence for things like in a character file for items and spells.

I want to save things in a slightly more dynamic method, and since this is going to be web based maybe it makes sense to do it in a text-savvy way? Perhaps XML or CSV, or something else entirely.

Specifically, the different types of data I'll need to store include map files, character files, saved game files, scenario files, and databases for items, spells, monsters, and races and castes.
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
palloco
Posts: 136
Joined: April 3rd, 2004, 9:28 pm

Re: Good format for game data

Post by palloco »

How about txt? It's an easy format to read and it is standard for web storage in systems like dokuwiki. XML will be more useful if you want to use other dynamic web interfaces.
User avatar
grzywacz
Inactive Developer
Posts: 303
Joined: January 29th, 2005, 9:03 pm
Location: Krakow, Poland
Contact:

Re: Good format for game data

Post by grzywacz »

YAML? :wink:
User avatar
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Good format for game data

Post by ancestral »

Interesting, I'll look unto YAML.

Just to clarify: as far as I know, I'm going to use text or binary for storing information. My question really is how best to:
  • Make it lean
  • Make it human readable
  • Make it accessible through Javascript (parsing)
  • Make it dynamic so things can be added or deleted without having to recompile
In the end it probably doesn't matter too much as long as I can code the app to handle it well enough.
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
Jodwin
Posts: 82
Joined: April 26th, 2005, 2:04 am
Location: Suomi Finland Perkele

Re: Good format for game data

Post by Jodwin »

ancestral wrote:[*]Make it human readable
[*]Make it accessible through Javascript (parsing)
[*]Make it dynamic so things can be added or deleted without having to recompile[/list]
So, you basically want anything that's written in plain text, no? Regardless whether it's XML, YAML, WML or something else you come up with on your own shouldn't matter as, if need be, you can always write your own parser (of course it's better to not to have to "reinvent the wheel", but virtually any kind of plain text parser would be possible to do). The whole question sounds kinda moot unless you drop the "Make it human readable"-requirement.
Yes I use windows, too.
Yes I too am aware of what that means.
Yes I'm still gonna use windows too.
ceninan
Posts: 4
Joined: July 15th, 2009, 3:56 pm

Re: Good format for game data

Post by ceninan »

Post Reply