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 / blank lines when render tiles.

Author
Message
Baraka
12
Years of Service
User Offline
Joined: 4th Feb 2012
Location:
Posted: 7th May 2012 23:14
Hi,
i have a strange problem, i have a world made in tiles of 32x32 with some different layers, the game look very well on emulator and mac but when i run it on device i see many times small lines between tiles. I remember something about it as a problem of some gfx chipset but i never saw it on iOS. Any idea on how to fix ?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th May 2012 14:32
Are the images created to a "power of 2" size (IE. 2, 4, 8, 16, 32, 64) or just the sprites?

If the images themselves are not made to a power of 2 they will be scaled and might show lines between tiles like this.

BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 8th May 2012 18:22
Hi all,
I had this problem displaying tiles a few weeks ago, but in windows when fullscreen. Try using setimagemagfilter(youimagenumber,0) and setimageminfilter(yourimagenumber,0) for each image you load.
Hope it helps.

Regards
Baraka
12
Years of Service
User Offline
Joined: 4th Feb 2012
Location:
Posted: 8th May 2012 21:16
My images for tiles are all 512x512 and yes all other images are all power of 2. The problem happen on PC only in full screen but i saw it now when, with the new version 1071, i'm able to deploy for iOS. On iPod , iPhone and iPad i always see the problem.
Baraka
12
Years of Service
User Offline
Joined: 4th Feb 2012
Location:
Posted: 9th May 2012 19:51
With the setting suggested the problem has been fixed on PC but is still present on the iOS devices.

Any suggestion ?
Baraka
12
Years of Service
User Offline
Joined: 4th Feb 2012
Location:
Posted: 10th May 2012 22:04
I have the same problem, 32x32 sprites and texture 512x512 on PC and Mac seem to work fine but on iOS devices, ipad or iphone nothing. There are a lot of vertical lines like the tiles have sort of distance between them. AppGameKit could be a precision problem ? do you convert float to fixed point ?
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 11th May 2012 08:52
A screenshot of the problem might be handy.

7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 16th May 2012 23:26
Hi, i also have the same problem and i have attached a screen. vertical black lines are easy visible. Could be a precision problem ? We scroll using the viewoffset and when you move the black lines appear and disappear, like when the sprite are rendered sometimes lost their precision. Sprites are always squared polygons so it could possible but how to fix ?

Attachments

Login to view attachments
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 00:22
7Rs can you check the size of the offending sprites? are they odd sized or even sized?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th May 2012 01:04
This might well be another case of SetSpriteSnap(ID,1) being useful, fixed non-rotating sprites with no alpha
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 01:10
Ahhh that damn SetSpriteSnap() pops up again!!!!!

Can we have a GLOBAL setspritesnap on/off command, but leaving the SetSpriteSnap optional to override?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th May 2012 01:30
I can see an argument for it to be default on/off, but for a global SetSpriteSnap command it would be like asking for a global SetSpriteColor command because you want all your sprites to be red by default, and once you start down that route it could easily double the command set.

I would prefer to make as many people aware of this command as possible, so that when they see something like this they know it can be fixed by snapping the sprite to grid.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 08:53
Ok thanks Paul
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th May 2012 13:06
Thanks a lot for the answer, i have another question always related with this.
We have 1 sprite with n frames, depend on tiles amount. When i fill the map i clone the sprite and set the frame of the clone with the tile i want. I must set the snap for all clones or is enough to set it to the sprite master ? In the doc is not reported if the cloned sprite also clone this property.

Thanks.
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th May 2012 16:03
Seem to work, don't need to set clones, the main sprite is enough.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 16:16
Cloned sprites have most of the properties of the main sprite.

How did you solve the black line problem? was it a matter of setting the spritesnap?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 17th May 2012 17:07
Just size your sprite 0.5 pixels larger.

I live for video games! (And beers, and football, and cars!)
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th May 2012 17:45
Mobiius this is no big deal for small projects with less than 50 sprites, but with bigger projects with around 500 different sprites, it's a big hassle to have to manipulate the graphics to make them work.

I have already fixed my Photoshop exporter to generate even sized sprites, as oddsized sprites had artefacts and problems. Don't know if this is still recurring in 1074.
7RS
12
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 17th May 2012 20:37
Hi,
we have used the spritesnap and seem to work pretty well... Now we are trying to improve other things.

Thanks to all.

Login to post a reply

Server time is: 2024-11-23 11:55:04
Your offset time is: 2024-11-23 11:55:04