This week has been dominated by catching up on odds and ends, as well as implementing some features from the backlog. I keep hoping that one more person will star the project on GitHub, just so I can have 42 stars. I’d happily keep it at Life, the Universe and Everything!

  • Finished up breaking out a bunch of items into their own compilation units, improving both compilation speed and debuggability.
  • Moved some globals to not be global anymore, requiring that they are accessed through well-defined functions (that include asserts for debugging). This helped me find a long-standing bug that was driving me nuts, which could result in an area being made of “undefined material”.
  • Fixed a really funky bug with the “emergency teleport” feature. If a settler finds themselves completely stuck (which is in and of itself a bug), Cordex teleports them to bed. Due to a logic error, Cordex was teleporting them to every bed in the game, in turn – even ones inside enemy fortificiations.
  • Fixed an out-of-bounds error with the noise library I’m using. For some reason, just occasionally it was giving a value outside of the range of -1.0 to 1.0. This resulted in a bizarre spike in the middle of nowhere. Rather than try to write a creative reason for it being there, I fixed the issue.
  • Added a GM command interface, “make a wish” (I like that in CoQ, so I borrowed it). This was the first time I’ve tackled text entry in the game, so I built a system for that first. You can now hit ctrl-W, and wish for “sploosh” to cover the world in a test layer of water.
  • Implemented doors. You could build them before, but they didn’t do anything. I actually implemented it twice, because my first implementation was awful. Now, when a door is present (either because you built it, or it spawned as part of the map), you can click on it and select “Lock door” from the pop-up menu (or “unlock door”, if it is locked). The path-finding routines then update walkability to prevent anyone from using a locked door. I also implemented the concept of ownership; if a door belongs to another civilization, you can’t lock it (and keep everyone trapped inside). I put in some notes for the next stage, which is to make doors pickable/breakable.
  • Fixed an entertaining bug with path-finding that was making settlers pick the least optimal route (that still arrived, and didn’t double-back on itself) for some tasks. It was actually pretty impressive how sub-optimal A* can get if that’s what it thinks it is optimizing for. It was also pretty amazing how much memory it could consume doing so. Fixing it sped things up a LOT, as well as getting rid of the “what the heck are they doing???” feeling while watching your settlers wander aimlessly and somehow still reach their destination.
  • Did some work on settler histories. It’s long been a goal that a settler is more than an @ with stats; I’d like to expose as many storytelling opportunities as possible (and start working with the extra data to find interesting connections). So now, life_events.lua defines a long list of possible life events. These are gated by age, can have requirements (e.g. you don’t get adopted without foster care first, or don’t get promoted in the Eden Guard without having joined it), and can prevent other events from ocurring. They can also give attribute and skill bonuses. There’s a lot of room for hooks into other data systems here, which I hope to exploit as we move forward. For example, if little Jenny became a cult leader – who is the cult? Who else was in it? Is she still secretly plotting? Right now, the answer is no – but I’d like to change that eventually.
  • Imported sqlite as a dependency. I’m planning on using it to help with the vast amounts of data that are coming out of the history system, much of which is naturally related and is a good fit for SQL. It should let me build a lovely encyclopedia (with Don't Panic on the front) that lets you browse all of the data in-game and get a better feel for what’s going on.
  • Started turning the code that reads Lua tables into something less ugly and error prone. There’s a lot of repeated lua_gettable, lua_pop etc. calls that are doing the same thing for different tables. Replacing it with a much cleaner interface that only does the Lua part once.

I didn’t bother with a screenshot of doors, since they are pretty self-explanatory. However, here’s a randomly generated settler from a test world made a few minutes ago:

Abraham Varner, Travel Agent

  • He is male, 28 years old, 6’6″ tall and weighs 129 lbs.
  • He is very strong. He’s healthy, and quite average in terms of dexterity, charisma, comeliness and ethics. He’s also stupid, and very gullible.
  • He is of asian descent, with long brown hair.
  • He made planetfall dressed in cargo pants, a formal shirt, leather shoes, and clutching his trusty ray pistol.
  • He has a little skill in acrobatics (1), some in negotiation (2), is good with ranged weapons (5) and stealth (5), and excels at punching things (7). He’s also quite literate (10 – literacy uses a different scale; 10-12 is average).
  • He had an unremarkable birth and infancy, other than being dropped on his head in 2499. He went to school, won a sporting event, and joined up with the Eden Guard cadet program. When school ended, he joined a cult for three years. Apparently, that didn’t work out – because he joined up with the Eden Guard as a grunt. They sent him off for more education, and in 2519 he became a squad leader. He managed to hold that down for two whole years, before being demoted back to grunt. In 2524, he was selected to embark upon the ‘B’ ark, and in 2525 he has crash-landed on our planet.

That’s a pretty decent start, in my opinion. There’s definitely potential for future data-mining/correlations, but for now it rounds him out a bit.

RLTK – The Modern C++ Roguelike RToolkit Github**

I did a fair amount of back-end work this week, mostly in response to a user request. I’m thrilled that someone is using RLTK, so I was happy to oblige!

  • Fixed a number of compiler warnings about signed vs. unsigned integers. They weren’t doing any harm, but it makes more sense to use a size_t when the data is, in fact, a size_t.
  • Added support for full-screen mode. I generally don’t play games fullscreen (I tend to have lots of windows going at once), so I’d somehow missed this feature. It’s implemented and works pretty well. I was actually surprised to discover that it seems a little bit faster on Black Future.