Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

The physics are being inconsistent

Discussion in 'General' started by Hale, Aug 29, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Hale Trainee Engineer

    Messages:
    78
    Why are the physics acting inconsistent? The first picture is before save, exit, load game. The other picture is after load saved game.
    The pistons appear to have magically acquired increased lateral tensile strength. This is messing with my mining strategy.

    Before:
    [​IMG]

    After:
    [​IMG]
     
  2. halipatsui Senior Engineer

    Messages:
    1,253

    I guess lord clang found pictures of 2 pistons locked to each other via landing gears.

    If you know what i mean ;)
     
    • Funny Funny x 2
  3. GrindyGears Senior Engineer

    Messages:
    1,787
    Might be a silly question, but did you jiggle the pistons after the world reload?

    It's possible it just needs to have a block update, then it will sag back down again.

    On a semi related note: adding another chain of pistons vertically down will help reduce the sag a great deal
     
  4. Hale Trainee Engineer

    Messages:
    78
    No, that's sort of the point. They kind of jiggled themselves. Before the world reload the pistons were sagging and quite stationary, but after the reload they were oscillating quite heavily. As suggested by the broken measuring stick. I had to wait some time for the oscillation do die down so i could take an honest representative after picture. I didn't move from the spot i was standing, in the mean time.

    I don't know what you mean by block update. How do i do that?

    Another row of pistons helping with the sag is good to know, but i felt that's too much work for setup that will be used to drill out one part of the cave and then dismantled. I had actually learned to account for the sag. I'd just like for the world to behave in the same way as it did when i left it, when loading a savegame.
     
  5. GrindyGears Senior Engineer

    Messages:
    1,787
    I just mean reverse the pistons twice, just put them in motion for a moment.

    Oh, well if its for a 1 off use, then i agree
     
  6. Hale Trainee Engineer

    Messages:
    78
    This didn't seem to help in my survival world, at least. That was the first thing i tried.
    --- Automerge ---
    Haha! Oh wow, took me a while for the coin to drop. You're bad.
     
  7. Ronin1973 Master Engineer

    Messages:
    4,845
    Every piston is considered an individual grid. When the game loads the grids are placed where they were. However, the physics engine has to be applied after the game loads. So it's going to move.
     
  8. Hale Trainee Engineer

    Messages:
    78
    If the grids are placed where they were and all acceleration, velocity, and force vectors are restored, then a consistent physics engine should not cause stationary objects to suddenly move. Ideally.

    In a simpler case the pistons could all be restored in a straight line, prompting the physics engine to cause movement again. But even then the piston chain should eventually return to the same level of sag. That i would understand.

    My complaint, and the thing i don't understand, is why does application of the physics engine after the game loads NOT return the pistons to the same state of sag as before load, after oscillation has died down. This makes no sense to me.
     
  9. GrindyGears Senior Engineer

    Messages:
    1,787
    On another note: if you are going to do this as a one and done type thing, i would advise you extend the pistons one by one locking them as they reach the end, this may help you to eliminate the sagging and give you a straighter cut.
     
  10. Hale Trainee Engineer

    Messages:
    78
    That might not actually be a bad idea, for the future. I didn't even think of that. I was told to never under any circumstances lock pistons, but then again, i was probably told at some point to not use pistons at all.
    --- Automerge ---
    Important safety tip: Do not engage safety lock override on the entire piston group at the same time!
     
    • Friendly Friendly x 1
  11. ShadedMJ Apprentice Engineer

    Messages:
    223
    Is this related to my wheeled vehicles at a full parking stop on flat surface before save will now jump 3m into the air during load?
     
  12. Mindblast Trainee Engineer

    Messages:
    4
    Ha! I had the same thing on my savegame yesterday. Upon loading the save the game decided to catapult my parked 1800ton mobile base rover up in the air for a full salto mortale because i saved the game with my welding arm extended. I was not amused... :-/ Had to switch the game to non destructible blocks and voxels and load it up to stow the arm so i could get a playable save again.
     
  13. odizzido Junior Engineer

    Messages:
    672
    I find the safety locks to be extremely dangerous, funnily enough.
     
  14. Ronin1973 Master Engineer

    Messages:
    4,845
    We have attributes that are saved and then attributes that are simply calculated from the saved attributes. It works fine for simple grids. But when you're dealing with multiple grids that have a complex relationship, this is where you'll see inconsistencies.

    You have a dynamic structure like a piston that can torque and bend. Where that deflection ends is the beginning of another grid. Acceleration (gravity or movement) causes the bending. I understand the question of why this happens. But any solution would require far more aspects of the game world being saved, which would absolutely bog down load times, in-game saves, and especially will affect sim speed during a save.
     
  15. sioxernic Senior Engineer

    Messages:
    2,535
    Ideally, yes, practically, wont happen.

    What the physics engine probably sees is a ton of grids that are out of alignment of the position they were supposed to be, and the physics engine then attempts to correct that by applying forces. Do remember, the physics engine is being reinitialized, which means that all forces has to be re-applied to all objects based on their interaction with the world around the,
     
    • Late Late x 1
  16. Hale Trainee Engineer

    Messages:
    78
    @Ronin1973 @sioxernic

    I don't know. These answers don't seem quite satisfying to me. The deflection difference in my example seems greater than should be accounted for by physics reinitialization. It seems as if it's deriving the derived attributes differently after game load compared to initial block placement. Maybe..
    --- Automerge ---
    Then i wonder how the physics allowed the grids to get into those positions in the first place.
     
  17. sioxernic Senior Engineer

    Messages:
    2,535
    Because the acceleration of gravity pulling the grids down and the force of the misalignment cancels out at some point, which means the sagging happens. Secondly, I think you are misunderstanding the inconsistencies. If after each reload it sagged a different amount, it would be inconsistent, but I am guessing because during the initial building the forces were a bit different, and it finds a different equilibrium point (due to the weight being added over time) and therefor it seems inconsistent.

    Do the following experiment to prove the inconsistency... retract all of the pistons, then extend them, record sag, reload, check new sag. Also copy and paste the grid, record the sag, reload, check new sag.
     
  18. Devon_v Senior Engineer

    Messages:
    1,602
    It's more like, rather than finding a "correct" answer to the physics of a complex grid, Havok just bounces things around until they mostly settle and then goes "eh, close enough." When the world is reloaded Havok is presented with the same grids in the same positions, but doesn't remember that it shrugged and just let it be, so it starts trying to work out physics again from a new starting point, and eventually goes "eh" again. It will do that every time it reloads, with a potentially unique starting position for all the grids each time.

    Basically Havok can be precise, or it can be fast, but not both. The only way to keep simspeed up is to let Havok play a bit loose with Newton. That said, if you can get a contraption to reset to a known state, all forces should be consistently applied from that state.
     
  19. Hale Trainee Engineer

    Messages:
    78
    All right, so i tried to do this a little more rigorously.

    2017-08-31-22-41-36-425_Reference.png:
    Built deflection testing measuring frame. Each piston was fully extended and locked before placing the next piston.
    [​IMG]
    [​IMG]

    2017-08-31-23-22-09-505_Piston_Unlock.png:
    Pistons were individually unlocked one by one, starting with the piston furthest out (closest to the drill array).
    Heavy ocsillation. Early oscillation between about 3 to 9 blocks downward, as measured at the tip of the center drill.
    Waited until oscillation subsided to about 6 blocks downward (+- roughly half a block). Did not have patience to wait further.
    [​IMG]

    2017-08-31-23-28-26-485_Catastrophic_Failure.png:
    Attempted to reverse all pistons at once. Catastrophic failure occurred.
    [​IMG]

    2017-08-31-23-50-11-123_Retract_Extend.png:
    Pasted in blueprint of reference grid. Unlocked pistons as before. Heavy oscillation between 2 and 10 blocks downward.
    Did not wait for oscillation to subside. Retracted each piston one by one, starting furthest out. Still some oscillation occurs in retracted state.
    Extended entire piston group at once. Small oscillation around 6 blocks downward.
    [​IMG]

    2017-08-31-23-57-25-206_After_Load.png:
    Saved game on exit. Loaded game. Heavy oscillation observed. Oscillation relatively quickly subsides to measured levels of about 2 blocks upward, 4 blocks downward.
    Oscillation further subsides to about 0 to 2 blocks downward.
    [​IMG]

    2017-09-01-00-10-28-472_Retract_Extend_2.png:
    Retracted pistons individually. Extended pistons as a group. Tiny oscillations at about 1 block downward. Oscillations stop entirely after only a short while. Drills entirely stationary.
    [​IMG]

    2017-09-01-00-19-15-926_After_Load_2.png:
    Saved and loaded game. Drills still stationary at 1 block downward.
    [​IMG]

    2017-09-01-00-27-22-362_CopyPaste.png:
    Copy and paste grid using ctr+c, ctrl+v. Heavy oscillation at about 1 to 10 blocks downward.
    [​IMG]

    2017-09-01-00-34-21-729_Before_Save_3.png:
    Waited for oscillation to subside to about 3 to 9 blocks downward. Entered menu at upper apex of 3 blocks downward, to save game.
    [​IMG]

    2017-09-01-00-40-40-477_After_Load_3.png:
    Array oscillates at about 0 to 3 blocks downward.
    [​IMG]

    2017-09-01-00-54-24-375_Stationary_2.png:
    Oscillations stopped. Array entirely stationary at about 1 block downward.
    [​IMG]

    Conclusion:
    My interpretation of this experiment is that the physics are being consistent in their inconsistency. It also seems that the physics engine goes "eh, close enough." and suspends simulation of movement at a movement scale in the order of magnitude of several ingame decimeters, not at an order of magnitude of ten meters. I still feel that the explanation given by @Ronin1973, @sioxernic and @Devon_v is inadequate to explain the apparent inconsistency of lateral tensile strength of pistons between build/paste and reload, and between reload and copy.
     
  20. sioxernic Senior Engineer

    Messages:
    2,535
    @Hale I am personally not surprised honestly, but thanks for giving a proper and extensive test.

    Physics engines attempting realism tends to not give.... "consistent" results... A little surprised about the variation, but not much. Take a look at bad rats for a good example. Last test I would like to ask of you (You are requesting the engine to do something quite extreme, remember that) is if it is in the same save. Save once, reload 2-3 times and see if it is consistent. Remember, No save should be done between these reloads. We can at this point agree it is inconsistent (But to to be honest, not much the dev team can do)
     
  21. Hale Trainee Engineer

    Messages:
    78
    I loaded the last save a few time, without saving in between. Each time there was a tiny bit movement that almost immediately ended in a suspended state, representative of my last screenshot.

    To be honest, i think i'd be somewhat satisfied if i could just understand WHY that is happening.
    --- Automerge ---
    Also, i was a little surprised at the result of the copypaste. My guess would have been that copying the grid after a reload would have retained the piston stiffness in the copy. But this was not the case.
     
  22. sioxernic Senior Engineer

    Messages:
    2,535
    @Hale Can I borrow you in a voice chat tomorrow or during the weekend? I am not going to say I am an expert, but I do think I can explain the situation here enough for a layman to understand the basics.
     
  23. Hale Trainee Engineer

    Messages:
    78
    @sioxernic I suppose we could organize something. I might have to dig up my crappy old Roackband microphone.
     
  24. sioxernic Senior Engineer

    Messages:
    2,535
Thread Status:
This last post in this thread was made more than 31 days old.