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 / Atlas texture glitches

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th Feb 2013 14:49 Edited at: 16th Feb 2013 14:57
Hi all. I've encountered this problem before, but have always managed to mostly, avoid the problem in most projects. It is a horrible flicker that can occur when scrolling the screen.



You will notice an occasional glitch as the screen scrolls about. I have set the default zoom and min zoom settings, and also disabled smoothing to avoid the nasty edges you get on a lot of sprites when enabled. I still have this horrible glitch, which will probably only get more noticeable as I add new stuff in.

Has anyone worked out any way to defeat this bug altogether? AppGameKit has suffered with the problem since launch and I am amazed more people don't have issues. The only method that tends to help that I have found is to ensure that you don't go below 1 pixels in a scroll. However I am using physics for this and don't have a massive choice on the scroll speed here.

I am using 1076 with windows 7, although the flickering would happen on any device I care to test it on. I am also using a aspect ratio rather than setting the resolution for this project. I am unsure if this would make the flicker more or less likely, but at the moment it seems worse than any other projects I have done so far.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 14:57
Can you add/upload a working glitch example source code?
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 16th Feb 2013 15:14
DVader try the 2D Camera Function I posted last week.
http://forum.thegamecreators.com/?m=forum_view&t=203532&b=41


Just remove any of the existing scroll code. Include the Camera Lib
and point the camera at the object you want to track.

If you try it let me know if it works for you.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Feb 2013 15:43
Have you tryed the old fix off adding 0.5 on the sprites size?

This will make them slightly overlapp each other and have solved it for me many times.

If your sprites are 1 pixel in size so add only 0.1 and increase until the gapps vanishes.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th Feb 2013 16:05
@ Markus, I have wrote a little demo that exhibits the same issue.


You may get it to work with any image, but probably best to use the one I am using, as the frame image of the sprite seems to have a bearing on whether it will glitch or not. You should see horizontal then vertical glitches before it gets to the end.

@ TrezSoft, I doubt it is an issue with the camera offset. I am fairly sure it is a UV issue, and I am not using UV scrolling. I will have a look at your camera function, but am fairly sure the standard AppGameKit commands I have used to follow the ball will be okay.

@ Cliff, as I am placing the sprites in a grid, I am not quite sure how this would work. If I alter the size they will just overlap incorrectly and not fit together. I have thought about trying something like it, as the glitch is basically one of the edges of another frame being displayed incorrectly by AGK. So by removing any solid pixel from all the edges would fix it I believe. However I imagine that the clear edges would be visible all of the time, unless you can change the UV to stretch the smaller image across all of the sprite.

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 16:49
anti glitch
SetSpriteSnap ( tile[x,y], 1 ) //MR
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th Feb 2013 17:31
The setspritesnap makes no difference to the glitch unfortunately. I have tried that before with no luck. I am setting it when I generate the sprites again just to check, but I still have the glitch.

Annoyingly, it seems to work in the little test code I posted, but not in the actual game The only real difference between the demo and game I can see is the use of physics. I'm fairly green with that still so maybe it is connected.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Feb 2013 17:41 Edited at: 16th Feb 2013 19:55
hmmm,
are you sure your pics in the tilemap are at a pixel perfect position?
i mean 0-31 32-63 64- ...
edit: i think yes, i paint something with paint in a grid

edit:
this works with your test code too. but similar the snap.
SetSpriteUVBorder( tile[x,y], 1 )
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 16th Feb 2013 17:59
Any chance you can post the original with the physics ?.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th Feb 2013 19:56 Edited at: 16th Feb 2013 19:56
@ Markus as far as I am aware, I am placing the tiles as above. I have the almost the same grid setup as I posted in the demo, just a little larger, something like 29x20, but that should make no odds. I'll try the uvborder code out as well, I forgot about that one.
@ TrezSoft, possibly, if I cannot find a solution.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Feb 2013 02:35
Quote: "@ Cliff, as I am placing the sprites in a grid, I am not quite sure how this would work. If I alter the size they will just overlap incorrectly and not fit together. I have thought about trying something like it, as the glitch is basically one of the edges of another frame being displayed incorrectly by AGK. So by removing any solid pixel from all the edges would fix it I believe. However I imagine that the clear edges would be visible all of the time, unless you can change the UV to stretch the smaller image across all of the sprite."

I had the same issue like you in my platformer engine and i used a grid

It solved the issue for me by adding 0.1-0.5 on its size.

The error you get is an fact that opengls 2d is not true 2d but 3d with an camera view to simulate 2d.

So the glitch you get is when the sprite depth and camera at some occasions mismatch and give you this glitch on the edges.

This is solved by adding a slight correction value on tiles that are close together so they slightly overlapp each other.

This is most comon when scrolling on the x cordinate.

So try it !

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Feb 2013 08:16
self painting , works only with setuvborder



DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Feb 2013 14:38
Okay, I went to try setting the UV co-ords today, and noticed a slight error I has made in my haste. So now I have put the setspritesnap into the load routine, rather than the delete routine, lol, and it appears to be glitch free (so far). So I think that has fixed it and it was me being too fast swapping between the game, test prog and forums, not checking that I put it in the right place! Which would normally cause issues . I apologise if you have spent much time wondering why it wasn't working for me, as it was fine, just me being in a rush to do too many things at once.

Thanks all for the help! It seems that this problem may be finally beaten. Strange it didn't work on Obliterator, as I played extensively with the snap commands to avoid a similar issue in that with no luck, and that was in the right place !

Login to post a reply

Server time is: 2024-11-24 07:41:37
Your offset time is: 2024-11-24 07:41:37