Isometric tile aspect ratio?

Hello

Newbie here. I have been rendering isometric tiles out of a 3D app and built the maps in tiled

Problem is when played in the corona using the million tile engine I’m getting a vertical overlap.

I’m thinking MTE might only work with isometric tile aspect ratios of 1:2, Just checked my artwork and it was at 1:1.72

Is there a way to configure this in MTE to use a different height to an isometric tile? 

Cheers

Hello St3v3,

The 1:2 ratio is hardcoded into MTE. I’m looking into it on my end, but for now I have a simple modification of mte.lua for you to try.

Using your IDE’s search function, find every occurrence of yDelta / 2 and change each to yDelta / 1.72

Go to line 11495; nXy = math.sin(R45) * velX / -2

Change this to nXy = math.sin(R45) * velX / -1.72

Go to line 11497; nYy = math.cos(R45) * velY / -2

Change this to nYy = math.cos(R45) * velY / -1.72

Those changes should correct the positioning for your 1:1.72 aspect ration map and tilesets. Let me know if you hit any snags!

Thanks dyson122

Its sooooo close. Half the edges are slightly overlapped, the other half have a bit of space (appears to be an x distance rather than y). Looks like there is also a point in the map where things get a but awry.

I’m roughing up a test tilset and files so you can see whats up and I can crosscheck what I’m doing-seeing.  :slight_smile:

Thanks again.

Most excellent, bug example code was going to be the next thing I asked for!

hmmm, my previous test dealt mainly with tiles on the edge of the map and they were working pretty good.

This one has tiles across the entire world and is showing some other problems to the center of the world.

Texture Packer, Tiled and Corona source files can be downloaded from

www.shapeshifterdesign.com/stephenftp/isoTest/isoTest.zip     (6MB)

My ISP had a “DNS issue” last night. Any problems downloading and I will put it up somewhere else.

I’m not using the dpad for navigation. There is a hidden physics object sitting on top of the world. Dragging on the screen will move the tiled world. Its still a litte buggy though, more buggy with the isometric tiles it seems. I’m a graphic designer so my code is very prototype.  :slight_smile:

mte.lua has been removed from corona/MTE

I had updated the following lines.

–mte 0v957b 
line 303;        finalY = centerY + (yDelta2 / 1.7368)
line 340;        finalY = centerY + (yDelta2 / 1.7368)
line 5459;        finalY = centerY + (yDelta2 / 1.7368)
line 6406;        finalY = centerY + (yDelta2 / 1.7368)
line 7978;        finalY = yDelta2 / 1.7368
line 8296;        finalY = yDelta2 / 1.7368
line 8372;        finalY = yDelta2 / 1.7368
line 8413;        finalY = yDelta2 / 1.7368
line 8685;        finalY = yDelta2 / 1.7368
line 8931;        finalY = yDelta2 / 1.7368
line 9093;        finalY = yDelta2 / 1.7368
line 12096;        finalY = (yDelta2 / 1.7368)

line 11494;        nXy = math.sin(R45) * velX / -1.7368
line 11496;        nYy = math.cos(R45) * velY / -1.7368

Thanks dyson122, I really appreciate you having a look at the iso maps.

Alright, there appears to be some weirdness going on with the format of the tileset in isoTest.json. Changing the values of lines 33 and 34 from 152, 264 to 156, 268 corrects the positioning of the tiles on my end.

There’s an issue with how the engine handles wrapping the camera from one edge of the world to another. I’ve found the source of the problem but I’m still working on a fix. The symptom of the problem is having one row or column of tiles appear offset slightly whenever the map crosses from one edge of the map to another in certain directions.

EDIT: Lines 11484 and 11485 read ; cameraLocX[i] = floor(cameraX[i] / blockScaleX); cameraLocY[i] = floor(cameraY[i] / blockScaleY); try changing both of those "floor"s to "ceil"s. This seems to have fixed the world wrapping on my end, but it may have introduced other problems.

The tile is 156 x 268 pixels in size.

152 x 264 is the size of the artwork in the tile not including the region of transparent overlap between tiles. Guess it would have been generated with “extrude” in Texture Packer. I created it in photoshop because I couldn’t see how to have it just on the tile edges, not image bounds, and rather than automatically created on every edge that fell to complete transparency. Would loose a lot of crisp interior edges on the tile.

Noticed the world wrap jump.The updates to mte.lua have worked perfectly. 

Its excellent, thank you.

Allowing for different aspect ratios has had me thinking of how different angles of camera to ground could be simulated for diferent maps. Great for a range of purposes and easy to play with once the 3D and photoshop mask is set up.

Hello St3v3,

The 1:2 ratio is hardcoded into MTE. I’m looking into it on my end, but for now I have a simple modification of mte.lua for you to try.

Using your IDE’s search function, find every occurrence of yDelta / 2 and change each to yDelta / 1.72

Go to line 11495; nXy = math.sin(R45) * velX / -2

Change this to nXy = math.sin(R45) * velX / -1.72

Go to line 11497; nYy = math.cos(R45) * velY / -2

Change this to nYy = math.cos(R45) * velY / -1.72

Those changes should correct the positioning for your 1:1.72 aspect ration map and tilesets. Let me know if you hit any snags!

Thanks dyson122

Its sooooo close. Half the edges are slightly overlapped, the other half have a bit of space (appears to be an x distance rather than y). Looks like there is also a point in the map where things get a but awry.

I’m roughing up a test tilset and files so you can see whats up and I can crosscheck what I’m doing-seeing.  :slight_smile:

Thanks again.

Most excellent, bug example code was going to be the next thing I asked for!

hmmm, my previous test dealt mainly with tiles on the edge of the map and they were working pretty good.

This one has tiles across the entire world and is showing some other problems to the center of the world.

Texture Packer, Tiled and Corona source files can be downloaded from

www.shapeshifterdesign.com/stephenftp/isoTest/isoTest.zip     (6MB)

My ISP had a “DNS issue” last night. Any problems downloading and I will put it up somewhere else.

I’m not using the dpad for navigation. There is a hidden physics object sitting on top of the world. Dragging on the screen will move the tiled world. Its still a litte buggy though, more buggy with the isometric tiles it seems. I’m a graphic designer so my code is very prototype.  :slight_smile:

mte.lua has been removed from corona/MTE

I had updated the following lines.

–mte 0v957b 
line 303;        finalY = centerY + (yDelta2 / 1.7368)
line 340;        finalY = centerY + (yDelta2 / 1.7368)
line 5459;        finalY = centerY + (yDelta2 / 1.7368)
line 6406;        finalY = centerY + (yDelta2 / 1.7368)
line 7978;        finalY = yDelta2 / 1.7368
line 8296;        finalY = yDelta2 / 1.7368
line 8372;        finalY = yDelta2 / 1.7368
line 8413;        finalY = yDelta2 / 1.7368
line 8685;        finalY = yDelta2 / 1.7368
line 8931;        finalY = yDelta2 / 1.7368
line 9093;        finalY = yDelta2 / 1.7368
line 12096;        finalY = (yDelta2 / 1.7368)

line 11494;        nXy = math.sin(R45) * velX / -1.7368
line 11496;        nYy = math.cos(R45) * velY / -1.7368

Thanks dyson122, I really appreciate you having a look at the iso maps.

Alright, there appears to be some weirdness going on with the format of the tileset in isoTest.json. Changing the values of lines 33 and 34 from 152, 264 to 156, 268 corrects the positioning of the tiles on my end.

There’s an issue with how the engine handles wrapping the camera from one edge of the world to another. I’ve found the source of the problem but I’m still working on a fix. The symptom of the problem is having one row or column of tiles appear offset slightly whenever the map crosses from one edge of the map to another in certain directions.

EDIT: Lines 11484 and 11485 read ; cameraLocX[i] = floor(cameraX[i] / blockScaleX); cameraLocY[i] = floor(cameraY[i] / blockScaleY); try changing both of those "floor"s to "ceil"s. This seems to have fixed the world wrapping on my end, but it may have introduced other problems.

The tile is 156 x 268 pixels in size.

152 x 264 is the size of the artwork in the tile not including the region of transparent overlap between tiles. Guess it would have been generated with “extrude” in Texture Packer. I created it in photoshop because I couldn’t see how to have it just on the tile edges, not image bounds, and rather than automatically created on every edge that fell to complete transparency. Would loose a lot of crisp interior edges on the tile.

Noticed the world wrap jump.The updates to mte.lua have worked perfectly. 

Its excellent, thank you.

Allowing for different aspect ratios has had me thinking of how different angles of camera to ground could be simulated for diferent maps. Great for a range of purposes and easy to play with once the 3D and photoshop mask is set up.