• Welcome to SC4 Devotion Forum Archives.

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Decoding the "Goofy Stat Response Curve" data?

Started by MoltresRider, October 01, 2021, 09:05:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MoltresRider

I have been playing around with ilives and I started to get familiar with query editing as well as adding more functionality to lots.

One thing that I have been experimenting with lately is the Goofy Stat Response Curve data. However, I have yet to fully understand it.

I have some knowledge of programming from way back in high school and I am the family's tech guy. I also have been able to do very complex things with various computer programs that most did not think was possible. I know my way around computer logic but I kinda do not understand this one. Looking for some help.

From a post already on the forums:

Quote from: RippleJet on March 16, 2010, 01:47:44 PM

That requires the property Goofy Stat Response Curve.
E.g, if you want "Engines Repaired" to be, say somewhere between 0 and 10,
you could give the Goofy Response Curve the following four values:

-100, 0, 0, 2, 50, 5, 100, 10

Mathematically that would first generate a random number between -100 and 100,
which would then be mapped to a number between 0 and 10 with the following chances:


  • 50% chance for a number between 0 and 2
  • 25% chance for a number between 2 and 5
  • 25% chance for a number between 5 and 10

That mapped number can then be referred to in a query with the id=0x0000106b

I studied "-100, 0, 0, 2, 50, 5, 100 10" for days and some things do not add up for me on how the calculations works. I am requesting some elaboration.

Other than what is explained, the best that I could come up with was:


  • a 0 and 2 is a range
  • 50 is a percent
  • 5 is a continued range
  • 10 is max number

What I have yet to figure out is, why is 0 repeated twice in a row. I do not understand the purpose of the second 0. I assumed that the first 0 means 0%

I attempted to create a goofy stat with the following:


  • 70% chance for a value between 70 & 80
  • 15% chance for a value between 80 & 85
  • 15% chance for a value between 85 & 90

by entering the following values: "-100, 0, 70, 80, 70, 85, 100, 90" and I tested the query.

However, I was given a value of 42 so my logic was incorrect. So then I assumed that the first 0 was lowest value and second 0 was a %.

So I changed the values around: "-100, 70, 0, 80, 70, 85, 100, 90" and tested the query.

I was given a result of exactly 80. While yes, this IS within range but to me, getting 80 on the first try seems kinda weird. I have no clue if I got it right or not

So I decided to break down and separate values from both the OP and my attempt to further figure out what they mean:

This is how I ended up doing that:


  • -100, 0, 0, 2, 50, 5, 100, 10
  •       0, 0, 2, 50  5,            10
  •       0, 0, 2,     5,              10
  • -100                      100     
  •                 50                     

Followed by trying to figure them out using my attempt"

  • -100, 70, 0, 80, 70, 85, 100, 90
  •           70, 0, 80, 70, 85,        90
  • -100                              100       =Generated number range?
  •          70      80                           =Range?
  •                           70                    =Percent chance of range?
  •                 85              =15% 80-85?
  •                 85         90 =15% 85-90%
  •        70                                 90 =Min and Max?


Am I getting warmer? Can I further explanation to help better understand this?

If "-100, 70, 0, 80, 70, 85, 100, 90" is correct for the percentages listed above, say that I wanted it to be


  • 70% chance for a value between 70 & 80
  • 20% chance for a value between 80 & 85
  • 10% chance for a value between 85 & 90

instead. What do I need to change/add to make that happen?

Any help would be appreciated.