Using Common Lisp for Game Dev

Tagged as game-dev, lisp, syn

Written on 2020-05-05 19:16:00

Conventional wisdom says if you're making an indie game you almost always want to use an existing engine for your project, like Unity or Godot. Conventional wisdom also says to write your game in a programming language typically used for modern game development.

This is good advice! However, I chose not to follow conventional wisdom and built a custom game engine in Common Lisp. I'm currently using this engine to develop my Indie Game, Syn. My reasons don't apply to most people, but they do hold a general lesson about game dev.

Here's why I did it.

Games are risky

Games hold both the potential of artistic expression and financial success. While not mutually exclusive, art and money often seem at odds. Art sometimes demands the bold, the irrational, the crazy. Bold, irrational, and crazy are not good for the bottom line.

If you get too artsy you might end up with a bad or unworkable game. Go too far in the other direction and you'll end up with a undistinguished, carbon-copy of a more successful game. There's no "safe" option. Even if you do everything right you can still fail.

Meaningful Game Dev

What to do in the face of this depressing reality? Make game dev worth the effort you put into it.

For indie devs (and unpaid artists in general) this means making the process of game dev meaningful. If you don't know what you find meaningful, here are a few questions you can ask yourself.

  • What will developing a game teach you? How to program, write a story, draw pixel art, or produce music?
  • Who will you meet or work with while developing your game?
  • If your game is unsuccessful, will it be worth everything you sacrificed to create it?

Success can't be forced, but we can often pick the risks we take on. Even if your game isn't a hit, you can end your project with skills and experiences that shape the rest of your life. For the artist, creating art is an act of personal transformation. Decide who you'd like to transform into.

A Common Lisp Game Engine

I've been programming computers professionally (and as a hobby) for over a decade. When I began working on Syn I had never done any game dev but I'd always been interested in how games work. I was also drawn to the Common Lisp programming language. Lisp has the allure of being this hyper-advanced programming language used and favored by many talented programmers. I wanted to see what all the hype was about.

Working on Syn has allowed me to combine these two interests into a single project. Of course, the technology is not the reason I'm making Syn, but it is a nice skill set I'm learning along the way. Plus, I find it highly motivating to explore interesting technology while also learning the artistic process around making games.

The Upsides

  • Implementing a game engine gave me precise control over how my game runs and a lot of knowledge into how games actually work.
  • The lisp hype is real. Lisp is by far the most powerful programming language I've ever used.
  • Lisp's dynamic nature allows for a very fast feedback loop while developing. Make a change, compile, and instantly see the change in your game without restarting.
  • Overall this project has made me a much better programmer.

The Downsides

  • Learning one new thing is hard. Learning three new things is about 300x harder (game engines, indie game dev, and a new programming language).
  • While powerful, lisp is not popular (at least for game dev). This means you'll have to implement a lot of things yourself.
  • The learning curve(s) and lack of popularity means the project will probably take at least twice as long compared to a standard technology stack. I've had to redo many engine components several times and at the time of writing this there are still pieces of the engine in need of a major overhaul before the project can be completed.

Closing thoughts

That's my journey so far. Would I recommend it to others? Not specifically, but I highly recommend indie devs think about what they want out of a project. Burnout is an issue everyone faces at some point, and if you don't know why you're working so hard you may give up in the face of adversity.

If what you're working on is worthwhile everything else will fall into place.


Links

If you'd like to know more about Syn or Vert:

The vert game engine: https://github.com/realark/vert

Syn's website: http://recursive.games/syn

Syn on steam: https://store.steampowered.com/app/1198770/Syn/


If you'd like to follow my indie game, Syn, please consider Wishlisting on Steam or Subscribing to Syn's email list.
comments powered by Disqus

Unless otherwise credited all blog material Creative Commons License by Ark