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 / TIER 2 Isometric Map Problem with Grid Lines in Tile Map

Author
Message
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 12th Jul 2014 04:13 Edited at: 12th Jul 2014 04:14
I've made a very simple code that only draws a tile map in an isometric view to the screen.
The tiles all have tiny white outlines around each one making the map display like a grid instead of being smooth.
It is not an issue with the tile image.
Code is below. Any help appreciated.
Bought AppGameKit about 2 years ago but just now starting to mess with it lol. Image attached also.

Attachments

Login to view attachments
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 12th Jul 2014 17:28 Edited at: 12th Jul 2014 17:29
This is possibly related to anti-aliasing which sometimes occurs along the edges of transparent areas when scaling occurs.

Have a look at the commands;
SetImageMagFilter( iImageIndex, mode )
SetImageMinFilter( iImageIndex, mode )

Which set how adjacent pixels are processed.
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 13th Jul 2014 02:30 Edited at: 13th Jul 2014 02:32
yeah tried messing with those. same result.

I actually tested tiles just regularly square shaped and they do just fine. Only in the iso perspective I get the lines.
I've tried multiple images that are made to fit together.

It gives an outline of the color of the tile, with a darker shade on most, not always white.
Like with a grass tile it might show a dark green edge around each one, when the actual image does not have a darker color around the edge.

Even when I blatantly overlap the tiles it gives an edge on them, so it is not gaps in the images, but AppGameKit is adding a darker color around the images edges, which is just weird.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Jul 2014 02:32
Can you attach your original tile image? I agree it appears to be AA-related and would be able to tell you for sure by loading it with my isometric library. But try Marl's idea first.

FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 13th Jul 2014 02:34
Phaelax does your library use square or rectangle sizes..
like 128x128 with top half of image blank?
or 128x64 with iso tile filling whole image?
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 13th Jul 2014 02:38 Edited at: 13th Jul 2014 02:42
heres a site where i tried using a diff image as an example:
http://mapaonboard.blogspot.com/2012/06/isometric-3d-game-part-4.html

and attached is the result...
pay no mind to the image quality, i shrunk the pic down,
the lines are there to see. they are green in this one.

I'm not sure if it's a precision issue in my drawing code, or just aliasing issue

Attachments

Login to view attachments
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Jul 2014 06:44
Quote: "Phaelax does your library use square or rectangle sizes..
like 128x128 with top half of image blank?
or 128x64 with iso tile filling whole image?"

Wouldn't matter. It'd be a simple line to change to accommodate either or.

FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 13th Jul 2014 06:47
try that one Phaelax

Attachments

Login to view attachments
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 13th Jul 2014 12:05 Edited at: 13th Jul 2014 14:07
got one tile's edge line to be very faint...others still bad..maybe back to checking tile images..lol but i tested the same images and code in libGDX and it showed no lines!
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Jul 2014 18:48
Looking at the image I'm pretty certain it's just a filtering setting in AGK. I didn't have a chance to check it yesterday but I'll try something tonight

Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 13th Jul 2014 23:28 Edited at: 13th Jul 2014 23:29
One thought, if you make the tiles much larger, do the lines get thicker or stay the same.

I would expect thicker lines to indicate an issue at source (the image), whereas as filtering issues would stay at the pixel level.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jul 2014 00:07 Edited at: 14th Jul 2014 00:41
Here's my example code:



At first, everything appeared normal without lines regardless of what image filtering I used. However, I was able to reproduce the line effect by changing the actual resolution in the setup file to 1024x768 but leaving the virtual resolution at 640,480. I corrected the lines by adding this code:




I see where you set the virtual resolution, but what resolution is it really running at? I haven't used Tier 2 so I'm not familiar with its setup, but that could be the problem. Hopefully, setting the imageMagFilter to 'nearest neighbor' will fix it for you.






Quote: "whereas as filtering issues would stay at the pixel level."

I shrunk his image originally from 128 down to 64 and didn't notice any difference in lines. It's clearly a filtering problem I'm sure.

Attachments

Login to view attachments
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 14th Jul 2014 01:19


That works beautifully!!
Thank you very much.

I would've never figured that one out alone lol, pure genius! haha
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jul 2014 03:26
Well Marl did mention those commands

FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 14th Jul 2014 09:57
I wasn't placing the command after the load image command, i think i was using them after the createSprite command lol.
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 15th Jul 2014 18:27 Edited at: 15th Jul 2014 18:27
I done this for my RPG


It is done by my personal Tiled loader for OBJ C.
When the debug is ON the grid is shown.

Long life to Steve!

Login to post a reply

Server time is: 2024-03-29 14:49:57
Your offset time is: 2024-03-29 14:49:57