Little-Plane-Project icon indicating copy to clipboard operation
Little-Plane-Project copied to clipboard

Map Scaling not occuring from the center point

Open theDRB123 opened this issue 1 year ago • 7 comments

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...

theDRB123 avatar Oct 12 '23 04:10 theDRB123

@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.

Glowstick0017 avatar Oct 12 '23 15:10 Glowstick0017

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

theDRB123 avatar Oct 12 '23 15:10 theDRB123

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.

Glowstick0017 avatar Oct 12 '23 15:10 Glowstick0017

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 .

theDRB123 avatar Oct 13 '23 18:10 theDRB123

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 ?

theDRB123 avatar Oct 14 '23 07:10 theDRB123

currently the shaking affect has been handled by @anttijankeri in https://github.com/Glowstick0017/Little-Plane-Project/pull/44 and https://github.com/Glowstick0017/Little-Plane-Project/pull/48 . If we can implement the scaling to what we have now, that would solve this map scaling issue.

Glowstick0017 avatar Oct 14 '23 22:10 Glowstick0017

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....

theDRB123 avatar Oct 15 '23 17:10 theDRB123