123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|409|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Data Files for games

Sat, 28 May 2011, 15:32
JL235
One thing missing from PMC is the ability to handle data files. So I'm opening this up for suggestions. So far there are three ideas I can see:

1) text files. This has the pro that you can do anything you like. It has the con that you have to build what you need. To me, this is a pretty big con.

2) XML. I could build an XML editor and allow you to hand write/copy/paste XML too. This has the pro that it's an existing format. It would also make reading XML files much simpler (you don't have to build a parser). But there is the big con that lots of data does not elegantly fit into the XML structure.

3) Excel style. I could build (or re-use) an Excel like interface. So you could maybe paste in big amounts of data into a spreadsheet, and just handle it there. Again this has the pro that you have an editor for working with your data, and have a parser provided. But does all data fit into an Excel setup?

I used to use Quick Test Professional for testing, and this had an Excel-like editor included. At the time I thought it was a really neat idea (although like the rest of QTP, it was badly implemented).

4) a tile based editor. I'm thinking of something half way between Excel and a map editor. i.e. painting with numbers rather then graphics. This has the pro that it fits most usages for data, levels, and could also be used for non-level data (since it's just a grid of numbers and text).

Which of the above do you like or not like? Do you have any alternatives? Personally I'd love to offer something more user-friendly then plain text (so you could get running in less time), but also don't want to offer 10 different types of data files.

Thoughts?
Sat, 28 May 2011, 17:03
CodersRule
I do like the idea of using plain text, and being able to do whatever you want.
Perhaps you can make it use text files, but have built-in libraries to use other formats properly. It would be as simple as parsing a text file with some built-in XML parser or something, so you can choose what you'd like to use.
Sat, 28 May 2011, 17:20
dna
Using text files would be smaller in many instances and they can be manipulated for compression or encryption easier.


-=-=-
DNA
Sat, 28 May 2011, 17:27
Jayenkai
I've been wondering about this for a while, tonight, and everything I can come up with is something that I'd use, but no bugger else ever would!!

On the one hand, if you build something "for simplicity" (ie, tile map editor), then you have to build 50 different "for simplicity" things to do each and every little thing.
On the other hand, having the engine hold a 2nd "data" file, where you can sling bits of text, then read 'em back in the game.. That'd be simple.



Then, maybe have FromData(Animals,3).. or something!?


But, yeah, I think at the minute that's pretty much just for me, and realistically, it's only for Puzzobomb!
If I can cobble together a way to store that in a picture file, then there's no real issue at all, until someone else brings it up!


(and by "Data" file, I mean have it open like the Code screen, just a 2nd page for slapping text into..)

-=-=-
''Load, Next List!''
Sat, 28 May 2011, 17:30
HoboBen
I'd vote XML. As you're using Javascript, why not store it internally as json? (Have the XML to JSON conversion done as a one-off server-side)

Binary data would be useful but for Javascript you probably have to base64 encode it or encode it as an image... ideally that would be done automatically server-side rather than done by the user.

-=-=-
blog | work | code | more code
Sat, 28 May 2011, 17:35
Jayenkai
I'm not sure about XML. I mean, unless you're going to then add an XML editor to neaten the creation, you're essentially going to be giving a screenful of XML to the coder, and going "put yo shitz there!!! AND MAKE IT NEAT!!!!"

-=-=-
''Load, Next List!''
Sat, 28 May 2011, 18:53
JL235
If I use XML, JSON or something else then I'd want some sort of an editor. It would be JSON or XML behind the scenes. But editors can also be too crufty and slow.

@Ben, I've also had the same thought (store XML as JSON). If I do use XML (which I dunno if I will) I'd do it that way. Either way I might end up using JSON anyway to structure data in the backend.
Sat, 28 May 2011, 21:16
dna

I'd use a text file an then do some fancy stuff like Jay did in his JNK code.


-=-=-
DNA