Nuked cities

So, here’s an idea.

Make nuked cities. These cities must be pretty large to be nuked. So, when we got required city, we nuke it.
Features of nuked cities:
0. The most nearest city to player’s spawn point isn’t nuked at all. If there’s few of them then there must be one city that wasn’t nuked.

  1. They have epicenter of the explosion. It the most important part. Epicenter should be located mostly near to the center of city.

  2. Explosion have some radius of destruction, but sound wave should break glass items far more further. Speaking of that i should say that nuked city must have all windows (as terrain element, as vehicle part - no matter) broken. Moreover - sound wave should break glass objects even beyond the city, so, even if a survivor don’t know where’s nuked city they can notice that by broken windows in vehicles. And, a little bonus, everyone who could hear now can’t.

  3. Most of buildings are damaged by the explosion. Than more nearer to the epicenter, than more damaged. I assume that should occur on creating-world stage after placing items.
    So, some numbers:
    ~10% of destruction radius is full destruction zone. Bulidings in that zone fully destroyed, vehicles fully smashed, and the most powerful radiation. ~20% of this zone is craters. No one is alive here.
    ~40% of destruction radius is 3rd degree burns zone. Buildings in that zone almost always destroyed, but some of them may withstand, but they have their furtinute smashed and thrown in random place. There’s also a lot of fires started. Vehicles mostly smashed, but some of them had withstanded shockwave and been thrown in random place. Some very heavy damaged zombies may appear. Still strong radiation, but weaker than in full destruction zone.
    ~70% of destruction radius is 2rd degree burns zone. Bulidings in that zone often damaged, but partially. Vehicles mostly aren’t even smashed. Decreased spawn rate of zombies, some of them moderately damaged. Weak radiation.
    ~100% of destruction radius is shockwave affection zone. Nothing is destroyed, but items and furniture displaced a little.

  4. Items are damaged too, in same pattern as buildings.

  5. In any case here’s decreased spawn rate, but monsters are far more bizarre, thanks for radiation.

So, an algorithm of “nuking”:
0. Generate a map completely. Nuking is the last thing before adding our man.
According to source code:

[code] //Reset character pickup rules
vAutoPickupRules[2].clear();
//Put some NPCs in there!
create_starting_npcs();
//Load NPCs. Set nearby npcs to active.
load_npcs();
//spawn the monsters
m.spawn_monsters(); // Static monsters

//Create mutation_category_level
u.set_highest_cat_level();
//Calc mutation drench protection stats
u.drench_mut_calc();

MAPBUFFER.set_dirty();
[/code]
Nuking function must be called after spawn_monsters.

  1. Find generated cities
  2. Find their centers
  3. Check for all cities: if their size > 8 and one_in((int)(80 / std::min(std::max(size, 8), 16)) then we found our victim.
  4. Now, randomly choose epicenters from city centers
  5. Define nuke’s strengths, it’s rng(6, 16).
  6. Now, find which map tiles are affected by explosion.
  7. Now, the most important part. For V of all those map-tiles do
    9.1. Find distance (by sqrt( (x1-x0)^2 + (y1-y0)^2 ) ) from epicenter to our map-tile.
    9.2. Power of shockwave formula: std::max(1000 / distance + rng(0, 1000 / (radius - std::max(distance-1, 2))) * (rng(0, 100) > 50 ? -1 : 1), 0)
    Explanation
    std::max(formula, 0) - bound check
    1000 / distance - than further, than weaker
    rng(0, new_formula) - randomness to power of shockwave
    1000 / (radius - std::max(distance-1, 2)) - Depending from distance from epicenter, randomness range maybe from -500 to 500, than nearer to epicenter, than lesser (?) difference
    (rng (0, 100) > 50 ? -1 : 1) - with 49% chance shockwave maybe weaker, otherwise stronger.

radius - radius of explosion
distance - distance from epicenter to map-tile.

9.3. Radiation falls by square-pattern from 50000 to almost zero:
50000 / 2^distance
According to wikipedia, powerful nuclear explosions leave lesser radiation than weaker ones.
By our formula minimum difference between the most weakest and the most strongest explosion is…
781,25 - ~0,77 = 780,48 bar.

9.4. Now, we apply force to local region
We need to mix map::bash and map::destroy into map::nuke_shockwave(int x, int y, int power).
Power, that need to destroy:
a wooden wall: 100
a concrete wall: 300
a palisade: 60
a floor: 150 (because floor should get lesser power)
So, the function is : (rng(power * .75, power) >= health_of_terrain ? map::destroy(x, y, false) : nil)
If a thing is destructable, then use map::bash instead. If that’s a thing that can be moved and it wasn’t destroyed at first time, then select a random tile and move it there with chance of rng(0, 150) < power.

9.5. Damage every item according to it’s volume, material and weight. Than more volume - than more power is applied, than stronger material - than lesser damage, than higher weight - than more damage.

  1. If (ACTIVE_WORLD_OPTIONS[“STATIC_SPAWN”]) then
    10.1. Damage monster with DT_HEAT with force, that depends from distance to epicenter.
    10.2. If monster is still alive, then damage every monster with DT_BASH for power-force according to it’s volume and weight (i mean corpse, of course)
    10.3. If monster is still alive after bashing, then, depending from radiation value, mutate him into something dangerous.
    else
    10.-1. apply local spawn rate decreasing zone. It’s something new, yep. Than higher radiation - than higher divider of chosen spawn rate.
    10.-2. Change spawn point monster into something new.

End.

It can be very hard to code, but imagine - that’s NEW TYPE of cities with MORE DANGEROUS zombies. Radiation, damaged building, fires - it’s all can be very changelling. After all that’s something new.

Like it, love it, want it. I hope that I can make it so every town is nuked.

Most immediate question is why they’d nuke the towns. They already bombed and/or nuked out-of-control Labs and portals in the first 5 days (Cata->game start), so I imagine you’d need a truly large amount of zeds to justify dropping even more nukes.

The reason they didn’t just nuke every portal is that high energy explosions collapsed some portals, and stabilized others. So indiscriminate nuking only wrecks New England further, via the actual bomb damage if not the radiation and potential to further let the Nether in.

And no, they didn’t work out exactly how to tell what portals to and which not to nuke.

Might make for a decent worldgen option though.

Oh, and yes, i forgot to write: it should be turnable on and off. In ideal case it should be possible to set explosions’ force and minimum cities’ size to be nuked.

Great idea, and I’d love to see this implemented. I don’t think it needs to be optional at all, you could just avoid any cities which were nuked and we’re always in need of larger game play effects (this is, unless you wanted an option to nuke ALL the cities).

As far as the lore goes, I think it’d be interesting to leave it open to being a bit of a mystery. WHY did they nuke this town!? Portal? massive amounts of zombies? something else!?

maybe if, just for kicks, it wasn’t just some big ol’ nuke, but maybe some weird nuclear zombie thing? Maybe a shocker zombie that kinda adapted/amplified some sort of experimental nuclear CBM? Just some ideas, keep reading.

I think this is really cool, but at the end of the day you’re probably just going to avoid those cities at all costs, making your travels further, wider, and all around more annoying, especially when you end up going straight from one nuked town to the next nuked town. Maybe if the town was just better in some way that gave it better loot in the houses, or some weird explanation for the explosion which leaves a lot of good loot at the centre maybe? Or maybe the radiation from it is rigged to give you more good traits than bad, or a certain category of traits thingy (lizard, bird, beast, those things). Basically, there needs to be a reward or at least reason to deal with the kinds of problems you get with having most of the town simply destroyed.

But yeah, this is really cool, nice work!

Maybe the radiation creates super mutants, which when butchered gives you awesome mutant flesh that you can use in a recipe for mutagen that gets positive bonuses for being in radiation. Also the super mutants are more likely to carry the super sledge, for maximum bashing power.

MOAR MONSTERS YES

I agree this would be cool and a sure fire way to get some mutations of your own, I’d like to see it like fallout with some muties i can shoot.

Radioactive sludge monsters :P, Chug those iodine tablets leik a boss

Someone work on this. (?

No. The drawing board is the daydreaming board, but only 5% of dreams come true.

You’ve just pushed me into cruel reality ( However, I hope that someone would do it, nuked, burned down cities are so… Cataclysmic…