So, lately code production of Legend of Luth has focused on developing a scripting language for the game. I’m calling it DragonEvent Script, mostly because I’m pretty sure “DragonScript” has been taken by one thing or another.
Why a scripting language?
Because A) I’m making this game from scratch, more or less, B) it saves time in the long run, and C) it allows David Ludwig, who is working on the game with me, to do more code-type work without having to fully learn to program. Actually, the most important reason is probably: D) it allows me to generate content in an easy, more right-brained way.
Why is that helpful? Because hard-coding large amounts of pure content is actually quite time-consuming. Mostly it’s the little things–like checking if the player has an item and having an npc react different based on that–that are hard to separate into a separate content file without having to create really complex code to load it in and out.
Part of that is the fact that I’m doing this project on my own from scratch, for learning, fun, and profit. So, embodying the great virtue of a programmer–laziness–I try to do work up front to save myself a lot more work in the future, structuring things so as to get the most out of every line of code I write… since I’m the only one writing the code.
But it’s also useful. Typically, the trend in programming is to extol the virtues of keeping your code and your content separate–and there may very well be some way to do that better than what I’m doing. However, I’ve found that the great thing about using a scripting language is I can write the code to support it, and then I can focus on the high-level concepts like “starting a battle” or “giving a treasure” or outputting text. Then I have less work writing all the “plumbing” for that.
It’s not without drawbacks, though. You don’t get the benefits of an IDE when you write your own scripting language. And that can make you feel like you’re back in the stone age of programming sometimes. But that’s why I mitigated some of that–I actually wrote some code to scan the script file for the common errors. I’m also going to extend the existing framework for the scripting language to include more informative error-handling.
So, it’s not perfect–but when I can write:
You charge into the battle, sword drawn!
You emerge victorious!
instead of something like:
Util.writeLine(“You charge into the battle, sword drawn!”);
MonsterGroup mongs = new MonsterGroup(“GoblinCrew”);
Combat com = new Combat(mongs, p, w, true);
Util.writeLine(“You emerge victorious!”);
Treasure t = new Treasure(“Treasureparcel1”);
…it’s a lot easier and more intuitive. I’ve actually found that it opens up the possibilities of much more complex and dynamic level structures than before–while still being easy to write. It also makes the core of my code more of an engine and less tightly coupled to the content–which means re-usability in the future, which is a good thing.
The latest version of Legend of Luth is available for download here.
All images, writing, characters, artwork and related indicia are (c) Earl Isbell
Feel free to leave a comment, browse the galleries, or contact me if you wanna buy a print, commission me, or just drop me a line. Just navigate using the links at the top ^^.