Cataclysm 2

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


Slowly but surely I’ve been plugging away at XP and missions and crap and it’s working pretty OK now.  Right now, there’s only two kinds of missions; “consume something” and “read something” (by genre).  Missions are automatically generated by the game.  Originally I had a missions.dat file with hand-crafted missions; then I realized that’s dumb as heck.  Now the game will, just after loading data, comb through that data to try to figure out good missions it can assign you for a little spare XP.  Here’s a screen shot:

Anonymous asked: I have a few questions about firearms for you. First off, how long will ranges be? Will I be able to climb to the top of a tree (or tower or whatever) and plink the heads off whatever presents itself at 300 yards? Second, will aiming be modeled in? Finally, will there be any major changes to weaponry and combat in general, or will it be somewhat similar to C1/DDA? If I might make a suggestion DF style OPTIONAL aimed attacks would be a fun addition.

Most ranges will be comparable to Cataclysm; that is to say, much shorter than in real life.  This is obviously less realistic, but genuinely makes the game much more fun.  Tactics become a lot more interesting when you need to be relatively close to your target to shoot them.

There is a significant exception, however.  I’m working on “sniping mode,” a special firing mode that will be available to any gun with a scope (many rifles come with scopes, and you can attach a scope to any gun in the game).  When you enter sniping mode, you are taken to the world map and asked to choose a location within a certain range of yourself (anywhere from 100 yards for handguns or shotgun slugs to a mile for rare military-grade bolt action rifles).  Your view then snaps to that map, and you get a normal targeting *.  Unlike normal firing, where time is “paused” while you pick your target, in sniping mode time moves forward as you move your “crosshairs.”  Depending on your skill level, you could move the crosshairs 2-10 tiles for every turn that passes.  When you actually fire, you will enjoy huge accuracy bonuses to offset this passage of time.

So, a scenario; let’s say you’re attacking a military base, and want to soften it up from a range before moving in.  You set up in the woods a quarter-mile away, and enter sniping mode.  No one at the base sees you, so they’re all either standing still or walking slowly, so you can easily line up a shot on a guard and take them out.  After the first shot, everyone starts running for cover, so it’s a bit of a challenge to line up & time a second shot.

Regarding your second question, I’m not sure what you mean by aiming exactly.  I experimented with a system where you could spend a turn just aiming at a target, but not firing on it, and get an accuracy bonus on the turn you do fire.  This turned out to just slow down the pace and not be very much fun.

I don’t think I’ll be using aimed / called attacks in Cataclysm 2.  Again, they mostly just slow down the action, and when you’re facing off against 30 zombies of various types, you have enough stuff to do without making the relatively-trivial decision of where on their body to aim.  It would add a tedious extra step to almost every action, drastically slowing down what would otherwise be an exciting fight.  Optional is fine, but presumably making an aimed attack would provide some kind of advantage (otherwise why include it at all?).  Any scenario where the player has to choose between tedious gameplay versus missing out on an advantage is a red flag of poor design.

One change from C1/DDA is that both ranged and melee attacks will have modes.  Ranged modes include single shot, burst, full-auto, etc., like in C1.  Melee modes will vary from weapon to weapon, but can include things like standard attack, sweep (knock them down), pin, etc; for unarmed combat, modes include standard (punch/kick), grab, disarm, throw, and more.

pikdome asked: Its nice see you back and working on continuing cataclysm, as dda is pretty much a stagnant puddle at this point. Do you feel a little miffed about the cataclysm dda kick-starter thing? You know, I bet that down the line you could start a kick-starter for cataclysm 2. Well, this was probably more comment than question, so heres a question:In cataclysm 2, will there be multiple active z levels? Like, multi-story buildings, climbing onto roofs and falling off of them, fun stuff like that?

I’ll answer your second question (or your “actual question”) first cause it’s easier!  There are already multiple active Z levels in Cataclysm 2 - there has been for months!  They are pretty fun.  You can run into a house and up the stairs, only to have zombies eventually follow you… then you can dive out of the second-story window in desperation.  If there’s a bunch of bandits using a mall as their base, sure, you can assault the main entrance… or you can use a fire escape to climb onto the roof, smash a hole in the glass atrium, throw a few grenades down, then use a rope to slide through yourself.  You can take a fire escape to the top of an apartment building, destroy the stairs so nothing can follow you up, and snipe zombies on the ground until you run out of water and die of thirst up there.  All good stuff!

Now your first question / non-question:

I’m a little miffed about the Kickstarter thing, but probably not for the reasons people think.

First off, let me say: I think that the DDA team has done a lot of really amazing work.  Not just in expanding the game, but in cleaning up stuff too.  I’m flattered that a group of programmers would want to put so much effort into building upon my hobby project and impressed by the quality of their work.  I know that I critique DDA a lot, and may sometimes seem overtly hostile towards it, but that is only because I disagree (sometimes strongly!) with some of their design choices and practices.  I still respect their work quite a bit, even if I wouldn’t have made the same decisions they have.

I found out about the Kickstarter third-hand via twitter, which was a little startling; the DDA devs have my contact info (several forms of it) and it would have been nice to at least get a courtesy notification, if not an outright conversation about the whole idea.  That got things off on the wrong foot, to be sure, but I talked to them about it and gave them my blessing to proceed with the Kickstarter.  I honestly have no real problem with them trying to make money off my game, considering how much work they’ve put into it.  I was a little irked that they were asking for about 25 times the amount I ever made (from donations), but honestly that was more “sour grapes” than anything else and I was able to put those feelings aside as unproductive and unfair.

After the Kickstarter went up, I of course checked it out, and I was very, very concerned about a lot of things, mostly on an ethical level.  I felt like the DDA team was exploiting the community and going against the spirit of open source which allowed them to modify my project in the first place.  A few of my grievances:

  • The Kickstarter focused on sexy-sounding features, most of which would be a lot of fun to code.  Stuff like Z-levels and content.  This stuff is fun to work on, but it wasn’t what DDA needed.  DDA was in much greater need of bug-fixing and refactoring.  Those things aren’t fun, they’re work, so it’d make sense to incentivize them by getting paid to do them.  Instead, the Kickstarter focused on asking for money to do the stuff that’s fun anyway.
  • Z-levels were worrying to me for their own reason.  The Kickstarter was promising Z-levels in three months - alongside a lot of other features!  Z-levels were something I’d thought about for a long time for Cataclysm 1; it never got out of the design phase, because I couldn’t figure out a good way to design it in with the rest of the game.  I was concerned that the DDA devs were promising a huge feature without considering the ramifications.  (Were they able to deliver them in three months?  I stopped following).
  • Other features, especially the stretch goals, also seemed very far-fetched and more like a “wish list” of dream features than a well-planned-out and realistically achievable set of promises.
  • DDA has dozens of contributors.  I was concerned that these contributors were being disenfranchised; they had freely contributed their hard work to the project, and now someone else was getting paid thousands of dollars because of it.  I don’t think that these developers were given the chance to apply to the job of “Kickstarter payee.”
  • I was very concerned about how the money would actually be handled.  When you’re raising money for a free, open-source software project, you have to be very transparent about how and why you’ll be spending that money.  The DDA team was not.  For one thing, they offered me a percentage of the Kickstarter funds.  They never asked or told the backers about this offer.  Backers have a right to know where their money is going, and if DDA was willing to just give me a chunk of it, who knows where the rest went?
  • Perhaps the worst problem of all, the Kickstarter was offering “add your content to the game” as a reward for giving them money.  This is a disturbing abuse of their power as the managers of the project.  What’s great about open source is that it’s a merit-based system.  If you make something good enough, it can be part of the game.  The DDA management team was changing this to “if you give us twenty bucks, then we’ll put whatever in the game.”  This cheats developers - they should be able to work on code or content, and have a chance to see it in the game on its own merit.  This also cheats the players.  Content is showing up in the game they’re playing, not because that content is good, but because the management team got paid twenty bucks.  And if in the future, content needs to be removed or pruned (which needs to happen frequently in any good game!), well, too bad - someone paid good money to have their content in the game, so it must stay.  Basically, the DDA management team was selling out the players and the quality of the game for cash.  This is more or less exactly the opposite of the open source ethos which allowed them to modify my game to start with.
  • Finally, nowhere on the Kickstarter was it mentioned that DDA is a mod of Cataclysm, or that the game was originally (and most of the code still is) mine.  The DDA team even did an interview about the project, and they took credit for my innovations (safe run, mutation tree, the way worms track you & other sounds).  They also took credit for major third-party additions (e.g. Gremour’s amazing vehicles patch).  The Kickstarter, the DDA website, and all other media made it seem like DDA was their project alone and they had come up with all this amazing stuff.  This is unethical and an insult to me, Gremour, and others who made amazing contributions to Cataclysm before DDA.

Sooooo yeah.  I did not have a problem with the Kickstarter in and of itself.  Had it been run better, or had the DDA team addressed my concerns (I contacted them several times and they could not really address these), I would have happily advertised them and donated money myself.

And just so we’re clear: yes, DDA had every legal right to do all this stuff (I think - some of the licensing issues seemed to be uncertain).  But that doesn’t make it ethical to disenfranchise the players, the contributors, and me.  And yes, this happens all the time in small games (and big games!) publishing.  The difference here is that Cataclysm is (or was at the time) my legacy, my child.  And when the people in charge of taking care of it behave like this, it can only reflect poorly on me.

Finally - I will not be making a Kickstarter for Cataclysm 2.  Not even one that avoids all these problems.  Cataclysm (1 & 2) is strictly a hobby for me and I consider it my gift to the world (just threw up in my mouth a little from typing that, sorry).  As previously stated on this Tumblr, I think that games can be art - and that art should not be commercialized all the time.  Cataclysm is an avenue for creative expression for me; I want to keep that pure.  Yes, I have accepted tips via Paypal, but those are more of players saying “thanks for the fun, let me buy you a beer” rather than me saying “here’s how much money I need before I’ll make this for you.”

The one exception is commissioning third-party work; if I ever feel like I want to commission high-quality tiles, for example, I might hold a Kickstarter to raise funds for that.  But if the Cataclysm 2 community is anywhere near as talented and generous as the Cataclysm 1 community was, I won’t need to.

Anonymous asked: Thanks for answering my question about the roadway generation. Does this mean that you use a "buildings first" approach to generating the actual towns within the town's area? Or does it use some kind of "roads first" approach, with the buildings depending on the road placement? I see possible way's of doing each, but I wondered if you came across the same decision, and which one you ended up choosing.

Once again, I’ll talk about Cataclysm 2.  I don’t remember what I did in Cataclysm 1 but I know it sucked!

In Cataclysm 2, a town starts life as a big blob of “put town here” tiles (technically a biome).  My challenge was coming up with a way to turn that into a lot of road tiles and building tiles, with the following basic requirements:

  • All road tiles must be connected (you can reach any road tile from any other road tile by traveling only on road tiles).
  • All buildings must be adjacent to at least one road.
  • Maximize building-to-road ratio (the first two conditions would be satisfied by making the city nothing but roads, but that’s not interesting!)
  • Bonus points: Interesting patterns in roads (e.g. regularly-sized blocks)

This is complicated by the fact that a city might have one or more “chokepoints” and yet we still have to make sure it’s all interconnected.  For instance, in the diagram below A B and C are all city-tiles; since A and C must be connected by road, our algorithm has to ensure that B will be road, not buildings!


The basic algorithm looks like this:

  1. Start with the city’s seed tile (roughly its center).  Add this to the list of “active” tiles.  Set all other tiles as “inactive.”  Tiles may also be “closed” but none are yet.
  2. Pick a random tile from our “active” list.  Set its terrain to road, make it “closed” (removing it from our list), and look at each tile adjacent to it (no diagonals).
  3. If the adjacent tile is “inactive,” make it a building and set it as “active” (adding it to our list).  If the adjacent tile is “active,” make it “closed” (removing it from our list).
  4. If our “active” list is empty, we are done.  Otherwise, return to step 2.
  5. If there are any city tiles left (there shouldn’t be, if they were all contiguous) make them into fields.

To encourage block-like structures, I later added a wrinkle wherein rather than pick a random tile in step 2, we prefer to use tiles that are on a randomly-generated grid first.  Since they’re used first, they’ll become road first and thus our roads will mostly be grid-like, except in weird narrow stretches of city where that doesn’t work.

This algorithm satisfies all the requirements because it’s road-first (or road-and-building concurrent?).  Buildings cannot be placed unless adjacent to a road; really, what we’re doing is placing + shaped patches, where the center tile is a road and the four adjacent tiles are buildings.  This more or less maximizes buildings placed (could be a little better, but not much), ensures all buildings are road-adjacent (since they’re always placed next to a road), and ensures all roads are contiguous (since they’re always placed on top of a building, which is road-adjacent).

I think a buildings-first algorithm would be very hard to develop and still satisfy the basic requirements for what a city should look like.  For one thing, every building placed would have to check it was road-reachable.  It would also have to check that it wasn’t dividing the city into two separate halves; for instance, in my ABC example above, buildings cannot be placed on B, and the algorithm would have to figure that out.  It’s doable, of course (for instance, a flood-fill check would solve both of these hurdles), but would be much more complex than any road-first or concurrent algorithm.

Anonymous asked: Any chance we'll be seeing Cataclysm 2 forums anytime soon?

I’ve got the domain back and will be putting a site up soon.  I suck balls at web stuff, esp. forums.  Maybe if someone helps me…?

Really I just gotta get a thread going on the DF forums again, that’s what launched Cataclysm 1 to the lower echelons of success

My Competency: C2 vs C1

I found a neat programmer competency matrix at .  Basically, it’s a way to evaluate your (or someone else’s) competency within a given domain (generally a single programming language or problem).  I thought I’d compare myself now, as I program Cataclysm 2 (taking a break due to life for the past couple of weeks, but I’ll be back on it soon!) and myself 5-6 years ago, when I was working on early Cataclysm 1.

Each area is ranked 0-3; see the link above for the specific meaning for each area.  I’ll use A => B, where A is 5 years ago and B is now.  Basically, I’m trying to gauge how much I’ve improved; anywhere where my ranking is constant (and isn’t a 3) is something I need to work on more!  The rest, I’ll assume self-improvement follows a linear trend when regarded passively :)  I’m also trying to get a picture of just how much better, from a code perspective, C2 is than C1.  Forgive (or ignore) this self-indulgent post!

Data structures: 1 => 2
Algorithms: 1 => 2
Systems Programming: 1 => 1.5 (some of 2)

Version Control: 0 => 3
Build Automation: 2 => 2
Automated Testing: 0 => 0 (one of these days…)

Problem Decomposition: 2 => 3
Systems Decomposition: 1 => 2
Communication: 3 => 3
Code Organization within a file: 1 => 2
Code Organization across files: 1 => 1.5 (some lapses…)
Source Tree Organization: 0 => 0 (one of these days…)
Code Readability: 0 => 2
Defensive Coding: 0 => 1
Error Handling: 0 => 0 (I know how, I just can’t be bothered :\)
IDE:  N/A  (I use vim + command line!)
API: 1 => 3 (cuss!)
Frameworks: 0 => 2
Requirements: 0 => 2 (insofar as this can be applied; I guess feature requests are a kind of requirement?)
Scripting: 2 => 3
Database: 1 => 3 (Not that I use one in Cata, but at work…)

Languages with Professional Experience: 0 => 2 (Depending on the meaning of “professional”)
Platforms with Professional Experience: 1 => 1
Years of Professional Experience: 0 => 1
Domain Knowledge: 0 => 2

Tool Knowledge: 1 => 3
Languages exposed to: 0 => 3
Codebase Knowledge: N/A
Knowledge of upcoming technologies: 0 => 1
Platform Internals: 0 => 2
Books: 3 => 3 (Books don’t matter very much IMO but they’re fun)
Blogs: 0 => 1 / 3 (Do I get to skip level 2?  I guess not… but this Tumblr is kind of a 3!)

How do you wind up?  If I ever put together a “official” devteam (think git access) I’ll probably use this as a tool…

Anonymous asked: When there will be limited visual in the future? like you only see in front of the you, and any where else will be covered by fogs, unless you turn around direction, and other monster and people will have limited visual too? so the sneaking will be lot easier?

Anonymous asked: First off, thank you for responding to my question regarding updates/stability/modding. I just finished reading over your ideas about skills and books. One route to go is that if a skill is unlearned you can find and read an introductory book that gives you knowledge about the skill. This would then allow you to to go out and start using it at its basic level. Once you gain some experience you could then find the next level book which would give you knowledge of more advanced uses. And so forth.

I’m not sure I understand your idea.  It seems like a re-wording of the skill cap.  You need to read a book to raise your cap, so you can start using experience to increase it… then later you need to find the next level book, so you can train it higher.  That’s the cap system!  Can you flesh the idea out more, if I’m misunderstanding it?

Anonymous asked: What's up. I'm currently trying to create a 3d clone of the original cataclysm game in UE4, because I thought it would be really fun. Can you give a very high-level, big picture explanation of how you generated the roadways? I.E.: did you use an L-system, or use purely noisemaps? I'm trying to come up with a nice algorithm for doing the roadways myself, but I'm having trouble figuring out which system would give me an easier time.

Sounds awesome!  I’m excited to see what you come up with - let me know once you have anything that’s working or at all interesting, and I’ll repost it here (with your permission of course).

When you say “how I generated the roadways” I assume you mean on the world map, not the player scale.  The player scale generation is simple and boring.

On the world map scale, well, the way it was done in Cataclysm 1 is very different from how it was done in Cataclysm 2.  I don’t know what L-systems or noisemaps are, and a quick google makes me pretty confident I didn’t use either one.

In Cataclysm 1, the first step was to generate a list of points that need to be connected by roads.  The center tile of every city are the most obvious one; also included are special locations (labs, hospitals, etc) and a few points on each edge of the world map (so that roads will lead to neighboring world maps).  Once we have that list of points, we iterate over it; for each point, we find the first point that’s close enough to it; or if no points are close enough, whichever is closest.  For example, let’s say we have 4 points in our list.  We start with point 0, and define “close enough” as 50.  The distance to point 1 is 68; the distance point 2 is 43, so we stop there, even though the distance to point 3 is 28.

One issue with this algorithm is that it doesn’t guarantee that all roads will be connected in a network.  But I was okay with that I guess.

To actually build the road between those two points, we start at one of them - call it the origin.  Let’s say our origin is at (10, 10) and our destination is at (20, 20) - so we need to move north and east.

From our current position, we look at all adjacent (diagonals are not allowed) points.  If one of them is already a road, and is closer to our destination, then we’re done. Otherwise, we randomly pick a tile that’s closer to our destination and move there - keeping track of whether we just moved horizontally (east/west) or vertically (north/south).

We then continue.  At each step, we prefer to continue in the same direction - that is, if our last step was horizontal, then our next step should be too.  There are two exceptions to this rule.  First, once we get in-line with our destination on one axis, we ignore the direction rule.  In our example, once we get to an X-value of 20, we’re going to change our Y-value no matter what - since the X-value is correct, we don’t want to change it.  The other exception is random - on every step, there is a 1-in-12 chance that we’ll switch from horizontal to vertical, or vice versa.

Finally, if we ever hit a river, we just continue across it in a straight line until we reach the opposite bank.  This is occasionally problematic; there’s no check for how long that will be, so if we hit the river parallel to its general direction, we could wind up with a very long bridge.

This algorithm is riddled with problems.  It’s not very interesting, it doesn’t handle problems (like getting cornered somehow) very well, it may hit a road and stop without actually connecting to our destination, and we wind up with an unrealistic zig-zag structure, that never doubles back or curves around stuff.

Cataclysm 2 has a much better solution.  It uses A* pathfinding.  If you’re not familiar with it, A* is an algorithm that checks a lot of possible routes, and uses whichever is the shortest.  This means we’re guaranteed to always wind up with a successful, often interesting, path.

To make the path more interesting, each world terrain type has a variable called road_cost.  This variable represents how much we want to avoid building a road on that terrain.  Our A* path multiples each step by the weight.  So a path that’s 10 tiles long, and each tile has a weight of 5, is actually better (total score: 50) than a path that’s 5 tiles long, and each tile has a weight of 12 (total score: 60).  Some examples here are fields - cost 100; beach - cost 110; forest - cost 150; swamp - cost 200; river - cost 500; and road - cost 1.

This produces roads that curve around small forests and swamps, but goes through large forests directly.  Forests often have patches of field inside, little clearings, and that makes roads more interesting as they’ll curve a bit to take advantage of the field.  Our roads will double back and serpentine as they move, all in fairly-realistic way.  The ultra-low road_cost of roads themselves means that when building a road, we’ll use pre-existing roads IF they take us closer to our destination.  And once we get close to our destination, we’ll branch off from the existing road to create a new one.

So all in all, I’d strongly recommend using Cataclysm 2’s A* based algortihm.  Good luck!

New skills plan

So I’m working on fleshing out skills - what skills they are, how they work, how you improve them, and so on.

In Cataclysm 1, we had skills books. You could read a skill book to improve the related skill, up to a limit. A basic book would improve your skill up to level 3; then once you found an advanced book, you could improve it up to 7, etc. You could, of course, also improve the skill by using the skill (provided you had some XP).

This was kinda neat, but grindy (you spent a lot of time hitting “Read mechanics book, Read mechanics book” again and again). It was also a high value (free skills without needing XP!) for near-zero risk or expenditure (you’d get hungry & thirsty while reading but that’s it).

I really want to keep books in Cataclysm 2. It’s good flavor, and provides some incentive for high intelligence. But they clearly need an overhaul. So here’s the plan I’m considering; thoughts/suggestions/well-thought-out criticism is welcome!

In C2, I’m going to divide skills into two types: Applied and Mental (or Theory, or…?)

Applied skills are things like firearms, melee, dodge, etc. You are free to improve these as much as you like by spending XP. To recap a previous post, this is done manually, NOT by using the skill.

Mental skills are things like computers, mechanics, first aid, etc. These are also improved by manually spending XP. However, each one has a cap. The cap starts at 1 + Int/5, so for an Int 10 character, it’s 3; for Int 17, it’s 4. Once your skills level hits the cap, that’s it - no more improving the skill.

The skill cap can be increased in two ways: finding an NPC who will train you, and reading a book. Any NPC whose skill level is higher than yours can train you. They’ll be willing to train you if you’re allied, they owe you a favor, you pay for training, or you coerce them into it. Once you’re trained, your base cap is increased by 1 permanently.

Books change your cap to a certain level, as long as you’re carrying them. This bonus may be improved by Intelligence. There’s still different levels of books. For instance, the book “Mechanics 101” changes your cap to 4 (5 with Int 14 or more). “Advanced Mechanics” changes your cap to 7 (8 with Int 14 or more, 6 with Int 7 or less). “The Art of Engineering” requires Int 12, and changes your cap to 12 (14 with Int 15 or more). There’s not much need for a mechanics skill higher than that, but to improve it further you’ll need to find the rare “Applied Quantum Dynamics” which removes the cap altogether, provided your Intelligence is at least 13.

This is just a rough draft of the idea. I like the idea of the bonus always applying when you’re carrying the book (or it’s nearby). This eliminates grindy/boring reading altogether, and encourages a personal library stash.

However, I’m a little uncertain about how it will play. It basically makes “Mechanics 101” totally useless once you find “Advanced Mechanics.” I might instead make books provide a permanent increase to your cap once you sit down and read them. I will, of course, make reading less tedious; a single “Read Book” action would give you +1 to your cap, so you’d only have to read it a few times.