Issue with moving by pixels per second and screen size.

0 favourites
  • 4 posts
From the Asset Store
Vintage steam pixels for your UI! 125 unique assets in a single pack!
  • I am making a top down game. Where the player moves in 8 directions by angle going 1 pixel every tick or whatever counter its going off of. Now this wouldn't be a problem it seemed like until I tried it on another screen. I work mainly off a 4k monitor and I didn't notice any issue since it was the same screen. I happened to work today off a different monitor which was also 16:9 but it was 1080p. Even though the game looked the exact same in full screen mode, the player was noticeably moving slower in my 4k monitor compared to the 1080 one. I am wondering if there is some way to scale it correctly to not do this? Any help is greatly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • With Fullscreen scaling, resolution should not matter, as the pixel amount is relative to your original viewport size.

    A bigger likelihood is different refresh rates on those monitors. If you're not using dt in your movement events, it can cause different rates of movements.

  • Thank you for the reply. This is my current move function for the player excluding rotation but I don't see that affecting much. How would you recommend I change this to include delta time?

  • Update:

    My initial "PlayerMoveSpeed" variable was set to 1. I changed the action to be "Move PlayerMoveSpeed*dt pixels a... etc" Instead of just the PlayerMoveSpeed. I also had to change the value of the variable to 50 to make it walk at a decent rate. I read somewhere on a forum that this would make it "frame-independent." Is this what you were referring to? (I am unable to test with the other monitor at this time)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)