Page 1 of 2 12 LastLast
Results 1 to 25 of 35

Thread: Ghost base bug investigation

  1. #1
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like

    Ghost base bug investigation

    Hi people,

    After I recovered the flying base of Mykas
    https://forum.planet-nomads.com/thre...ll=1#post17244

    It occurred to me that I could investigate different such saves.
    Actually I wanted to do that long time ago, when I noticed it in my huge fulcrum, but I assumed I will find a certain kind of error which will not help to solve the problem.
    Now I have a little bit of hope

    If you don't mind sharing your saves, and if you believe you have the ghost building bug, please upload a save here.
    Also if you have huge buildings where this problem doesn't happen, I would also like to check them, to compare the case with the other faulty ones.

    @devs Can you please provide a link to a statement on the Unity site where this kind of problem is acknowledged as a known issue of Unity 5.4?
    That would be helpful too.

    Thanks!
    Menz

  2. #2
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    I can't believe it! I possibly found a solution!

    My intention was to check
    • the size/weight of the buildings (to reduce them gradually)
    • the position of the grounded block relative to the center of mass of the object
    • if the object is contained in more chunks (is on the edge of them...)
    • the depth of the grounded block into the surface (also I know this is senseless - the intro will have a space station too, not in contact with the surface)
    • to remove only certain types of blocks from the grid (air blades, radar...)

    However I had the idea to move the grounded block to the first position inside the structure.
    I was thinking what if during the grid load, somehow the grounded block is identified too late? Or some error prevents reaching the position where it is saved.

    So, I moved the grounded block to the first position and once I loaded the save, the grid texture and collider matched.


    This must be either a race condition or the grid is checked several times during the load with different routines, and one such check indeed doesn't reach the grounded block (copy paste error).

    I was doing these tests on the save from Mykas.
    In grid 1220 in the machine table I moved
    Code:
    <Block ID="1" ActiveID="0" Ground="true" Health="100" Weld="100">
        <Pos x="-33" y="8" z="18" />
       <Rot v="12" />
       <Col r="180" g="180" b="180" />
    </Block>
    to the first position inside the <Blocks> element.

    The usecase make sense. People add blocks to the flying bases to ground them (maybe to prevent launches into the orbit - which is not an issue anymore but the habit survived - or to save fuel).
    And the last block added is usually at the end of the grid.
    Still not the last in this save which Mykas provided.

    We need more saves to test.


    - - - Updated - - -

    I managed to "repair" with this method also the saves provided by Cypher091 some time ago:
    https://forum.planet-nomads.com/thre...ll=1#post15154

    But I was not able to transform one of my bigger buildings into a ghost building.

    - - - Updated - - -

    I moved the flying base of Cypher091 around and attached it to the ground, saved and loaded and is a ghost again.
    The grounded block is at the end.
    So definitely this is one of the causes.
    Still have to be checked: what kind of devices were used to build the ship, if this is important or not.

    Now, we know that grounded bases (not only flying bases reattached to ground) become ghosts
    This happens if the player removes the block which was placed first.
    The game will mark another block as grounded, if it founds one.
    If that new block is at the end of the grid, the chances are that once the world is saved and loaded, the ghost effect will be observed.
    Last edited by Menzagitat; 05-06-2018 at 10:51 PM.

  3. #3
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Based on this video
    https://forum.planet-nomads.com/thre...ll=1#post16288
    I would say the sliding on surfaces is also a slight shift between collider and texture.

    When people were building monorails, they were breaking them into smaller segments and those had always a grounded block in a different place than the original one - the first placed block.
    Sleeping in the stasis chamber was moving the texture to the collider somehow, instead of moving the collider to the texture.
    This was fixing the sliding issue but was causing a slight misalignment between the segments.



    - - - Updated - - -

    Now the pieces of the puzzle start coming together.
    In this video
    https://www.youtube.com/watch?v=zdUZavVUUIM
    the player say that it takes 2 sec to place a block.

    So, IF Unity during a callback asks if it is allowed to move/simulate the physics, the script is answering:
    • "YES. I didn't checked all blocks in the grid but up to this moment none of the blocks is grounded"

    Then for a very short time, Unity simulates something and moves the collider.
    Then in one of the next callbacks, the script reaches the grounded block and finally tells Unity to stop moving that object.

    The guy in the movie will never have a ghost base because his first block was never changed and is in the beginning of the grid structure.

  4. #4
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Now after all these experiments, the part which remains to be done is to create a ghost building.
    In this video I proved that the sliding on surfaces is the same bug with the ghost buildings, but the collider is just a tiny bit shifted away from the texture.



    I made a suspended rail. The first block is marked with a green color.
    1) I load the game to prove that everything is ok.
    2) I erase the grounded green block and I save the game
    3) Load the new save and check the behavior

    The next step would be to find out how the 100m freeze works and why that creates ghost flying vehicles too like Erdenstern so nicely advertised the bug here
    https://steamcommunity.com/app/50405...2373007132047/

    I am not sure I have enough information to do the 100m freeze investigation.

    @devs
    What meaning those numbers have?
    <DistancePhysicsFreezeData>BURQRjAxAQAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA==</DistancePhysicsFreezeData>
    or
    <DistancePhysicsFreezeData>BURQRjAxAE7z47xjWu29g1o xPlJql7yXm3Q8ug3mOw==</DistancePhysicsFreezeData>

  5. #5
    Developer
    Join Date
    Feb 2016
    Posts
    352
    Post Thanks / Like
    Hello Menzagitat,

    Thanks for your insights. Actually I did not got through it yet whole. Currently we hope that updating Unity will fix this problems also, but we did just very little amount of testing. The main reason for this issues might be in something else and it might arise again in new Unity on other places. If so, I'll look again on your findings.

    For your lasts question - DistancePhysicsFreezeData stores binary serialized values of linear and angular velocity of the grid before it was frozen when player got away. So after save/load of the grid game knows how to restore the movement of the grid when player comes back.

  6. #6
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    Here is the save containing the ghosted airbase.
    It's located in the lake next to POI B (The Shipyard)
    The map is very recent, so there isn't much on it yet... everything is simple placeholders and tiny camps.
    Attached Files Attached Files

  7. #7
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Hi Orv, in the save 20 you are near the drop pod and you made only 3 Cabinets, which you couldn't open because is a creative game.
    On the hotbar you have only the cabinets. Most likely this is the first save you made, not the one with the air base.

  8. #8
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    Quote Originally Posted by Menzagitat View Post
    Hi Orv, in the save 20 you are near the drop pod and you made only 3 Cabinets, which you couldn't open because is a creative game.
    On the hotbar you have only the cabinets. Most likely this is the first save you made, not the one with the air base.

    OOPS!! Wrong save!
    Attached Files Attached Files

  9. #9
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    I found your ghost sunken base.
    It is an interesting save. It is one of the cases I was hoping to receive, to see what the cause might be.
    Thanks for sharing it!

    I was not able to recover it yet.
    If I save near the vehicle, and I load, the vehicle is not visible anymore. But is there, according to the beacon on top of it (which I turned on by editing the save).
    Only in your original save I can see the base.

  10. #10
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    How it got in the lake was hilarious. There is a bug that sometimes comes into play on loading saves or upon entering render range that will make vehicles interact quite badly with each other as the terrain pops in stages during render. Another airbase leveraged into the big one and the result was the behemoth flipping high into the sky and eventually landing where it now resides.
    It is ill-advised to park small vehicles on top of mobile bases and leave rendering range or log out.

  11. #11
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Also it seems that in your world rains all the time (until I sleep in a stasis chamber)
    I will continue in the weekend to check your flying base.
    It looks nice, sunken in the lake with just the tip above the water

    - - - Updated - - -

    I "kind of" recovered your vehicle. You have to separate it from the pillar and will be free.
    But I do not know yet what causes the behavior.
    If you will save and load, it may become again a ghost base. (it did in my case)

    We have to try hover jacks to see if those can keep the vehicles safe...

    Here is your save.
    save_19.zip

  12. #12
    Developer
    Join Date
    Feb 2016
    Posts
    352
    Post Thanks / Like
    Hello Orv,

    Unfortunatelly I haven't found mentioned base in your save, but anyway, I've done a "top-secret" test build of the game in Unity 2018, there is still a lot of bugs, most noticable are terrain textures now, we'll probably have more time to fix them all and start releasing the game in new Unity soon.

    If you thin your eyes enough, you could try the build https://mega.nz/#!huQUmY4A!SzjV-eRJE...T3z3EO58aEyHE0 load your bugged save and tell us, if problems with ghost base have disappeared in your case or not. Thank you for your feedback.

  13. #13
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    OK, I'll give the new Unity version a try and see what happens. It's downloading now and I will install and try it right after my morning dreadmill (treadmill) session.

    P.S. Thanks Menza for the recovered ship. I will test it in the current version of PN today and see what happens.

  14. #14
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Martin is getting me out of business with his new Unity
    The snow texture is cool. Or is that the default "no texture"?
    The water surface above the former ghost flying base of Orv is also cool - the water depth was low there, due to some blocks near the surface of the water.
    I could prepare now a "top-secret" bug list too
    1. Save from Orv shows "Unity Error > NullReferenceException: Object reference not set to an instance of an object". The old unity showed 3 times "Unity Error > Null" in this save.
    2. The frame rate is not better
    3. Default screen resolution is 1280 x 960

    -1466.248 17866.43 15964.36

  15. #15
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    Happy Update.
    The ship is no longer a ghost when using the newer Unity test version of PN. =)
    Sorry it took so long for me to get back to this, but I had to fly a large base from the south pole to get to where the sunken ship was located.
    Talk about being on a "slow boat to China"...
    Now I have to try and raise the vessel out of the water. lol.
    I also have yet to see if the "fixed" map I was given has a viable ship in it using the regular version of PN.

    - - - Updated - - -

    Quote Originally Posted by Menzagitat View Post
    Martin is getting me out of business with his new Unity
    The snow texture is cool. Or is that the default "no texture"?
    The water surface above the former ghost flying base of Orv is also cool - the water depth was low there, due to some blocks near the surface of the water.
    I could prepare now a "top-secret" bug list too
    1. Save from Orv shows "Unity Error > NullReferenceException: Object reference not set to an instance of an object". The old unity showed 3 times "Unity Error > Null" in this save.
    2. The frame rate is not better
    3. Default screen resolution is 1280 x 960

    -1466.248 17866.43 15964.36

    lol
    I agree about the ship sticking up from the water looking pretty cool, especially at night.
    Almost hate to remove it from that spot.
    I think I will take a few screens of it to keep for posterity.

  16. #16
    Member
    Join Date
    Jun 2018
    Posts
    8
    Post Thanks / Like
    Happy Update Part Deux.
    Menzagitat, your fix works fine. I loaded it using 0.9.0.3 and there was my flying base sitting atop a tall column of block frames. I saved and reloaded... all was just fine.
    Both methods seem to have corrected the problem, with one caveat... using the newer Unity allowed me to access the ghost ship, totally restored, but after saving and restarting using the current Unity, the ship was once again ghosted. So, for now I think I will just leave the ghost ship sitting on the opposite shore from the shipyard and hopefully Planet Nomads will update to the new Unity in the near future so that I can once again work on it and complete it for use. =)

  17. #17
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like

    When the grid is broken in two pieces, the game has to create a new grid, but it's collider is moved.
    save_742.zip
    In Unity 2018 the collider stays and the fps drops. Reported here: https://forum.planet-nomads.com/thre...els-like-1-fps

  18. #18
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    In the video above, after I pressed the key to remove the block, there was a few seconds lag. In Unity 2018 too.

  19. #19
    QA Lead (Craneballs)
    Join Date
    Aug 2016
    Posts
    219
    Post Thanks / Like
    Well... you have my respect Great finding !

  20. #20
    Developer
    Join Date
    Feb 2016
    Posts
    352
    Post Thanks / Like
    Thank you for the save, Menzagitat. This is the first time I see the "before" state and we could test it further. Also the fact that even in in new Unity there is problems with physics (FPS) is interesting. I've tried it in old and new version, and still have no clue what is the main reason, but at least we have better material for experimenting now.

    I've attached two images, the first one is from old version of Unity, and you can see, that the collider (green box) is displayed on correct place in the editor, but calculated wrongly for some reason. The second picture is a screenshot from the profiler of the new Unity and you can see, that it's some internal physics processing that eats a lot of CPU.

    Short lag one frame after separating a big grid is normal, there is detection of which blocks belongs to which new grid and other computations, but long physics calculations in each frame is showing that something wrong happens inside the physics engine. We need to find a way how to overcome this, maybe disable physics before splitting them or something similar.

    And speaking about "snow" on the ground, it's a bug, not a feature :(. We have some problems with our texture array generator - Unity changed import format of textures and we need to find correct way to import our source textures to Unity to be able to be copied 1:1 to texture arrays.
    Attached Images Attached Images

  21. #21
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Quote Originally Posted by martinsustek View Post
    Short lag one frame after separating a big grid is normal, there is detection of which blocks belongs to which new grid and other computations...
    Who makes these computations: C# or Unity itself?
    Does the routine looks exactly the same in both builds?
    How the 0.0.0 block inside the new grid is chosen? I noticed that it is close to the removed block but not adjacent to it. There was one more block between the 0.0.0 and the removed one.

    One thing I could check now is the displacement of the bounding box. It seems to be translated always into the same direction and with the same distance.
    It feels as if Encapsulate is called in the C# and unity moves the bounding box when negative coordinates are given. Or something similar. But many structures are also quite ok, with just a slight sliding of the avatar on them...

    If I would ground the block which I know that will become 0.0.0 I guess the structure wouldn't anymore be a ghost. I will try that later.

  22. #22
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    Now that the new unity comes soon, I am doing this just for me.
    I am not pushing for a solution on the old unity.
    I hope the new build will be available soon in the beta branch

  23. #23
    Developer
    Join Date
    Feb 2016
    Posts
    352
    Post Thanks / Like
    It’s our C# script. It traverses all sides of the removed blok and divides connected blocks into distinct groups (there might be more than 2 groups or all other blocks might stay connected into single group - then no splitting occurs).
    Once blocks are assigned to the groups, the grid of the biggest group is kept as is (this should serve as performance optimization) and a new grid is created for each remaining group, corresponding blocks is removed from original grid and added into the new grid. This is probably where the things gets weird.

    I’ve noticed that if I change the logic of selection of the group to keep in grid, to use the smallest grid (the other one in our case), then the other part of the base becomes ghost after splitting. So maybe a solution could be to move all blocks to new grids and do not keep anything in the original one. I’ve also tried doing some additional physics recalculation on original grid, but it didn’t helped.

    I’ll also look at the centerpoints of all grids, maybe Unity has problems if center of the rigidbody is outside it’s colliders.

    The last thing I’ve noticed during debug is, that under some debug circumstances (but probably only with my debug modifications, not in normal state) some blocks were moved to new grids but also kept in the original grid. Then two overlapping colliders were present on the scene. That might cause weird bugs. In normal version there were not such “duplicated” blocks visible, but I must ensure that this does not happen even for a split second during grid splitting.

  24. #24
    Developer
    Join Date
    Feb 2016
    Posts
    352
    Post Thanks / Like
    I am trying to fix it because it might fix the FPS drop in new Unity as well.

  25. #25
    Senior Member
    Join Date
    Aug 2017
    Posts
    629
    Post Thanks / Like
    I checked that if I ground in advance, before the split, the block which in the new grid is going to become the 1st block, the collider stays where it should be.
    So my empirical solution works.
    Razouille it doing similar hacks too here
    https://issuetracker.unity3d.com/iss...bject-location

    Above in comment #9 I mentioned that "If I save near the vehicle, and I load, the vehicle is not visible anymore."
    What happened was that the textures vanished but the electrical connections were still visible. Loading that save in Unity 2018 preserved the invisible state.

    Unity 2018 doesn't destroy the texture during save.
    The problem is similar with https://forum.planet-nomads.com/thre...r-loading-game
    However to solution from there (save and restart) doesn't work here. (not sure why I said a restart of the game is needed there - a load works fine now)

    To be able to recover the ship from Orv, I grounded the cockpit, I moved it to the first position, I loaded the save and the vehicle was visible with good collider.
    Then I dismantled the cockpit and I built it back, I entered the cockpit and I moved the ship away from that spot.
    Later on the pillar, the only side effect after releasing the ship is that it becomes a ghost once more after save-load.
    I assumed being above the water helped and I forgot this detail.
    But the game showed 3 times "Unity Error > Null" when loading this save.

    Regarding the low fps, if collisions cause that and if the damaging of blocks is still planned, I would destroy those blocks completely, with some cool explosions to watch.
    At least until Unity will fix the simulation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •