DSL with Lua experience anyone?

In my endless adventure into creating a toolkit for point and click adventures, I’ve started to look into DSL to script room and events. Anyone has any experience with it?

I’ve found this, which is a good starting point in the meantime:

1 Like

Perhaps @marco.giorgini? He’s done several point’n’click games in Defold if I’m not mistaken.

1 Like

That’s definitely an option. For Interrogation we went the crazier route and actually wrote a fully fledged DSL with its own grammar, an Atom syntax highlighting plugin and a transpiler (in C++, so it can be easily added to a native extension) that compiles it to Lua code.

Having done this, I don’t recommend it unless you know what you’re doing. If you can find a way to do it with Lua’s syntax, definitely go for it.

Even better, if your game’s data can fit neatly into a Google Sheets table, use that (since editing a table can sometimes be considerably easier than editing a text-based DSL), write a curl one-liner to download it as CSV whenever you need it updated and use a CSV parser to load it into the game. We took this approach to quickly prototype all the various game entities of Domains of Dusk until we find/make a better editor.

3 Likes

yes - I’ve used a specific designed language for all my Defold point and click - and I encapsulated it into a json - so it was really easy to use it in LUA - a set of object like properties I use in cascade so I can have a sequence of default behaviours where I don’t have specific elements inplace (I mean I’ve got actions and objects with properties - and rooms with objects and properties - when I check actions I check first in room the in generic elements - both ways). To complete to sequence I’ve designed rooms in Aseprite (where I use layers - with keyword-based names - I mean act.player or act.character3 - to match in the script actors player and character3 - or obj.mouse to match in the script object mouse - and so on)
Lua / Defold code is complex BUT it’s generic - and it works on 1) the json with the game code (that includes also game settings) and 2) the graphics I extract and compile from aseprite files
Don’t know how helpful this info can be - I mean another (maybe easier) choice would be to have rooms (as code) inside Defold and use directly LUA (with functions to work with game screen / inventory / characters). I didn’t do it because I usually create games for jams so how fast I can work for me is really important - and working with a more specific language where I can not only speed up writing because the syntax is poorer but I can also add aliases AND see a tree like structure of the commands is gold - at least for me

5 Likes

Thanks Marco!
I completely forgot about your DefAdvSDK :stuck_out_tongue:

I’m going through the source and there some really interesting things in there, especially in the way you organised the project. Not sure I plan to go with the full external language. I’ll probably just stick with Lua and make the flow of commands more fluid using the tricks in the article I linked.

I also want to be able to use editor extensions as much as possible. Possibly some of the things I need will be added in the future (hint hint custom collision shapes and editor script hooks)?
For everything else it will be an external editor but something custom.

It’s still a long way to go anyway!

2 Likes