Cataclysm 2

A development blog for Cataclysm 2, the sequel to the popular post-apocalyptic roguelike.

A note on Triffid Queens

This post is as much a reminder for myself as it is news for you guys!

In Cataclysm 1, there was an enemy called the Triffid Queen.  This “miniboss” was the toughest type of triffid (a type of mobile plant), aside from the real boss of the triffids, which was a building-sized enemy.

The Triffid Queen had a unique special attack.  It would periodically cause plants to grow around it; walls would come crashing down, pavement would be obliterated, and underbrush and small trees would crop up in the surrounding area, potentially piercing the body of the player as they grew.

This effect was, potentially, very interesting.  Rather than being yet another direct damaging attack on the player, it had the power to change the tactical situation drastically, as that wall between you and a swarm of triffids suddenly tumbled down, or your escape route was blocked by a tangle of vines and trees.  It was also a great moment of panic when the player, in the middle of patching up their armor or crafting a new weapon, suddenly had a grove burst down a corner of their safehouse.

Unfortunately, the effect was also very obnoxious.  After the Queen was slayed, the trees would remain, potentially trapping the character where they stood, unless they had a machete or axe handy.  Then it was a slow road to starvation - a very boring death, in a game full of hilarious deaths.

I want the Triffid Queen, or at least something like it, to make a return in Cataclysm 2.  I really think that the tactical implications can turn yet another straightforward fight into something that forces the player to adapt and think on their toes.  But I also want there to be minimal long-lasting effects.  I also want to remove the “cheated” feeling of suffering a totally unavoidable death due to a tree suddenly splitting you up the middle.

To that effect, there will be a few changes.  The most simple one is to nerf the Queen’s attack a bit.  The amount of terrain it can change will be limited, and walls and other sturdy constructions will not come down quite as easily.  Cataclysm 2 gives HP to all terrain, so this will be as simple as reducing the target terrain’s HP by some amount, rather than destroying it outright.  Additionally, the Queen won’t be able to grow a tree directly underneath the player or any other entities.  Underbrush and entangling roots, sure; but the sudden tree attack is gone.

A more complex change involves adding a new low-level feature.  I want the Queen’s terrain changes to be temporary; her trees grow rapidly, but to balance that, they also die off rapidly.  To implement this, I’m going to add a feature to map tiles that says, “In X turns, change to terrain T.”

So when the Queen creates a tree, we change that floor tile to a tree; but we also tell the tile, “In 10 turns, change to a mound of dirt.”  This way, yes, there’s 10 turns of having to deal with a tree in your way, but after that the tree will fade away.  Maybe I’ll even have it leave a few units of wood, as a bonus for crafty players.

The only downside here is that we won’t see evidence of a Triffid Queen fight any more.  It was a neat moment in Cataclysm 1 to be walking along, and suddenly come across a bizarre copse of trees growing out of the middle of a house.  it could even tell a story; you might see a trail of trees leading from one house to the next, where it becomes thicker and gnarlier… and in the center of the dense grove, a dead body (and a bunch of free gear!).

Instead, we’ll get a path of slightly-more-generic destruction; any pavement, floors, or walls that the trees burst through will be left as a mound of dirt.  Yes, it’s still annoying to have part of your safehouse turned into rubble, but in Cataclysm, safehouses are never permanent; something always comes along and wreaks havoc.  Time to rebuild…

New monster features

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:

Ability: spawn

Type: eyebot

Verb: launches

Range: 4

Maximum: 3

Child_behavior: search

Done

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.

Or:

Ability: spawn

Type: blob

Verb: splits to form

Range: 1

HP_Cost: 10

Child_behavior: attack

Done

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.

vipches asked: Also about building,we all know the public places building is definitely have a air duct inside,to prevent the air pollution, and I think that definitely work on game,and definitely reality,or whale,You could just blow off the wall,so the wind to send those smoke and gas out the building,Whale,I know you a busy man, but we both want make the game more Interesting,more fun to catch,I really can't stand will those smoke blocking my sight will enemy close to me,or mabye some goggles can help too?

I can tell you hate smoke… but I’m afraid you’re just going to have to live with it!  Smoke is a deliberately-included challenge, and it really breaks the game up a bit to have your vision blocked so you can only see nearby enemies.  There’s even a smoke zombie, who will fill the area with smoke!

There are options… like heat-vision goggles which let you ignore smoke (at least for warm-blooded enemies… won’t work on lizards!).  And yes, you can blow a hole in the wall or ceiling and the smoke will eventually escape.  But that might not be the best strategy - explosives are expensive, and will draw attention!

Mostly, you’re just going to have to learn to deal with smoke sometimes.  You can also use smoke to your advantage.  If there’s four guys with rifles, and all you have is a shotgun, you’ll be shot before you can reach them!  But if you throw a smoke bomb or two, you can hide in the smoke until you get close enough to shoot them.

vipches asked: many month ago, we have discuss about some idea against smoke and gas, I rembaer I make a idea about vacuum cleaner, but, I make other idea, mabye violence but definitely work, I am start think about physics stystem in the game, If you seen a poison gas in the cave, why not just blow up the the top of the cave to create a hole let the posion gas drain out from the hole so you wont worry any more about gas, and also crush enemy below, a win-win situation don't you think?

Yes, in the current game it will absolutely work to blow a hole in the ceiling to let gases of any kind escape.  It won’t make rubble fall and crush anyone - yet.

I’m also hoping to eventually include a support simulator - so that if you destroy too much of one floor, the ceiling above will fall down and crush anyone inside.

Anonymous asked: So, what awesome roguelike game you like to play? whale? I do like wait cataclysm 2 to release, but It really hard to waiting, So can you Recommend me some good roguelike game you like to play? I do like play some game like cataclysm, especially the game are not fantasy, I'm really sick about dungeon, I don't want go down forever.

Well, I’ve got some bad news for you, because the only roguelike I really play these days is Dungeon Crawl Stone Soup, a fantasy roguelike about going down in a dungeon.  But it’s got a lot of other neat sidequests, like exploring islands (with working tides that make the islands shrink and grow!), swamps, volcanoes, elvish castles, wizards’ laboratories, the infinite and ever-changing horrific Abyss, and four radically different Hells.  Among much more.  It also happens to be the pinnacle of roguelike gameplay, and a big inspiration for me.

Aside from that, I’m limited to playing games that will run on my crappy laptop.  The other stuff I play is Nuclear Throne, Wesnoth, FreeCol, and I’ve been getting back into the classic Alpha Centauri too.

Anonymous asked: As a software developer who'd like to program some games for fun but usually never finishes them: What do you mean by "This time, I’m arranging the code, and my life, in ways that are conducive to its longevity"?

Good question!  I guess this means different things for different people, but here’s some stuff that works for me.

Making the game data-driven definitely helps.  Putting data in source makes it obtuse, hard to read, hard to find stuff, difficult for others (both non-coders and coders alike!) to help you, etc.

From Cataclysm 1, Edigotia, and other projects, I’ve recognized some data structure patterns that really work for me, and make it easy for me to add new stuff.  See https://github.com/Whales/Cataclysm2/blob/master/datapool.h for instance.

I’m a better programmer now, and am more readily using things like templates, inheritance, and abstraction to make stuff easier to interface with and expand.

As for arranging my life… for one thing, I’m not as depressed these days!  that always helps.

For another… I’m spending less time programming.  For Cataclysm 1, I would spend the vast majority of my free time programming, which partially explains why it progressed so quickly.  For C2, I’m balancing programming with other parts of my life, and it really helps me keep from being burned out.  I also program a lot better when I’m not constantly immersed in the code - stepping away from it for a day or two helps me bring a fresh look on the code when I return, and that’s really helpful.  I’m also allowing myself to work on other projects from time to time, or just take a 2-6 week break from programming altogether when I need it.

I’m also not planning on participating in any Cataclysm forums, at least not to the extent that I did before.  Cataclysm 1 got to the point where I was spending two to three times as much time talking on the forums as I was programming.  And talking/arguing on forums contributes to burn-out at least as fast as programming does.  If/when there are Cataclysm 2 forums, I’ll still read them, and post occasionally (update & news posts, of course, but also asking and answering questions).  But I won’t be the forum’s top poster, or even in the top 10.

vipches asked: Is true that you plan to make morale stystem back? what will be change this time?

Yes - see my recent posts about XP.

vipches asked: Whale, about traps... mabye you will consider to make those stuff more disguised? I mean, the trap I found, is isn't that much hard to find, and very easily to get pass and spotted, so, You may make those trap are more hard to find and more meaning to set up, also I was thinking something new trap in my mind, such like laser trip mine, or turret toggle laser trap, something like that, or if you want, Also make some mutation trap, such like toxic plant, vine or something, what you say? whale?

Yeah, traps will work somewhat differently.

In Cataclysm 1, spotting a trap was basically a switch.  If your Perception was 10 or more, you could see landmines.  If not, you couldn’t see landmines and would step on them a lot.  The game didn’t track whether you’d spotted a particular trap or not; if you had enough Per, they’d be drawn, otherwise not.

For Cataclysm 2, traps are going to track if they’ve been spotted (possibly even who they’ve been spotted by, if we want to support C1’s asynchronous MMO feature - more on that later).  Every turn, you’ll attempt to spot nearby traps.  The chance to spot a trap will depend on how close the trap is, your Perception, your Traps skill, and maybe other effects.  Once you spot a trap, it will be flagged as “spotted” forever and will always be drawn.

Anyway, I like the mutation trap idea!  There will definitely be new traps of traps, both mundane and exotic.  I’m also hoping to implement an idea I had for C1, but never implemented - given players the ability to design traps, to a degree.  My plan for C1 was to include a “tripwire” trap which, if trigged would set off all adjacent activatable/fireable items.  So, you could put a grenade next to a tripwire trap, and the tripwire would trigger the grenade.  Or an EMP grenade, flashbang, or teargas canister.  Or a shotgun.  Or a radio, flashlight, goo canister, inactive robot…. on and on.  Basically, the player’s creativity is the limit.

Anonymous asked: One of the things I hated in C1 and DDA was its' lack of NPC survivors and thus, shops and houses full of essential stuff with nobody trying to take it. No NPCs mean you can loot an ant hive and be set up for life. What I'm wondering is -since there are going to be NPC survivors- will we still be able to loot these low-risk high-reward areas with no fear of encountering people like us, or will those places usually be found already looted, or under the control of an NPC faction?

Yeah, I agree.  If you play C2 as it is right now, you’ll find that looting has much fewer rewards.  Most locations come pre-looted, so you’ll be hard pressed to find items of value in most buildings.  I’m thinking about making a few exceptions - maybe gun stores will always contain at least one unit of ammo, so they’re they’re not a complete bust most of the time.

And yeah, you’ll always be at risk of running into NPCs competing with you for loot, or even NPCs who won’t think twice before trying to take you out.  Looting is still a viable way to collect resources, but not nearly as much as it was in C1/DDA.  Fortunately, with NPCs to trade with there’s also a new method of acquiring equipment.

Anonymous asked: Ask for the quest system... I feel that as time goes on, the arbitrary quests would begin to impede replay value. If I make a new character, for instance, my play will be forced by quests. I can't be a cool warrior, or a stealthy theif; I have to go find an apple. I can't build this safe house, I have to quickly go acquire some pipes or something for EXP. In short, I think it's best to integrate EXP with natural gameplay, for both replay value and fun.

You make a good point!  When designing quests, I’ll have to be careful to make sure that they’re hopefully things you’ll be doing anyway; or at least tangential to what you’re doing anyway.  I figure that the player will be doing a lot of looting, so asking them to do a little bit of looting specifically for the sake of XP isn’t asking too much.

You don’t always need to prioritize XP, either.  Cataclysm is a game where character progress is as much measured by your inventory and accomplishments (like building that safe house), as it is by XP.  It’s okay to ignore XP for a while to build your home base.  If you gained XP by killing monsters, you’d be skipping XP gain while building anyway!