This post first appeared on Reddit, in the /r/roguelikedev sub-reddit. You may find the original post here.
As usual, my github is located at https://github.com/thebracket/bgame. The game is open source, so use anything that looks useful to you!
It’s been an incredibly productive week in BF land, despite the release of a new version of Dwarf Fortress sucking up a lot of time. The frigid weather has made it harder for my day-job to be super busy, so I’ve had extra time to huddle-up over a vim window. 🙂
The landscape was pretty barren without trees, and the jobs system was ready for raw-materials, so it was time to add some. I’ve only done graphics for pine (I’ll put more tree types in when I next revisit worldgen), so forests are more uniform than I would like. Still, adding in hundreds of trees worked pretty well (thousands required a few optimizations!), and it was easy to allow oversized tiles on the graphical renderer.
Once trees were working, it was time to do something useful with them! I enabled a “chop” order, requiring an axe and a tree. When ordered to chop down a tree, the settler who accepts the task runs to the nearest axe, picks it up, and runs to the tree. The tree is chopped down, and replaced with a random number of wood logs. I was ridiculously excited when that worked!
I then created reactions. A reaction requires a structure in which to operate, and takes components in (including power, optionally) and emits items. For example, “saw wooden logs” takes place at a saw-mill, takes logs in, and emits planks. “Replicate saw blade” takes carbon replicator fuel in, consumes power, and emits a saw blade. I went with a generic system in which reactions are defined in text “raw” files, and it has been really easy to add new reactions to the game (This is very similar to how Dwarf Fortress does it).
For example, on starting you probably want to put up some tents (to avoid the settlers’ complaints), and cut down a tree. You can then take logs to the replicator to convert them into replicator fuel (being careful not to run out of power! The solar panels only generate electricity during the day – so you have to be careful). You could then use the replicator again, converting the new fuel into a saw blade. That blade, combined with a wooden log, can be used to build a saw-mill. The saw-mill can then be used to cut up wooden logs (you’ll want to keep cutting down trees!), and create planks. Right now, those planks can be used to build lovely hardwood floors, and wooden pallisades.
I already had a pop-up for “emotes” – short things the settlers say or do. For example, “Work Complete!” upon finishing a task, “I have no idea what I’m doing!” when they fail a skill roll (there’s actually a range of complaints for that), or “Eats NutraGunk” at the food dispenser. It just didn’t look right as an indicator that a settler was asleep, so I put in a simple particle system. Sleeping settlers now emit Zs that float upwards and shrink away to nothing. I really liked the effect, so the raws system was extended to allow buildings to emit particles (of a specified color and glyph) – and voila, campfires have smoke. I really like it!
There is still no way to die/fail, but the building blocks are there: running out of power, and now taking damage (if all your settlers die, you lose). I added in a “fumble” effect (natural 1 on a d20) for construction/lumberjack work – the settler takes some damage (generally not enough to kill anyone). And, since being damaged with no remediation sucks, I added in a constitution check every 30-minutes (game time; quite quick when running in real-time mode) to get a hit-point back. I used the particle system to float red damage numbers up, and green healing numbers upwards.
I decided to experiment with some different looks. I rather liked a brushed-metal, retro-LCD look for the header – so for now, I’m going with it. I also didn’t really like the large red/green power bar – it just never looked right to me. I replaced it with Cordex’s “eye” – which changes color based upon how much power you have. As the eye dims, you know you’re in trouble! I may have to change it a bit, currently it looks a little bit too much like the HAL 9000 from Arthur C. Clarke’s 2001.