Ludeon Forums

Ludeon Forums

  • December 07, 2019, 11:18:52 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Technical Info] On how Impressiveness of a room is calculated  (Read 1046 times)

kaptain_kavern

  • Planetologist
  • ****
  • Posts: 2074
  • started 10 mods in one tick.
    • View Profile
    • RimWorldMod Slack - A place for live chatting about RimWorld modding

Hi all , I don't know if this kind of thing may appeal to all, but i guess some will like this kind of data. Sorry it's a reddit link but all is wrote there.

https://www.reddit.com/r/RimWorld/comments/4xot2t/psa_depending_on_the_wealth_space_and_beauty_of_a/

In fact I will try to put it there
Code: [Select]
public class RoomStatWorker_Impressiveness : RoomStatWorker
    {
        //
        // Methods
        //
        private float GetFactor (float baseFactor)
        {
            if (Mathf.Abs (baseFactor) < 1f) {
                return baseFactor;
            }
            if (baseFactor > 0f) {
                return 1f + Mathf.Log (baseFactor);
            }
            return -1f - Mathf.Log (-baseFactor);
        }

        public override float GetScore (Room room)
        {
            float factor = this.GetFactor (room.GetStat (RoomStatDefOf.Wealth) / 3500f);
            float factor2 = this.GetFactor (room.GetStat (RoomStatDefOf.Beauty) / 6f);
            float factor3 = this.GetFactor (room.GetStat (RoomStatDefOf.Space) / 125f);
            float factor4 = this.GetFactor (1f + room.GetStat (RoomStatDefOf.Cleanliness) / 2.5f);
            float num = Mathf.Min (factor, Mathf.Min (factor2, Mathf.Min (factor3, factor4)));
            float num2 = (factor + factor2 + factor3 + factor4) / 4f;
            num2 = (num2 + num) / 2f;
            return num2 * 100f;
        }
    }

So if I understood it right :

You start from this :
  • [(Wealth/3500) + (Beauty/6) + (Space/125)  +(1+(cleanliness/2.5))] /4 and you keep the value for later.
  • You choose the smallest of the 4 values in parentheses (It's what Mathf.Min means) and keep it too
  • You add those two together and divide by 2 ( it's this bitnum2 = (num2 + num) / 2f)
  • You do a x100 and should have the impressiveness value

For
WealthBeautySpaceCleanliness
40
0
70
0

I find roughly 33.75 which correspond to mediocre.

Confirmed IG by Mehni



I also  have the Chance of Surgery success computation method but is it the kind of information that you all consider useful? If not sorry ;-)
If yes I'm sure we can dig some more, asking to fellow modders, etc.


Plus I saw that my colleague-data-addict-from-reddit, Mehni is now on this forum. Hi buddy
« Last Edit: August 16, 2016, 01:32:42 PM by kaptain_kavern »
Logged