Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Seams visible between sprites while moving

Author
Message
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 3rd Jan 2013 18:21
For some reason I can see the seams between my sprites when the screen is moving. If I just stand still everything looks perfect but when I move I see all kinds of seams. I already have setSpriteSnap and SetSpriteUVborder set to 1 for all my sprites. Is there another setting I may need to fix this problem? Thanks.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jan 2013 18:47
Are the dimensions of the images power of two? This seems to help some people.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 3rd Jan 2013 19:10
There seems to be only one spot that I have the issue and it is with a 64 X 48 texture. I use the texture many times and there is one seam that spans between about 10 of them but not the others. I might post a video tomorrow showing my issue as it isn't constant with the same texture over the whole map.
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 4th Jan 2013 05:49
How are you moving your images? Are you altering the actual X,Y positions of the sprites, or the entire view using the SetViewOffset-command?

If the former: I've noticed small seams becoming visible when I scroll tiles using non-rounded floats instead of integers.
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Jan 2013 16:55
Thanks Zerotown. That seemed to be the problem. I changed the floats to integers and my seams disappeared.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Jan 2013 17:34
Yes I have seen similar issues a few times. Unfortunately it makes for some problems if you need to go below 1 as you sometimes do for a slow moving object. I have yet to find a good solution other than not using floats. It is an odd one, as I have never seen it in other languages before, such as DB, DB Pro and AMOS for instance. you were free to use any value you wanted with no issues like this.
Using SetDefaultMagFilter( 0 ) and the min option can help, but it still does it occasionally.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Jan 2013 17:53
You should be able to use floats and not have a problem, can you send me an example of this happening and I'll take a look.
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Jan 2013 18:02
I will get you a copy. I have to go and change everything back to floats, so I might not get time until later tonight or tomorrow.
TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 4th Jan 2013 18:09
I had a similar problem with scrolling tiled backgrounds. To fix it I ended up Flooring the new sprite position :
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Jan 2013 18:34
Basically you did the same thing since floor and ceil will round the float. Which then makes it a whole number which is just like an integer.
TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 4th Jan 2013 19:06
I understand what floor does I was just providing an example.

What I found was that using GetSpriteX on each tile in a scrolling group without rounding would show the small gaps. But if I based all the calculations from a single sprite GetSpriteX then I did not need to round the new sprite postions.
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Jan 2013 19:29 Edited at: 4th Jan 2013 19:30
TrezSoft - Ah ok understand.

Here is my files. Have fun going through my mess of code. Most of my floats are in a file called movement.agc. Watch the video first so you know how to move around and get the sprites to show and know where to look for the seams. It is unedited and rough but gets the job done. The password is abc123.

http://www.kobaltic.com/COR.7z

Login to post a reply

Server time is: 2024-05-06 15:22:56
Your offset time is: 2024-05-06 15:22:56