+-Discord Shoutbox


Alternatively, join us on Discord directly.
You can help CodeWalrus stay online by donating here.

Configuration format

Started by DarkestEx, November 16, 2015, 09:57:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DarkestEx

November 16, 2015, 09:57:59 PM Last Edit: November 16, 2015, 11:20:50 PM by 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:

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

  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DJ Omnimaga

Will those Claw files be hosted in games/gamename folders like C games data?
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10, HP Prime, fx 1.0 Plus, fx-7400G Plus, fx-9750G Plus, fx-9860G, HP 39gII
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite

DarkestEx

November 16, 2015, 10:24:21 PM #2 Last Edit: November 16, 2015, 10:36:02 PM by 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?
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.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DJ Omnimaga

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.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10, HP Prime, fx 1.0 Plus, fx-7400G Plus, fx-9750G Plus, fx-9860G, HP 39gII
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite

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.
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.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DJ Omnimaga

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.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10, HP Prime, fx 1.0 Plus, fx-7400G Plus, fx-9750G Plus, fx-9860G, HP 39gII
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite

DarkestEx

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 :)
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

alexgt

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 ;)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

DarkestEx

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.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Streetwalrus

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).

DarkestEx

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?
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DJ Omnimaga

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.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10, HP Prime, fx 1.0 Plus, fx-7400G Plus, fx-9750G Plus, fx-9860G, HP 39gII
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite

DarkestEx

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.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

DJ Omnimaga

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.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10, HP Prime, fx 1.0 Plus, fx-7400G Plus, fx-9750G Plus, fx-9860G, HP 39gII
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite

DarkestEx

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.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Powered by EzPortal