Teaching programming with the Solarus Zelda engine

My oldest son recently turned seven and has been enthusiastic about building mazes and worlds for some time. Since we homeschool, I told him that if he could finish all his math for the year, I would begin teaching him how to make his own video games. This is what got me into computers originally, beginning with a Commadore 64. Well my wife informed me that he has spent the last couple of weeks burning through his math homework and was now complete. It was time to come up with something fun to introduce him to this weekend.

solarus-2

When I was first learning to code, the web didn’t exist yet and the few books on the subject were mostly about C and much to daunting for a young person. Today though, there are so many options. After poking around a bit, I discovered Solarus, an open-source Legend of Zelda clone framework that includes a pretty full-featured world/quest/level editor written in Java. The folder structure is simple to understand and everything is either just a text data file, PNG image, or OGG sound file. Enemies, items, and triggers are scripted with Lua. The engine itself is written in C++ and binaries for Windows, Mac, Linux, and Android are ready to go.

solarus-4

He has gone to town making his own maps and creating teleporters between the rooms. He’s not coding yet, but getting used to X,Y coordinates, image dimensions, unique identifier names, and some CLI. By assigning a few game variables, we were able to create locked doors that required keys found sprinkled elsewhere. We made some of our own graphics and were to set them up as usable sprites and tiles. Later this week I hope to start scripting a bit of the enemy AI. Right now the badies are stupid and just move back and forth in once place. I’m optimistic that this will be a great way to introduce him to a bunch of programming topics in a fun and motivating way where he’ll be able to see pretty immediate results without having to wrestle with tools all day.

I remember trying to program a Zelda-esque game too and how I spent most of my time trying to get the DirectX 3 libraries to compile properly with Borland and the double-buffering to look right. Ugg. I hope he can have a bit more of his hero lost in a castle in the clouds rather than debugging in the dark.

daddy-zelda

Kudos to Christopho for writing the bulk of the engine and editor. I hope to contribute to the project as well. One of the first things my son and I ran into is that it’s pretty easy to make illegal maps and events that crash the engine at runtime. Most of these could be checked for at design time though. A validation panel that gave warnings about missing references and such would be pretty handy, especially for beginners.

3 thoughts on “Teaching programming with the Solarus Zelda engine

  1. Neovyse

    That’s awesome ! Programming should be taught at school with video games, kids sure would be interested! And it’s an honor for us you use solarus to teach your kid!

    Reply
    1. moscowco Post author

      Yeah, we got quite a bit of mileage out of it. Another friend of mine, a programmer with a several kids used to help his kid too. We’re all homeschoolers looking for good ideas. :)

      Reply
  2. Martin

    Do you know whether the author fixed the problems with illegal maps that you mention? It seems to me that yes, but I’m not sure.

    Reply

Leave a Reply to moscowco Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>