Rain should wash away blood stains outside.

Started by Sion, April 03, 2014, 01:17:14 PM

Previous topic - Next topic

Sion

I think rain should slowly clear bloodstains off the map, because when you are approaching day 100+ it looks like a slaughterhouse wherever the fighting happens, and it really isn't practical to Home Zone the entire map just to clean it.
So many ideas... so little time...
Silence is the worst answer.

porcupine

Quote from: Sion on April 03, 2014, 01:17:14 PM
I think rain should slowly clear bloodstains off the map, because when you are approaching day 100+ it looks like a slaughterhouse wherever the fighting happens, and it really isn't practical to Home Zone the entire map just to clean it.

I was just thinking something similar last night.

Not a guaranteed wipe, but maybe a % chance.  Since the game tracks how long objects have been around (does it do it with blood stains as well?), the % chance could get lower the longer blood has been dried.

Having said that, it wouldn't hurt if fresh blood was easier to clean then set in blood (for colonists as well), blood you wipe up right away should come up easier then stuff that's been crusted on a year.  Maybe surfaces having a cleaning difficulty/time modifier (if they don't already?), as same goes for metal tiles vs carpet vs rock floor, etc.

StorymasterQ

(grumbling) "Frakking squirrel frakking dying on frakking blue carpet... Why do I have to clean this stuff?"

I think it'd be easier to rip out the carpet and lay down a new one than to clean it. Have you ever tried cleaning blood off of carpet? Without bleach? Or even water?
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here

SlimeCrusher


ITypedThis


Darker

Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Cala13er

Quote from: Sion on April 03, 2014, 01:17:14 PM
I think rain should slowly clear bloodstains off the map, because when you are approaching day 100+ it looks like a slaughterhouse wherever the fighting happens, and it really isn't practical to Home Zone the entire map just to clean it.

I've decided to start working on this, will let you know IF i manage to finish it.

Jones-250

Skill,
  Cohesion
      and a Forward spirit.

Tynan

You're right, I'll put this in now.

I had wanted the blood to tell the story of past battles, but after a while it just becomes a flood. Maybe it'd be better to clear the ancient battles so you can see the remnants of the recent ones.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Semmy

Maybe isntead of blood remaining make it slowly degrade over a rainstorm or 4.

And let bodies decay so skeletons remain.
The only thing necessary for the triumph of evil is for good men to do nothing.
Edmund Burke

Darker

#10
Yeah, skeletons would be nice. Much more realistic than blood. They should also give fear buff along with the happiness debuff.

By the way, Tynan, how would you implement this? I'm asking because I was too thinking of whole map over-time events and processes, but I have no idea how to hook them.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Tynan

This is the BreakdownManager.

It used to do breakdowns for repairs, but that was cut. Now it does electrical shorting from rain and blood washing from raid.

Basically, it just randomly pokes at the map and does stuff depending on what it finds. Not very efficient, and it has some other quirks, but it works well enough.



public class BreakdownManager
{
//Constants
private const float CheckInterval = 97;
private const float BreakdownChanceOverall = 0.02f;
// private const float WearRandomChancePerBuilding = 0.001f;
private const float RainFireRandomChancePerBuilding = 0.20f;


public void BreakdownManagerTick()
{
//Check if I should do a breakdown
if( Find.TickManager.tickCount % CheckInterval == 0 )
{
// if( Random.value < BreakdownChanceOverall )
// RollForWear();

if( Random.value < BreakdownChanceOverall )
RollForRainFire();

RollForBloodWash();
}
}

/*
private void RollForWear()
{
float adjustedChance = WearRandomChancePerBuilding
* (float)Find.BuildingManager.allBuildingsColonist.Count;

if( Random.value > adjustedChance )
return;

Building victim = Find.BuildingManager.RandomBuildingColonist();

if( victim.def.eType != EntityType.Frame )
{
//Do the wear damage
int damAmount = Mathf.CeilToInt(((float)victim.health) * Random.Range( 0.3f, 0.4f ));

victim.TakeDamage( new DamageInfo(DamageTypeDefOf.Breakdown, damAmount) );
}
}*/

private void RollForBloodWash()
{
//200 checks per day
//Clean the whole map in 2.5 days of rain
//Means Clean the whole map in 500 tries
//Means 1 try = 1/500 of the map


if( Find.WeatherManager.RainRate > 0.5f )
{
int numCh = (Find.Map.Size.x * Find.Map.Size.z) / 500;

for(int i=0; i<numCh; i++)
{
IntVec3 sq = GenSquareFinder.RandomSquare();

if( !Find.RoofGrid.Roofed(sq) && sq.Walkable() )
{
Find.DebugDrawer.MakeDebugSquare( sq );


Filth f = null;
foreach( Thing t in sq )
{
if( t.def == ThingDefOf.FilthBlood )
{
f = (Filth)t;
break;
}
}
if( f != null )
f.ThinFilth();
}
}
}
}

private void RollForRainFire()
{
float adjustedChance = RainFireRandomChancePerBuilding
* (float)Find.ListerBuildings.allBuildingsColonistElecFire.Count
* Find.WeatherManager.RainRate;

if( Random.value > adjustedChance )
return;

Building victim = Find.ListerBuildings.allBuildingsColonistElecFire.RandomElement();

if( !Find.RoofGrid.Roofed(victim.Position) )
{
ThingWithComponents victimC = (ThingWithComponents)victim;

//Either a running appliance or a charged battery
if( (victimC.GetComp<CompPowerTrader>() != null && victimC.GetComp<CompPowerTrader>().PowerOn)
||  (victimC.GetComp<CompPowerBattery>() != null && victimC.GetComp<CompPowerBattery>().StoredEnergy > 100) )
{
//Do the electrical fire
Explosion.DoExplosion(GenAdj.SquaresOccupiedBy(victim).RandomElement(), 1.9f, DamageTypeDefOf.Flame, null);
Find.LetterStack.ReceiveLetter(new UI.Letter("A " + victim.Label.ToLower() + " has short-circuited in the rain and started a fire.", UI.LetterUrgency.High, victim.Position) );
}
}
}
}
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

Thanks, there are also other things I was curious about in this file.

But how would I hook similar thing in-game? Can I have procedural code in the C# file?
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Tynan

Procedural code? Wha?

What you need is a hook for some sort of global entity that can undertake global operations. Let me look into providing that.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

With procedural, I meant something like calling methods of other objects from within nothing.
In Java this isn't possible, and everything chains from the main class - even if you add a code, it must be invoked from somewhere. With rim world mods, everything is being invoked by XML definitions that cause classes being instantiated.
But I have no idea how to add something that is not defined anywhere - like this global events, more pieces of UI and so on.
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT