What determines what ruins are made out of?

Started by Ekarus, June 26, 2017, 10:30:25 PM

Previous topic - Next topic

Ekarus

So I've started work on a mod and hit a wall, literally.

I don't know what causes materials to be used in ruin generation but my "Glass pellets" are being used (anything "made out of" them is being used) and that's kinda not gonna work. Don't know what's wrong, but here's the thingdef.
  <ThingDef ParentName="ResourceBase">
    <defName>EEGlass</defName>
    <label>glass pellets</label>
    <description>A pile of glass pellets that can be used to make furniture, structures, and other things from glass.</description>
    <graphicData>
      <texPath>EEGlass</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <resourceReadoutPriority>First</resourceReadoutPriority>
    <soundInteract>Silver_Drop</soundInteract>
    <soundDrop>Silver_Drop</soundDrop>
    <useHitPoints>false</useHitPoints>
    <resourceReadoutAlwaysShow>false</resourceReadoutAlwaysShow>
    <statBases>
      <MarketValue>1</MarketValue>
      <Mass>1</Mass>
      <SharpDamageMultiplier>1.2</SharpDamageMultiplier>
      <BluntDamageMultiplier>1</BluntDamageMultiplier>
    </statBases>
    <thingCategories>
      <li>ResourcesRaw</li>
    </thingCategories>
    <stackLimit>75</stackLimit>
    <smallVolume>false</smallVolume>
    <deepCommonality>0</deepCommonality>
    <stuffProps>
      <categories>
        <li>Metallic</li>
      </categories>
      <color>(198,220,198)</color>
      <commonality>0.1</commonality>
      <constructEffect>ConstructMetal</constructEffect>
      <soundImpactStuff>BulletImpactMetal</soundImpactStuff>
      <soundMeleeHitSharp>MeleeHit_Metal_Sharp</soundMeleeHitSharp>
      <soundMeleeHitBlunt>MeleeHit_Metal_Blunt</soundMeleeHitBlunt>
      <statOffsets>
        <Beauty>6</Beauty>
      </statOffsets>
      <statFactors>
        <MaxHitPoints>0.1</MaxHitPoints>
        <Flammability>0</Flammability>
        <Beauty>1</Beauty>
        <MeleeWeapon_Cooldown>1.8</MeleeWeapon_Cooldown>
      </statFactors>
      <smeltable>true</smeltable>
    </stuffProps>
  </ThingDef>

I've looked at Rimsenal's Foerum, which somehow doesn't get used for ruins but is still usable in the same, non-ruin ways.

dburgdorf

Quote from: Ekarus on June 26, 2017, 10:30:25 PMSo I've started work on a mod and hit a wall, literally.

Ruins are generated using material selected by a method in RimWorld.BaseGen.BaseGenUtility called "RandomCheapWallStuff." It does pretty much exactly what it sounds like it does: it randomly selects an available material that can be used to make walls and isn't expensive.

At a guess, I'd say the Rimsenal material you're talking about isn't used for ruins because it isn't cheap.

- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Ekarus

Quote from: dburgdorf on June 27, 2017, 12:34:20 AM
Quote from: Ekarus on June 26, 2017, 10:30:25 PMSo I've started work on a mod and hit a wall, literally.

Ruins are generated using material selected by a method in RimWorld.BaseGen.BaseGenUtility called "RandomCheapWallStuff." It does pretty much exactly what it sounds like it does: it randomly selects an available material that can be used to make walls and isn't expensive.

At a guess, I'd say the Rimsenal material you're talking about isn't used for ruins because it isn't cheap.

Is there a blacklist somewhere for ruin stuff? I don't want it using the material but the material shouldn't be super expensive either.

At the very least I don't want it using certain floors (They look really ugly out of place) It's blocking sterile and silver floors even though silver is "cheap" (Cheaper than Stone or steel anyway)

jamaicancastle

In order to be considered "cheap", the material needs to cost less than $5 per unit. However, small-volume materials are accounted for, meaning things like silver cost 10x their normal market value for the purpose of the cheapness function.

There's another parameter that will prevent it from using anything with 50% or more flammability, which I assume is true for ruins because you don't see ruins with wooden walls by default.

The third requirement is that it is in the list of stuffs that can be used to build walls.

Once it's picked out a wall material, it uses the first floor it can find that uses that material, or concrete as a fallback.

dburgdorf

Quote from: Ekarus on June 27, 2017, 12:41:41 AMIs there a blacklist somewhere for ruin stuff?

Sadly, no. If a material meets the criteria Jamaicancastle outlined, it's considered a viable material for use in ruins.
- Rainbeau Flambe (aka Darryl Burgdorf) -
Old. Short. Grumpy. Bearded. "Yeah, I'm a dorf."



Buy me a Dr Pepper?

Ekarus

Quote from: jamaicancastle on June 27, 2017, 01:23:42 AM
In order to be considered "cheap", the material needs to cost less than $5 per unit. However, small-volume materials are accounted for, meaning things like silver cost 10x their normal market value for the purpose of the cheapness function.

There's another parameter that will prevent it from using anything with 50% or more flammability, which I assume is true for ruins because you don't see ruins with wooden walls by default.

The third requirement is that it is in the list of stuffs that can be used to build walls.

Once it's picked out a wall material, it uses the first floor it can find that uses that material, or concrete as a fallback.

Looks like I'm just going to have to set it to use the small volume... Oh well, thanks for your help, you too dburgdorf.