Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base computer moving artifacts #200

Open
jeffswt opened this issue Aug 24, 2019 · 7 comments
Open

Base computer moving artifacts #200

jeffswt opened this issue Aug 24, 2019 · 7 comments

Comments

@jeffswt
Copy link

jeffswt commented Aug 24, 2019

I moved the base computer to a beacon 1000u away.

Everything in the original place were elevated for dozens of metres up into the sky.

I sense this has something to do with the spherical world. Is there any way to fix this?

image

EDIT: A simple schematic

image


Reproduction steps:

  1. Build a base computer and register the base.
  2. Build a beacon sufficiently far away. The farther the beacon is the more significant the bug will be.
  3. Use the save editor to move the base computer to the beacon.
  4. Return to the game and the beacon will appear in the sky. (The base computer will stay on the ground, though)
@goatfungus
Copy link
Owner

Wow... that is weird.
It is most likely because of the world shape, and also because of the issues with imprecise floating point numbers in the calculation. Not really much we can do about that as every situation would be different.

I wonder if a backup of the previous base could be restored to the new location instead?

@jeffswt
Copy link
Author

jeffswt commented Aug 24, 2019

The farther you get from the original base, the larger the elevation difference you get after you move the base. I checked the vectors you modified, and there aren't supposed to be any problems -- if (and only if) you are working on a flat surface.

And you would get your base restored if you move back the base computer (swap back). So i suggest that there should be few to do with FP errors.

I'm trying to come up with a prototype of a moving algorithm that at least fixes the problem partially. But there are still a few things to consider:

  • are all planets of the same size
  • if not, how can we retrieve the size of the planet the base is on
  • there must be a set of vectors dealing with the facing of the object
  • what should we do if the base becomes as large as half the planet

EDIT: When I edited my base the actual build limit was between [1002, 1003)u and not 1000u. I suspect that, the actual base build limit was calculated in euclidean distance, between the point the person was standing and the base computer, while the distance shown on the Analysis Visor was the length of the arc on the sphere connecting the two points. That might explain this problem.

@ukmerlin
Copy link

I had a problem with mod parts not lining up with the rest of my base so I used Blender to slide it all back where it belonged. A simple height translation ought to be easy enough to do.

@jeffswt
Copy link
Author

jeffswt commented Aug 24, 2019

The question is, how are the objects stored? It should be apparent that, if the objects are all stored in a Cartesian plane, such issues would not have happened. From the position values we can also infer that it is not stored in a polar plane. Then how could this happen?

@jeffswt
Copy link
Author

jeffswt commented Aug 26, 2019

UPDATE: Position kept where they were after moving the base away for 1000+ metres. But relative angles are a bit strange and I'm still trying to fix them.

image

@jeffswt
Copy link
Author

jeffswt commented Aug 26, 2019

UPDATE AFTER 10 MINS: Sorry I forgot to delete the return before the file saver.

Now everything is working. I'll release the code after I figure out how to switch the base computer and the beacon safely. Still the base computer moved 1000u away.

Pic below:

image

@jeffswt
Copy link
Author

jeffswt commented Aug 28, 2019

jeffswt/no-mans-save-py@f2ea730d

This can be incorporated into your code seamlessly with minor (language) modifications. I would be grateful if you attribute my work. Won't be a problem if you don't. It's just an idea.

Hope it'll be a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants