Featured Member Projects > Ninjabyte Electronics (hardware)

Configuration format

(1/4) > >>

DarkestEx:
So I guess we will also have a so called Claw Data Notation to have easily editable configuration files that will be used by the OS and the games to store highscores and savegames and to load levels from.

It will have arrays of numbers, numbers, strings and booleans and uses key-value pairs.
Comments are there too. The overall style will be similar to Claw.
I think I will also make it possible to compile it into bytecode too so that it loads faster but then the possibility of editing it easily is lost.

Here is a sample:

--- Code: ---name = "Sample"  -- this is a comment
levels = [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size = 5
hard_level = true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names

--- End code ---

xlibman:
Will those Claw files be hosted in games/gamename folders like C games data?

DarkestEx:

--- Quote from: DJ Omnimaga on November 16, 2015, 10:16:53 pm ---Will those Claw files be hosted in games/gamename folders like C games data?

--- End quote ---
Yes they will. C games are also encouraged to use the same format and we will, as we implement the parser in C anyways, provide an API to easily use this format in C too. Claw will have bindings for it too.

xlibman:
Yeah it would be better if games all used the same format, providing that it's not a nightmare to send stuff like it was on the HP Prime (although most HP issues are due to using a proprietary linking software instead of mass storage device). Just make sure that games use separate sub-folders so that they can't overwrite each others.

DarkestEx:

--- Quote from: DJ Omnimaga on November 16, 2015, 10:34:54 pm ---Yeah it would be better if games all used the same format, providing that it's not a nightmare to send stuff like it was on the HP Prime (although most HP issues are due to using a proprietary linking software instead of mass storage device). Just make sure that games use separate sub-folders so that they can't overwrite each others.

--- End quote ---
Yes that is what I thought too.


By the way, should the assignment character be? = or :
= is more similar to Claw or C

Here are both in comparison:

With :

--- Code: ---name: "Sample"  -- this is a comment
levels: [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size: 5
hard_level: true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names

--- End code ---

And with =

--- Code: ---name = "Sample"  -- this is a comment
levels = [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size = 5
hard_level = true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names

--- End code ---

The whitespace around the : or = is ignored in any case.

Navigation

[0] Message Index

[#] Next page

Go to full version