Storyteller with reduced raid strength

Started by aper, January 04, 2017, 06:16:26 AM

Previous topic - Next topic

aper

I'm kinda tired of having to wall my whole base off and building killboxes in every game, but the problem is that playing on easier difficulties makes the game overall unchallenging and boring

so I want to have the trade prices, crop yields and pawn mood penalties of the extreme difficulty, but with raids that would have the same strenght as when playing "rough" or "some challenge", .i.e. only the raids are weaker everything else is hard

is there a mod for that or can you give me tips how may I do it myself?

RawCode

public class IncidentWorker_RaidEnemy : IncidentWorker_Raid

protected override bool TryResolveRaidFaction(IncidentParms parms)
{
Map map = (Map)parms.target;
if (parms.faction != null)
{
return true;
}
float maxPoints = parms.points;
if (maxPoints <= 0f)
{
maxPoints = 999999f;
}


to

protected override bool TryResolveRaidFaction(IncidentParms parms)
{
Map map = (Map)parms.target;
if (parms.faction != null)
{
return true;
}
float maxPoints = parms.points / 10;
if (maxPoints <= 0f)
{
maxPoints = 999999f;
}


can be done as XML + normal code on vanilla, on modded game code injections to "fix" mod added raids are required.

can be injected from incident defs XML.

ajaviide

I would be interested in same type of mod.
Not a fan of killboxes but cant survive without them on tougher difficulties, but when i play lower difficulties other parts of game feel too easy, colonist always have max mood etc.

jjcm04

Quote from: RawCode on January 04, 2017, 07:09:23 AM
public class IncidentWorker_RaidEnemy : IncidentWorker_Raid

protected override bool TryResolveRaidFaction(IncidentParms parms)
{
Map map = (Map)parms.target;
if (parms.faction != null)
{
return true;
}
float maxPoints = parms.points;
if (maxPoints <= 0f)
{
maxPoints = 999999f;
}


to

protected override bool TryResolveRaidFaction(IncidentParms parms)
{
Map map = (Map)parms.target;
if (parms.faction != null)
{
return true;
}
float maxPoints = parms.points / 10;
if (maxPoints <= 0f)
{
maxPoints = 999999f;
}


can be done as XML + normal code on vanilla, on modded game code injections to "fix" mod added raids are required.

can be injected from incident defs XML.
How would this work in XML or maybe set a C# script and have a XML call that script?

RawCode

please open vanilla incident defs and check yourself how it's done, thx.

O Negative

#5
RimWorld\Mods\Core\Defs\Misc\DifficultyDefs

In there, you'll find a "Difficulties" .xml file. This is what you want to look at.


<?xml version="1.0" encoding="utf-8" ?>
<Defs>

<DifficultyDef>
<defName>Peaceful</defName>
<label>Peaceful</label>
<description>For those who want to relax and build a colony in a sandbox-like environment.\n\nMajor threatening events are disabled, but colonists can still get grumpy and animals can still go crazy from time to time.</description>
<difficulty>0</difficulty>
<threatScale>0.05</threatScale>
<allowBigThreats>false</allowBigThreats>
<colonistMoodOffset>10</colonistMoodOffset>
<cropYieldFactor>1.30</cropYieldFactor>
<diseaseIntervalFactor>3</diseaseIntervalFactor>
<enemyReproductionRateFactor>0.1</enemyReproductionRateFactor>
</DifficultyDef>

<DifficultyDef>
<defName>VeryEasy</defName>
<label>Base builder</label>
<description>For those who want to build a colony with a taste of danger.\n\nMajor threats appear, but they're weakened. Some of the extremely dangerous events are disabled.</description>
    <difficulty>1</difficulty>
    <threatScale>0.10</threatScale>
<colonistMoodOffset>10</colonistMoodOffset>
<cropYieldFactor>1.30</cropYieldFactor>
<diseaseIntervalFactor>3</diseaseIntervalFactor>
    <enemyReproductionRateFactor>0.1</enemyReproductionRateFactor>
</DifficultyDef>

<DifficultyDef>
<defName>Easy</defName>
<label>Some challenge</label>
<description>For players on their first game, or casual players who still want a challenge.\n\nThreats are dangerous but not brutal.</description>
    <difficulty>2</difficulty>
    <threatScale>0.35</threatScale>
<colonistMoodOffset>5</colonistMoodOffset>
<tradePriceFactorLoss>0.05</tradePriceFactorLoss>
<cropYieldFactor>1.20</cropYieldFactor>
<diseaseIntervalFactor>1.5</diseaseIntervalFactor>
    <enemyReproductionRateFactor>0.4</enemyReproductionRateFactor>
</DifficultyDef>

<DifficultyDef>
<defName>Medium</defName>
<label>Rough</label>
<description>It's a rough planet.\n\nThreats can be quite dangerous. Not recommended until you've got some experience with the game.</description>
    <difficulty>3</difficulty>
    <threatScale>0.65</threatScale>
<colonistMoodOffset>0</colonistMoodOffset>
<tradePriceFactorLoss>0.10</tradePriceFactorLoss>
<cropYieldFactor>1</cropYieldFactor>
<diseaseIntervalFactor>1</diseaseIntervalFactor>
    <enemyReproductionRateFactor>1</enemyReproductionRateFactor>
</DifficultyDef>

<DifficultyDef>
<defName>Hard</defName>
<label>Intense</label>
<description>A significant challenge.\n\nSucceeding at this level requires a solid and well-rounded understanding of survival strategies, and some luck.</description>
    <difficulty>4</difficulty>
    <threatScale>1.0</threatScale>
<colonistMoodOffset>-3</colonistMoodOffset>
<tradePriceFactorLoss>0.15</tradePriceFactorLoss>
<cropYieldFactor>1</cropYieldFactor>
<diseaseIntervalFactor>1</diseaseIntervalFactor>
    <enemyReproductionRateFactor>1</enemyReproductionRateFactor>
  </DifficultyDef>

<DifficultyDef>
<defName>VeryHard</defName>
<label>Extreme</label>
<description>As hard as a diamond-bladed dagger.\n\nEnemies are numerous, prices are poor, food is scarce, and colonists are grumpy. For those who enjoy digital suffering.</description>
    <difficulty>5</difficulty>
    <threatScale>1.3</threatScale>
<colonistMoodOffset>-8</colonistMoodOffset>
<tradePriceFactorLoss>0.20</tradePriceFactorLoss>
<cropYieldFactor>0.9</cropYieldFactor>
<diseaseIntervalFactor>0.9</diseaseIntervalFactor>
    <enemyReproductionRateFactor>1</enemyReproductionRateFactor>
  </DifficultyDef>

</Defs>


You're interested in the lines with <threatScale>#</threatScale>

Look carefully at how they differ between difficulties. You can think of them as exponents coefficients. 1 being 100% threat, 0.05 being 5% threat.

Hope that helps!

Britnoth

Quote from: ajaviide on January 04, 2017, 09:42:26 AM
I would be interested in same type of mod.
Not a fan of killboxes but cant survive without them on tougher difficulties, but when i play lower difficulties other parts of game feel too easy, colonist always have max mood etc.

Lower difficulties feels too easy.

Higher difficulties you can't survive without a killbox.

Seems the solution is to learn to play without killboxes?  ::)

aper

Quote from: O Negative on January 04, 2017, 11:30:17 PM
RimWorld\Mods\Core\Defs\Misc\DifficultyDefs

In there, you'll find a "Difficulties" .xml file. This is what you want to look at.

[...]

You're interested in the lines with <threatScale>#</threatScale>

Look carefully at how they differ between difficulties. You can think of them as exponents. 1 being 100% threat, 0.05 being 5% threat.

Hope that helps!

Thanks a lot! Exactly what I was looking for

O Negative

Glad that helped! Just wanted to clarify, though...

I used the wrong word. It's not an exponent, it's a coefficient. Words are hard :P

ajaviide

K i got my day off today after dentist, going to try make this today.
Thanks guys.