Sign in to follow this  
Hugolipian

2d Top Down Retro Graphics: Resolution, Game Speed, and Cameras.

Recommended Posts

Hugolipian    126

I use Game Maker, I don’t think the medium matters in regards to the problem. So please read.

Notes: Resolution: 640x360 (16:9)  ,  Up Scale x3: (1920:1080)  ,  Game Speed: 60 FPS

Context: At my game speed the player moves at 1 fps, up down left and right. If I tell my player to move right and up, it processes 1 pixel up and right. Diagonally moving at a faster pace than the 1 pixel pace (for x+1 and y+1).So, I scale diagonal to .75 so the pace feels more natural.

Problem: When the camera is on the player directly, up down left and right is very smooth(1 pixel per frame as per movement speed), but when the player is moving diagonally at a fraction(.75) of a pixel the camera gets extremely jerky and becomes an eye soar. If I implement code that lerps or makes the camera more dynamic moving along decimals of x and y. the camera moves much smoother but, the game starts to get seams and sprites move out of unison with the tiles for a fraction of a moment, creating skewing that I don’t like at all.

Analysis: With a low resolution pixel game I cannot move the camera in decimals of a pixel.

Possible Solutions:

  1. Change the resolution of my game from 640x360 to 1920x1080. Freeing up movement along actual pixels.
  2. Create some kind of black magic code that realizes the game is upscaled to x3 and make the camera move in decimals of the pixels that should theoretically exist (that the game doesn’t realize). (if upscale x3, x+1/3) (although I tried a rough version of this, but the jerking was still there just not as much)
  3. Change my game speed from 60 to 30, and make movement speed nonDiagonal 2 pixels per frame, and diagonal like 1.. (but I’d much prefer a 3/2 ratio).
  4. A combination of changing the resolution and game speed.

 

Goals: I would like to keep the resolution 640x360 to adapt to more screen sizes. But I think I’m going to have to make a sacrifice here. And I’m okay with that. I just want to make the best decision moving forward.

 

What Solution should I take? or Is there one I'm not thinking about?

Edited by Hugolipian

Share this post


Link to post
Share on other sites
LorenzoGatti    4442

 

when the player is moving diagonally at a fraction(.75) of a pixel the camera gets extremely jerky

This symptom suggests that one of the two things that you want to keep exactly aligned every frame (player sprite and camera center) has its position rounded to integer coordinates and the other doesn't; or their position is rounded differently. Can you capture a video, or even random individual frames, from Game Maker? Alignment of the viewport and of sprites with the pixel grid should be easily visible.

Share this post


Link to post
Share on other sites
Hugolipian    126

well. In game maker i think i realized that if I am moving at .75, I'm actually not moving the first frame, but i am the next, to x=1 (1.5) then 2 (.75+1.5=2.25) then again 3 (3.00) BUT NOT this next one, (3.75), so every 4th frame my character is stopping.. that's the problem im running into with moving at .75.

I dont have a ton of option when it comes to movement speed. i gotta keep it whole numbers to prevent character jerkyness, and same for camera to prevent room jerkyness. Atleast thats how it seems, if the player moves 3 pixel per 60 frames its too quick for the retro style 640x360 room.  (althought 2 isn't terrible), but 3 is just way to fast.. but those are my options.. like 2 legit options.. 1 and 2.

and with the diagonal running 1 pixel per second is my only real option, 2 is too fast.

I think I have to scale my game to 1920x1080, so that each my 32x32 sprites are actually 96x96.. making 1 pixel movement slow.. 2 faster, 3 normalish.. and making 2 be the diagonal speed.. 

Edited by Hugolipian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this