Re: [Super-tux-devel] Next IRC Meeting
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-03-08 16:57:33
|
Em Segunda, 8 de Mar=E7o de 2004 15:41, o Ingo Ruhnke escreveu: > Ricardo Cruz <ri...@ae...> writes: > > I could implement the use of files for tiles, but we need to agree > > with a file format. As I said before, the INI-like file format would > > be, IMO, the one that fits better with this. It is powerfull more > > than enough and very easy to edit. > > For the tile-format I am fine with .ini, it serve the purpose there > good enough. For the levelformat however its not that good, yep, it > would work for milestone1, but it wouldn't win a price for eleganc > (ie. simply misses any way to handle structured data across multiple > levels). > Nice to have a vote, would like to hear from Tobias. About the level file, I just suggested the use of the ini-like file as an= =20 alternative to the current one, that is hard coded readed and hasn't any=20 flexibility. Of course, in the future, INI-like format would not be that go= od=20 to use to make enemies position pixel-based or implementing moving platform= s=20 or places that would be creating enemies all the time... > > I am personally happy with the lispreader library which I used in > Construo (no extra library dependency, since its just two files that > can be assimilated): > > http://www.complang.tuwien.ac.at/~schani/lispreader/ > > It provides a way to read in lisp-like S-Expressions and returns a > parse-tree. Levelformat itself would then look like: > > (supertux-level > (version 1) > (properties > (name "Hello World") > (width 500)) > (enemies > (snowball (pos 11 10)) > (icecube (pos 10 10))) > (tilemap > (data 1 2 3 4 5 6 1 414 23 4324 > 1 2 3 4 5 6 1 414 23 4324 > 1 2 3 4 5 6 1 414 23 4324))) > I don't think that file format to be powerfull enough. Futhermore, an ini= =20 could be used like this: [LEVEL] version=3D1 name=3DHello World enemies_number=3D2 [ENEMY0] type=3Dsnowball xpos=3D11 ypos=3D10 [ENEMY1] type=3Dicecube xpos=3D11 ypos=3D10 [TILEMAP] rows=3D3 row0=3D 1 2 3 4 5 6 1 414 23 4324 row1=3D 1 2 3 4 5 6 1 414 23 4324 row2=3D 1 2 3 4 5 6 1 414 23 4324 The enemies_number and rows entries could even be omitted. > > > Another way which I would also find interesting is directory based > level format, ie. a level is represented as a directory: > > $ ls foobar.supertux/ > =3Dmap.data > =3Dname > =3Ddefault-archive > =3Dwidth > =3Dheight > $ > > Each file there contains then the relevant data (ie. tilemap data gets > its own file, level name gets its own name, etc.). Never used that in > practice, but its used in both QMail and Arch and has the advantage > that it is easy to parse from all languages, even bash, since there is > after all not much to parse, but just a directory tree to read in. > Disadvantages are of course that its a bit obscure to edit with a > text-editor, since its a multi-file format. That looks interesting, but managements and editing doesn't sound much=20 appealing to me, Ricardo Cruz =2D-=20 A fool and his honey are soon parted. |