Search found 14 matches

by glass2d
Sat May 11, 2024 3:46 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

Getting back to the issue of tearing, which I imagine it's these weird lines in your 1440_810.mov video: _.png Have you tried a very slow zooming out effect instead of randomly walking around? I think this would let you find an exact zoom level that makes the problem appear, so you can write it dow...
by glass2d
Sat May 11, 2024 3:41 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

When you say it "works for you" did you add this with no other rounding (Such as the player's physics body) That's right. The character seems to jitter due to rounding problems and animation problems, but these are unrelated to the movement. Interesting, so I should also deal with the rou...
by glass2d
Sat May 11, 2024 2:29 am
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

When you say it "works for you" did you add this with no other rounding (Such as the player's physics body)
by glass2d
Fri May 10, 2024 1:41 am
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

OK, try this and see whether it helps: function PlayerCamera:update(dt) local camX = Player.x local camY = Player.y local mapW = Map.width * Map.tilewidth local mapH = Map.height * Map.tileheight camX, camY = self:setBorders(camX, camY, mapW, mapH) camX = math.floor(camX*self.scale + 0.5) / self.sc...
by glass2d
Thu May 09, 2024 2:48 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

I wanted to have a look at the issue, but RL is keeping me quite busy these days. Could you please indicate what kind of movement you want? Specifically, my understanding is that you have a virtual resolution of 480x270 which is the underlying resolution, and you zoom it e.g. by 4 to get 1920x1080 ...
by glass2d
Wed May 08, 2024 10:45 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

It seems like the solution of lowering the max speed to <= 135 resolves the issue for now. However, I'm curious about the underlying cause of this problem. Understanding why it's happening would help me develop a more generalizable solution for similar issues in the future. Can anyone provide an exp...
by glass2d
Wed May 08, 2024 10:06 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

Thanks! Rounding the physics body x and y then setting the x and y to the rounded values improved the snapping issue I was noticing as the player moves along the diagonal, as shown in the gif. However, I'm still noticing some snapping occurring as the player moves in relation to the background. Spec...
by glass2d
Wed May 08, 2024 8:00 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

I tried what you're describing but I get the same "vibration" behavior as shown in the gif above. Observe how the fountain asset moves back and forth as the player moves along the diagonal. Here is my code... utils.lua (Fn from Programming_in_Lua,_4th_ed._(2017)) function round(x) local f ...
by glass2d
Wed May 08, 2024 3:30 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

I'm open to sharing my project publicly since I'm currently using placeholder assets. You can find the repository for the top-down game I'm developing here [https://github.com/znimon/alchemist]. I'm still encountering issues understanding the root cause of tearing when I scale up both the window and...
by glass2d
Tue May 07, 2024 4:05 pm
Forum: General
Topic: [Help] Techniques for scaling
Replies: 24
Views: 4984

Re: [Help] Techniques for scaling

Here is an example of what I'm seeing when I math.floor both the player and the camera movement. I see snapping in the background tiles during movement especially diagonal movement (FYI I scale the movement vector when the player is moving along the diagonal to limit the max speed)