Hello everyone I am trying to make a small rpg and when I got to making the movement and the camera I realized that it had a bunch of issues
Look at the video
[youtube]https://youtu.be/TQ6l7zjFonM?si=wgvBAa3gvbP5CHJF[/youtube]
Now you might understand what I mean the background seems to not be keeping up with the player and it also get a bit blurry whenever I moved wich is a bit nauseating to me
Si if someone know how to fix the choppiness and blurriness issues please tell me because I couldn't find anything on my own
Camera feeling shaky
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Camera feeling shaky
Don't forget to math.floor camera coordinates, that might help.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Camera feeling shaky
How do i do that?
Edit: I have figured out how to do it but all that did is amplify the snapping effect wich I don't really like and it also didn't fix the blurryness problem because when they switched to the next pixel it had the ugly quick blur in between the snapping
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Camera feeling shaky
It's hard to guess what needs to be fixed without seeing what your code is doing. Can you upload your project here as a .love file?
Re: Camera feeling shaky
Sur man. I just thought that it would be a more general question but you can see the code if you want to
- Attachments
-
- lovegame.love
- (300.3 KiB) Downloaded 757 times
Re: Camera feeling shaky
Because your camera is locked the player position, flooring just the camera makes the player look more "jittery". You need to floor both to see the improvement, but you should only floor the player position input to the draw function call, otherwise you'll lose any fractional position information. For example, do something like this:
Instead of flooring you might want to try rounding to the nearest whole value. Sometimes that can make things look better, you should experiment with both.
The other thing you might notice is not jittering but an odd "staircase" looking affect when the player moves diagonally. This is a quirk of working at low resolutions. If you want to go down a rabbit hole there are some things you can do to improve it. This is an interesting video about that exact topic, in the context of making a shmup at a very low resolution (128x128) https://www.youtube.com/watch?v=stoDWgR-kF8&t=1451s
Code: Select all
love.graphics.draw(player.sprite, math.floor(player.x), math.floor(player.y), nil, 2*player.scale, nil, 16, 26)
The other thing you might notice is not jittering but an odd "staircase" looking affect when the player moves diagonally. This is a quirk of working at low resolutions. If you want to go down a rabbit hole there are some things you can do to improve it. This is an interesting video about that exact topic, in the context of making a shmup at a very low resolution (128x128) https://www.youtube.com/watch?v=stoDWgR-kF8&t=1451s
Re: Camera feeling shaky
Ok so I watched the video and his solution was not only flooring but adding 0.5 that way it gets to the senter of the pixel my only issue is that it doesn't seem to be 0.5 in love2d I feel like it's lower do you know what value should I use for it
Re: Camera feeling shaky
It will be the same in Love2D, but his solution is more complex than just 0.5 then floor. All of his code works together to give the nice diagonal movement. Make sure you're happy with the player/camera stuff before implementing what's in that video.
Re: Camera feeling shaky
You know what I think that I am trying to fix the wrong problem by removing all the flooring and stuff I feel like it looks better, my issue with it is that the movement felt inconsistent where sometimes everything is very smooth and sodenly it changes place I don't know how to say it and flooring just amplifies the snapping effect wich I don't like
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest