Home

Tiny Project 1: Project Zomboid Mod

23 November 02020

The genesis for this project was the three part Soviet Womble video essay on DayZ, which got me thinking about different kinds of gamemodes that could be created with relativly simple mods. One of those game modes is assassin, based on the live action game of the same name, where everyone is given a target to kill (in real life it is played with nerf guns or sharpies to indicate kills). I've been playing project zomboid recently, and I knew that it was fairly easy to mod, so I decided to go for it. I gave myself a week to do it (inspired by this post that I saw on HN), and it more or less works with just hundred lines of code. I found out towards the end that I was actually not playing on the most recent build, and that more recent and popular build didn't have multiplayer yet, so I would just have to sit on this mod until that happens. It did have local co-op though, which was useful for testing, but not actually playing. So, here are three lessons I learned from it:

Lesson 1: Documentation is always more important than you think

The project zomboid documentation is non-existant and that's a travesty. The most useful things I found were a half-finished user-generated modding guide, and a list of events that the engine listens for. Other than that I pretty much had to search through code for useful functions to use in my mod. Becuase of their poor documentation, the devs probably missed out on at least one top tier mod, the kind that people buy your game to play. The lesson here is that if anyone else will ever or modify see your code, write documentation even if it's bare-bones. It's not just a good thing to do for them, but it's also a good thing to do for yourself since you will also benefit.

Lesson 2: Sometimes you can start to build things before their pre-requisites exist

I have a large list of ideas that I decided not to pursue becuase their pre-requisites weren't in place. For example, a pre-requisite to asteroid mining is cheap and reliable spaceflight, and probably a way to refuel in space. If I had known from the beginning that multiplayer didn't work in the newest project zomboid build, I wouldn't have pursued this idea. The reality is that you can build and validate things before the project becomes really feasible, and in the time your doing that those pre-requisites start to catch up. Additionally your project may still be useful before those pre-requities are in place, which will help you get some traction in your push to build the full thing.

Lesson 3: Work arounds are good in the beginning

Rather than build my own events to listen for, I just used items that players can click to start the game or locate their targets. Items are really easy to add into the game, and building events are very hard. When you have to finish the project soon, you have to use every work around you have. That calculus may change as project mature though. In the beginning you never know if the project will fall on its face or actually be useful to people, so it's not worth it to spend a ton of time doing things the right way if the right way takes a lot of effort. As with all lessons, this may not be true in all instances, since some work arounds are easier to fix than others.

If you want to check out the mod it's available on the steam workshop.