CodeWalrus

Featured Member Projects => Completed and Inactive Projects => [Inactive] Ninjabyte Electronics (hardware) => Topic started by: DarkestEx on November 16, 2015, 09:57:59 PM

Title: Configuration format
Post by: DarkestEx on November 16, 2015, 09:57:59 PM
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:

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

Title: Re: Configuration format
Post by: Dream of Omnimaga on November 16, 2015, 10:16:53 PM
Will those Claw files be hosted in games/gamename folders like C games data?
Title: Re: Configuration format
Post by: DarkestEx on November 16, 2015, 10:24:21 PM
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?
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.
Title: Re: Configuration format
Post by: Dream of 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.
Title: Re: Configuration format
Post by: DarkestEx on November 16, 2015, 10:36:46 PM
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.
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 :

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


And with =

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


The whitespace around the : or = is ignored in any case.
Title: Re: Configuration format
Post by: Dream of Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Title: Re: Configuration format
Post by: DarkestEx on November 16, 2015, 11:20:13 PM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Alright I think so too :)
Title: Re: Configuration format
Post by: alexgt on November 17, 2015, 12:17:54 AM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Lol, I program on calc so I just code with the -> sign still, I guess that it is a habit from Ti-Basic.

But yeah Dark go with = instead of the others like DJ said ;)
Title: Re: Configuration format
Post by: DarkestEx on November 17, 2015, 01:31:36 AM
Quote from: alexgt on November 17, 2015, 12:17:54 AM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Lol, I program on calc so I just code with the -> sign still, I guess that it is a habit from Ti-Basic.

But yeah Dark go with = instead of the others like DJ said ;)
Alright I'll do. I hope this configuration format is straight forward to use and change.
Title: Re: Configuration format
Post by: novenary on November 17, 2015, 09:18:42 AM
I know a lot of configuration formats that use : instead of =, at any rate I prefer the latter and hate := (which has a different meaning than = in make by the way).
Title: Re: Configuration format
Post by: DarkestEx on November 17, 2015, 10:13:33 AM
Quote from: Streetwalrus on November 17, 2015, 09:18:42 AM
I know a lot of configuration formats that use : instead of =, at any rate I prefer the latter and hate := (which has a different meaning than = in make by the way).
Well we were never going to use := anyways. So we will use = for the configuration.

How do you all like the configuration format so far?
Title: Re: Configuration format
Post by: Dream of Omnimaga on November 22, 2015, 07:41:42 AM
Actually, now that I see alexgt post, -> would be nice as well if it was supported, because TI-BASIC programmers would get used to it faster. However, it really has to be -> and not a special character like on calculators, so that it's easier to type on a computer keyboard. But if you support -> then perhaps = should be supported as well for those who are more used to computer languages.

As for the configuration format, I am ok with it.
Title: Re: Configuration format
Post by: DarkestEx on July 24, 2016, 03:45:25 PM
Quote from: DJ Omnimaga on November 22, 2015, 07:41:42 AM
Actually, now that I see alexgt post, -> would be nice as well if it was supported, because TI-BASIC programmers would get used to it faster. However, it really has to be -> and not a special character like on calculators, so that it's easier to type on a computer keyboard. But if you support -> then perhaps = should be supported as well for those who are more used to computer languages.

As for the configuration format, I am ok with it.
Given that this configuration format will still be implemented into Claw, though I don't know if the arrow will be implemented as I don't know if we will implement the configuration module in the TI-84+ version at all.
Title: Re: Configuration format
Post by: Dream of Omnimaga on July 24, 2016, 03:58:29 PM
Just make sure to choose programming characters that don't require the user to constantly open Windows Character Map and searching for special characters there every second or so. On the HP Prime it was kinda annoying that some of the most rudimentary characters required doing that and it considerably slowed down program writing.
Title: Re: Configuration format
Post by: DarkestEx on July 24, 2016, 04:02:55 PM
Quote from: DJ Omnimaga on July 24, 2016, 03:58:29 PM
Just make sure to choose programming characters that don't require the user to constantly open Windows Character Map and searching for special characters there every second or so. On the HP Prime it was kinda annoying that some of the most rudimentary characters required doing that and it considerably slowed down program writing.
It'll be a simple equal sign. I don't really plan supporting writing Claw code on a Calc.
Title: Re: Configuration format
Post by: Dream of Omnimaga on July 24, 2016, 04:18:57 PM
Ah ok. That's good and standard.

Also it's not just an issue about on-calc code, but also PC. On the HP Prime, one syntax supported for storing something in a variable used an unicode arrow character, which required searching the character map, while the other syntax used := instead of =, which still took a bit of time to get used to compared to = or ->.

I'm ok with no on-calc support btw.