Map format rework
This week, I mostly spent time reworking the map format and how things are written. There's not much to show in terms of images, but I'll talk a bit about what this looks like for me and what it allows!
The idea of the map format I'm making for Mirabelle is that it's "human editable". Basically, without being a coder and without spending too much time learning how it works, you should be able to edit it.
Of course, down the line (or in a few days, not yet sure), I'll make an in-game editor where you don't need to edit the map format directly. But it's still a good idea to keep the map "human editable", in case there's tweaks to do or in case the map editor can't do everything (which it certainly won't, at least at the start).
Why would I think I managed to make the maps "human editable"? Here's an example of a map file.
[map] +---+ +---+ |XXX+--+XXX| |XXXXXXXXXX| |XXX+--+XXX| +---+ +---+ [/map] [entities] [wallTorch x="@1" z="@3" direction="w" /] [wallTorch x="@3" z="@3" direction="w" /] [wallTorch x="@1" z="@8" direction="e" /] [wallTorch x="@3" z="@8" direction="e" /] [player x="@2" z="@2" angle=180 /] [/entities]
Hopefully, it's fairly easy for anyone to "imagine" what the map looks like. There's a simple map layout on the top, seen from above, and with two rooms inside. There's torches that are placed on the wall on the map, looking east and west, and they seem to be on each side of the room entrances. And finally, there's the player, that appears in the middle of the first room. There's still some learning needed to understand the "@" symbol, and the format does expect you to be okay with math angles and to know what "east" or "west" means. But still, I hope the map format is readable enough that you could expect to see something like this:
And how to edit it? Well, let's quickly make Mirabelle tied up and blindfolded:
[map](...)[/map] [entities] (...) [player x="@2" z="@2" angle=180] [startState binds="torsoAndLegs" /] [extraBinds blindfold="cloth" /] [/player] [/entities]
This, again, is fairly easy! So, what do I need to spend so much time reworking, then?
Well, the [entity]
part used to look like this:
[entity] [prop](@1 1.2 @3) 0 wallTorchLit[/prop] [prop](@3 1.2 @3) 0 wallTorchLit[/prop] [prop](@1 1.2 @8) 180 wallTorchLit[/prop] [prop](@3 1.2 @8) 180 wallTorchLit[/prop] [player](@2 @2) 180 torsoAndLegs {leatherCorset style2 red none cloth}[/player] [/entity]
You needed to know a lot of things before you can use that format - what order do things come in, what do they mean based on where they are, what some of the default parameters are if you just want to change one thing, and so on. And there was little to no error reporting if you messed up, so you were on your own.
The new format fixes all of these issues.
Of course, the one big issue with the new format is that all of the maps I have use the old format. So, I spent part of the weekend rewriting all of the maps. Thankfully, most of them were "simple" demo maps that showcased one specific asset were easy to rework, so that's good at least!
Anyways, that's it for this week! Next week, I'll either start working on the actual maps for the pre-alpha 2 version, or I might spend some time working on the in-game map editor I talked about earlier to make map creation even easier. See you then!