Sunday, September 24, 2017

Impressive Line Count, Dawg

While huge source code line counts make for great fish tales they are no good. At least in the context of this post. So I've created NormanNotation (nrmn), an interpreter for it, and a parser that uses the parsed objects to populate WorldWeaver (My IntFiction game engine) game databases. The problem is my interpreter is kind of basic so far and requires property elements to be on their own line. That means defining an attribute goes from XML's single line to four lines in nrmn!
This makes game definition files very difficult to read. Half of an element's definition is off the screen so all you see are a bunch of closing brackets. Even if your editor does code collapsing it's tough to keep track of where you are in the nested element nodes. So I've updated the interpreter to allow inline properties so instead of:
{object
  alias=sword1
  type=long sword
}
You can do:
{object alias=sword1 type=long\ sword
}
Closing brackets still must be on their own at this point, I'll probably correct that tonight. For most elements it isn't a problem but things like attributes would look weird. So it will go from:
{attribute alias=strength value=15
}
To:
{attribute alias=strength value=15}
Then I'll go through my definitions and make them much more readable.

No comments:

Post a Comment

From Shotcut to Kdenlive

So I've been using Shotcut for a while now, for my YouTube videos... and music videos. I love the application. Slicing clips, doing fade...