Pixel Rounding Issue

Get help using Construct 2

Post » Mon Sep 09, 2013 3:56 am

Hummm. Currently considering giving up, removing camera movement entirely, and having single screen maps, zelda style. I guess that's the fallback plan. Have messed around with some of these ideas but without much luck. I guess upscaling all the art externally to a higher resolution would make the issues far less visible, but that seems like a silly way to do things. A large part of the issue is that because the player sprite is made up of several components, the individual pieces end up disjointed from each other on random frames, so some of these solutions might otherwise work, but not here. Looking at "most acceptable alternative" for now, since it looks like I won't be able to get things exactly perfect without considerable effort.
B
8
S
1
G
1
Posts: 12
Reputation: 1,124

Post » Mon Sep 09, 2013 6:24 am

if you post a generic capx of just the one screen like that i can mess around with it and see if i can get it to work otherwise it would be kind of hard to recreate the multi-object player without seeing more of how you did it.
B
25
S
7
G
1
Posts: 83
Reputation: 2,550

Post » Mon Sep 09, 2013 7:40 am

Might as well, if it could help. Here's the whole thing.
https://dl.dropboxusercontent.com/u/58256916/Test/MQCX.capx
B
8
S
1
G
1
Posts: 12
Reputation: 1,124

Post » Mon Sep 09, 2013 2:19 pm

@Saraqael

May I say how amazing your graphics are?

Also: CAPX

have a look. I fixed the horizontal problem by shaving 1 pixel off EACH side of the Player.boundingBox

I also moved the image point by one pixel vertically, seems to have solved some of the vertical jiggling.


I suspect you need to play with odd and even numbers in your dimensions and image point positions.

Also, it might help to pin your accessories to the player sprite, instead of setting their position. But even then, you need to find what numbers play well with Construct's engine. Remember, if you force Construct to divide a pixel in half, it's going to have trouble deciding which half, which I suspect is the cause of the jitter.

A 1x1 pixel player sprite might work, but then you need a new "player" sprite for collisions and the like.

Let me know if this helps.christina2013-09-09 14:23:32
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Mon Sep 09, 2013 4:11 pm

OK, what gives??

Vertical jittering can't be fixed even if I set the player sprite bounding box to an odd number.

@Ashley could this be a candidate for a bug report? Is there no way to have smooth vertical scrolling at this resolution, when pixel rounding is on? Why does Construct2 treat horizontal and vertical scrolling differently?


@Saraqael However, if you turn pixel rounding off (which makes for smooth scrolling), you can get rid of the seams by making the Height of your tiles 15 instead of 16 in the level editor (not in the sprite editor). That way you are forcing the renderer to ignore a whole pixel, and since the problem seam is less than a whole pixel, you solve it.

Again, this is something that, ideally, shouldn't be happeningchristina2013-09-09 16:16:14
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Mon Sep 09, 2013 4:40 pm

@christina Thank you! Knocking that pixel off seems to work just fine, that'll do me for now. I can't open up that capx as I'm not running the latest beta (and it just failed to download twice in a row, my connection has been poopy all weekend so I'll take another look later today). Should I be aiming for odd numbers in my dimensions? I've been loosely sticking to multiples of 8 just out of habit, hence why all my tiles are 16x16..

Also wow always impressed with how helpful everyone is here on these forums, thank you all of you who've been looking into this. Hopefully somewhere down the line I'll have a game for you all to try.
B
8
S
1
G
1
Posts: 12
Reputation: 1,124

Post » Mon Sep 09, 2013 5:45 pm

@Saraqael you're welcome! We learn stuff from helping; the organization of your CAPX for one. Flawless! I'm stealing it :)

You should still use multiples of 16, it's good practice, and from what I've read it's good memory-wise.

The stitches didn't disappear because of the odd height number. My guess is, the engine is trying to wrap half a pixel from the top into the space that is half a pixel from the bottom. By taking away that pixel, it has nowhere to draw the wrap-around bit.

christina2013-09-09 17:46:24
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Previous

Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, plinkie and 24 guests