I’m plugging away steadily, working on new features. Mostly a lot of bugfixes, or minor features, or enhancements to map files and stuff. Not too exciting, but important!
There are a couple slightly-exciting enhancements to monsters, one finished and one in progress: sounds and abilities.
Sounds are, well, the sounds that a monster makes. They come in two flavors - idle and attacking. All monster types (and monster genera) have a idle_sound_chance and an attack_sound_chance. Using the ever-popular zombies as an example, their idle_sound_chance is 60, meaning that they have a 1-in-60 chance to make a sound each turn. That may not seem like a lot, but if there’s 25 zombies in play, there’ll be a lot of sounds happening.
They also have a list of possible sounds; like everything else in Cataclysm 2, this is a weighted list. For zombies, their idle sound list is “w:10 moan / w:1 gurgle”. This means that, when idle, they will either moan or gurgle; moans will happen 10 times as often. Similarly, their attack sounds are “w:10 snarl / w:3 grunt”. Their attack_sound_chance is 15 - zombies get a lot noisier when they’re chasing something!
Finally, we have a single volume for idle and attack sounds. Zombies’ idle volume is 8; their attack volume is 14. This means they’ll attract a lot more attention when attacking. I considered given each individual sound its own volume, but for consistency and simplicity there’s a single volume for each category.
The idea behind the sound system is to provide a bit of immersion, and give the player non-visual clues about what’s nearby (you might hear moans behind a door - don’t go in! Or if you hear snarls and barks, there’s probably a zombie fighting a dog in there… so wait until one wins, then finish off the survivor). Additionally, loud attack sounds will draw the attention of other nearby monsters. Imagine you’re being chased by a zombie. Its snarls attract the attention of four more zombies - now you’re really in trouble! But then, the combined sound of all four of them alerts a pack of wolves to their presence, who scurry in and take our your pursuers. Pretty awesome.
The other feature, in progress, is monster abilities. Now, monsters already have ranged attacks, which does a lot for us. It allows spitter zombies to throw a pool of acid at your feet, smoke zombies to block your vision with thick smoke, and spiked frogs to give you a stabbing with their tongue. However, I have a bunch of ideas for other things I want monsters to do:
- Be surrounded by an aura of intense heat, which damages the player and may set fire to terrain
- Randomly teleport a few squares every few turns
- Spawn lesser monsters to aid them (think of a large robot sending out small eyebots to track you down, or a slime creature that loses part of its body to create smaller slimes)
- Alter the terrain around them (like the much-maligned Queen Triffid from C1, which caused trees to grow around it
And so on. In Cataclysm 1, stuff like this was done quickly and easily - in code. Every monster with a special ability had bespoke code written for it. This was quick and easy for me, but hard for others to contribute new monsters with abilities (near impossible if they couldn’t code). It also led to a lot of reusing of code - bad practice in software.
One of Cataclysm 2’s main features is being as data-driven as possible, and I want to stick to that here. Sadly, short of adding Lua bindings (which I still might do one day!) there’s really no way around writing code for each monster ability.
But I can abstract it a bit. This means just writing a single generic “spawn monster” function - and making it flexible. I write that once, and then in data you can have:
for a robot that can launch up to 3 eyebots, up to 4 tiles away from it. The eyebots will be programmed to search out the player.
Verb: splits to form
for a slime beast that can “split to form a blob.” The blobs will appear adjacent to their parent, and will attack the player (or other enemies). There is no limit to how many blobs can form, but the parent monster will lose 10 HP each time they create one.
Other abilities, of course, can be just as configurable. If you want to add an entirely new ability, it’ll require code, yes; but hopefully I’ll provide a good enough variety (I’m thinking 8 - 10 distinct abilities) that most monster designers will already have what they need.