1. Post #1
    RustEssentials Creator
    mistad's Avatar
    November 2013
    309 Posts
    Skip to the bottom to skip the math.

    Object stability has two values: the displayed value and the actual value. Here's how the actual value is calculated: (calculations done on the server)
    - Let's call the actual value 'A' and our object 'build'.
    - First, we run through a list of objects that physically support 'build'.
    - Then, we multiply the stability of each supporting object by a preset factor. Let's call this multiplied value 'B'.
    - Finally, we add each value of 'B' back into 'A'.
    - 'A' is returned as a value between 0.0 (0%) and 1.0 (100%).

    If that was confusing, stop here and skip to the bottom.

    However, the actual value and displayed value (what you see when you hover over an object) are not the same... all the time. They are only the same when the actual value's distance from 100% is negligible. Here's how the displayed value is calculated: (calculations done on the client)
    - Value 'A' is received from the server.
    - First, we assign to a value 'C' by doing something called "Mathf.InverseLerp", a function from Unity. If given a range (minimum and maximum) and a value within that range, Mathf.InverseLerp will return the percent of the range that represents that value. In this case: minimum = .3, maximum = 1, value = stability. Wow, pretty confusing.
    - Second, 'C' is set to a "Clamped" version of 'C' between 0 and 1: If 'C' is greater than 1, 1 is returned. If 'C' is less than 0, 0 is returned. Otherwise, 'C' is returned. Your head hurt yet?
    - Finally, 'C' is rounded to 2 decimal places and converted to a percentage - the one that is displayed.

    == Bottom ==
    The displayed stability isn't the same thing as the actual stability because more calculation goes on behind the displayed than behind the actual... for some unknown reason. The math has no purpose other than making up a displayed value :S.

    More facts:
    - Objects "die" if their actual stability is calculated at any time to be below 40%.
    - Supporting objects don't need to be below the supported object to, well, support it. Remember, stability is proportional to the stability of the objects around it MINUS some. Free standing ceilings aren't as stable as ceilings with support directly underneath it.
    - When you place an object, it is given an initial stability (the % you first see). Then, it's stability is re-calculated based on its supporting objects (the % suddenly changes). Stability is re-re-calculated every second after the first re-calculation to readjust to any changing supporting objects. Too many re-'s.
    - Actual stability is used in physics. It depends on objects supporting it.
    - Displayed stability is only displayed on your screen. It has meaningless math behind it based on the actual value.
    - Displayed stability does not equal actual stability.
    - Actual stability > Displayed stability.
    - The farther actual stability is from 100%, the farther the displayed stability is from the actual stability.
    - This explanation is directly based off the code from both the server and client.

    If this wasn't TOO confusing, I hope this helps you guys understand more of what's going on with your buildings falling apart.
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 4Useful Useful x 1Winner Winner x 1 (list)

  2. Post #2
    Thor-axe's Avatar
    July 2014
    612 Posts
    I could tell the system was doing something behind the curtains when stuff that had 25% and 29% were staying up, and things at 100% were randomly disappearing. This was really informative, great post!

  3. Post #3

    August 2014
    243 Posts
    I think he is trying to Gruber us
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 1 (list)

  4. Post #4
    neil.hillman's Avatar
    August 2014
    457 Posts
    Wow, I'm impressed!

  5. Post #5

    October 2014
    25 Posts
    Why isnt this post in the first page anymore??? This has to be looked at.... so the walls can display their real stability!!

  6. Post #6
    neil.hillman's Avatar
    August 2014
    457 Posts
    If that was confusing, stop here and skip to the bottom.
    I've got to admit, I read that a couple of times, though "holy crap, this guy has done his homework, but I really don't understand any of it!".

    Now that YOU understand it, is there any tips you can share with us mere mortals, to help our buildings stay up? You say that stability is proportional to the stability of the objects around it (MINUS some). So is there an optimum order in which we can place objects so that each adds to the stability of the previous, rather than detracts from it?

    Essentially, is there a right way to place walls and a wrong way, to aid stability?

  7. Post #7

    January 2014
    127 Posts
    yea all this is nice, but the building system is most certainly bugged too, lets not forget that.

  8. Post #8

    November 2014
    2 Posts
    Thats all very nice but it realy is no help, I for my part donīt want to understand why its doing it, I just want it fixed.

    I have an unfinished building that can be entered in the middle. After you enter you can go right an left up the stairs. Both sides are an absolutely Identical build, just Mirrored. Every building part is absolutely Identical all the way up to the fourth floor..... I have a wall on the side of the stairs to the right and of course I have stairs on the left too absolutely Identical but on the left side I cannot add the same wall I have on the right. Remember every piece is the same as on the other side... meaning every connection is the same and the complete support underneath it is the same. I even watched carefully to build every piece in the same order as the other side. Still 2 Identical walls will not build the same and that tells me it has nothing to do with math.

    Here is my math: Rust + Alpha + Experimental - Legacy + Building system - working building system + Changes before fixes * already known bugs = more bugs

    Im sure everyone understands my math :-)
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Winner Winner x 1Artistic Artistic x 1Zing Zing x 1 (list)