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

Map Scaling not occuring from the center point #43

Open
theDRB123 opened this issue Oct 12, 2023 · 7 comments
Open

Map Scaling not occuring from the center point #43

theDRB123 opened this issue Oct 12, 2023 · 7 comments

Comments

@theDRB123
Copy link
Contributor

Describe the bug
The map should be scaled with airplane at the origin when moving Up and down , but instead it is scaling from the top-left corner

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'up / down'
  2. See error

Expected behavior
The origin for scaling should be the airplane (as it is moving up and the environment should correspond to it)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Win11]
  • Browser [e.g. edge]

image
scaled from top left corner
image

i wish to work on this issue...

@Glowstick0017
Copy link
Owner

Glowstick0017 commented Oct 12, 2023

@theDRB123 I assigned you to this issue. This is something i've looked into, the problem gets worse the further you are away from the origin of the perlin generation which is that corner. The reason this happens is to keep the coordinates relative to the origin so that if you scale in or out, move the plane, then scale back to the original, the coordinates would show you moved as much as you would without scaling at all. If we change the scaling to center on the plane, we'll probably have to change the speed of the plane relative to the scaling so the coordinates would still line back up when scaling back.

@theDRB123
Copy link
Contributor Author

Yeah , I think i have to change a lot the current implementation is also causing another problem that when it gains height , the terrain starts Moving even faster instead of getting slower , should i change some complex stuff too ? I will take care not to break stuff

@Glowstick0017
Copy link
Owner

You can change as much as you'd like to get this issue resolved, as long as the core concept with perlin noise and procedural generation stands and current features aren't broken. The biggest would be making sure that when you enter a seed and coordinates you've been to before, it will be the exact same generation every time.

@theDRB123
Copy link
Contributor Author

I am getting really confused , if possible can you just provide me with a just starting point , from where i may start to try and mitigate the issue (i am a beginner in games and JS both so sometimes i get really confused) , thanks .

@Glowstick0017 Glowstick0017 linked a pull request Oct 14, 2023 that will close this issue
@theDRB123
Copy link
Contributor Author

theDRB123 commented Oct 14, 2023

I have encountered a problem which is occuring when we change the up/down behaviour , when the x/y are scaling and PosX and PosY aren't , they go out of sync and thus are causing , some shaking effect ... so should i make a pull request for solving the scaling , and then solve the shaking problem after it ?

@Glowstick0017
Copy link
Owner

currently the shaking affect has been handled by @anttijankeri in #44 and #48 . If we can implement the scaling to what we have now, that would solve this map scaling issue.

@theDRB123
Copy link
Contributor Author

I am sorry , i am a bit late but i have added the PR ... the shaking issue seems to be quite prevailant , i was not able to fix that....

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

Successfully merging a pull request may close this issue.

2 participants