Friday Fun #6

Welcome to the latest installment of Friday Fun, the weekly blog where I type some words about game development and hopefully you read them and get something out of it.

Modding II

The really exciting news this week is the progress I have made with the “Modding II” milestone for Dehoarder 2 just started this week.

“Modding I” brought us modding of the game database, allowing new objects to be added to the game or existing objects to be changed. This was the first pillar of the Dehoarder 2 Modding system.

“Modding II” brings us a proper scriptable interface for authoring Story Events and Cutscenes. In earlier prototypes of Dehoarder 2, sequencing of story events and cutscenes was handled through commands specified in an XML document. It was great when it all began, when the story events were just straight-line sequences of commands. As the game grew in complexity, and the events started needing things like variables and conditional logic, the system proved to be rigid and inflexible, and trying to make it more flexible resulted in abominations like every conditional launching a new story sub-event. By moving from XML-based story event scripts to proper Lua Story Event Scripts, we add far more power to the system, and greatly increase its expressive efficiency.

I started simple, by starting to expose the familiar story event scripting command set that I am used to from XML as Globals in Lua. Pictured right is an example of converting a Story Event from the old XML system to Lua. Simple is awesome! The script is very expressive, and yet there is room to make it even more expressive in the future.

Under the covers of that simplicity, though, there is some complex stuff going on – especially with those Wait() calls.

You see, even though we’ve had multicore processors in our PCs and even in our handhelds for a long time now, the fact is that game engines like Unity still like everything to be on a single thread (though what Unity doesn’t know won’t hurt it 😉!), so if those Wait() calls literally spun and waited, the whole game would freeze. What is really needed is for Wait() to actually mean SuspendThisScriptAndDoOtherThingsUntilATimerExpires(). Enter Lua coroutines.

Converting A Story Event from XML to Lua

Lua coroutines are a form of pre-emptive multi-threading. When a Lua function is executed as a coroutine, it can yield execution through a special call, and even communicate information when yielding. So, under the covers that Wait() command is actually engaging this coroutine facility, yielding control while communicating that it wants to be put to sleep for a specific period of time before it is resumed. Of course, all of the complexity of using coroutines is being encapsulated away from the mod developer, for ease of development.

In the coming days, I will continue to convert the entirety of Dehoarder 2’s story events to the new Lua system, culminating in the deprecation the old XML-based system.

The third pillar of modding yet to come, consistently titled “Modding III”, will be to allow individual objects to respond real-time to events in-game.

Prepare For…

It has now been a full week since Prepare For Warp has been fully released. The game playtests really well, it’s just really difficult to get any visibility or attention out here. It does not help that the game is in a genre (Arcade) that is currently less popular, and lacks features to really build a community around.

What the game does have, although in a subtle way, embedded in the gameplay, is a description of the human condition of wanting to leave a better world for those who come after us. It does this through its retirement, legacy, and prestige system. Each pilot contributes to making things just a little easier for the pilot that comes after. Finally, after generations of striving, the goal of reaching Thend is achieved. I would love to highlight this with a proper in-game story at some point.

I need to somehow do a better job building buzz around the game before release. It should be noted that this project was already in-flight when I transitioned to full-time work, so the early part of the project did not get the marketing effort it deserved due to want for more hours in a day.

All I can do at this point is continue to try to put what I know is a good game in front of streamers, continue to try to make it visible, and hope that some critical mass of players gathers around it.

By contrast, my next project (Dehoarder 2) straddles much more popular genres, and also contains the aforementioned extensive modding system to support a community of players. Story will also be paramount in Dehoarder 2, and at its core Dehoarder 2 is a game that is very expressive of the human condition. In short, Dehoarder 2 will have a lot more to offer to draw players in the door. I also hope to start putting Dehoarder 2 in front of more people sooner than I have with my games in the past, hopefully in the next couple of months.

Peace Out

That’s all for this sixth edition of “Friday Fun”, the weekly blog that is now officially a habit! For more of my antics and ramblings, be sure to check out my Daily Standup posts available exclusively to my Patreon supporters. Until next week, keep a level head and remember to have some fun!