Can't remember if I posted something like this before, but if I did I probably would have my answer.
Anyone know any good methods for isometric view? Kinda like Diablo 1, or XCOM. I think the tutorial thing on the wiki is just for more like a face forward type deal.
I think I achieved the look before somehow... But it involved skewing and a lot of jazz hands to get it to look isometric from a basic grid. Which might be difficult if I wanted to draw something that wasn't a grid it'd be contorted.
I'm not really sure how to approach it. I though I could just have every tile, like in a sprite sheet be in that kind of diamond shape and just do some manual offseting in x and y to line them all up.
Then comes the question of drawing things behind the other. I'd guess that I could do a table sort on everything (entities and map and the like [may forsee a problem with having to get agents to draw in front of some tile pieces and behind some others. So I may have to put them in the same table O.o that would at least be my idea of a fix...]).
The more I think of a problem, and my probable way of fixing and implementing, the more I think I'm just going to make it run so over engineered that it would be unplayable when drawing just like 80 tiles .
Isometric
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Isometric
Take a look at:Zilarrezko wrote:I'm not really sure how to approach it. I though I could just have every tile, like in a sprite sheet be in that kind of diamond shape and just do some manual offseting in x and y to line them all up.
http://2dengine.com/doc_1_3_10/gs_isometric.html
and
http://2dengine.com/doc_1_3_10/gs_tiling.html
Generally, this is a question of iterating the map in starting from the top rows going down.Zilarrezko wrote:Then comes the question of drawing things behind the other. I'd guess that I could do a table sort on everything (entities and map and the like [may forsee a problem with having to get agents to draw in front of some tile pieces and behind some others. So I may have to put them in the same table O.o that would at least be my idea of a fix...]).
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: Isometric
It's a bit more complicated than I thought implementing this...
It'll take me a while, having to scrap stuff and the like. But thanks for the tutorial!
It'll take me a while, having to scrap stuff and the like. But thanks for the tutorial!
Re: Isometric
If you check out my STI library (linked in my sig), I have code that takes an orthogonal grid and renders it isometrically. Perhaps that'll be useful to you.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: Isometric
Maybe. Not sure what a tiled library would do for me, since I won't be using tiled. And I'm not sure how orthogonal grid to isometric would be handled for graphics, although I'm sure that would be fine.Karai17 wrote:If you check out my STI library (linked in my sig), I have code that takes an orthogonal grid and renders it isometrically. Perhaps that'll be useful to you.
I'll check out the source code... Where is the orthogonal to isometric part in your repo?
Re: Isometric
The code isn't Tiled-specific, it simply translates Isometric space to/from Screen space.
https://github.com/karai17/Simple-Tiled ... p.lua#L937
https://github.com/karai17/Simple-Tiled ... p.lua#L937
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: Isometric
I'm having some trouble with recognizing the mouse over a tile in diamond (haven't tried staggered). I'm not sure what the problem is, it would probably help if I knew what was going on. The link to that source code showed some behind the scene camera magic. Or maybe I'm wrong and I straight up don't know what I'm doing.ivan wrote:Take a look at:Zilarrezko wrote:I'm not really sure how to approach it. I though I could just have every tile, like in a sprite sheet be in that kind of diamond shape and just do some manual offseting in x and y to line them all up.
http://2dengine.com/doc_1_3_10/gs_isometric.html
and
http://2dengine.com/doc_1_3_10/gs_tiling.html
Generally, this is a question of iterating the map in starting from the top rows going down.Zilarrezko wrote:Then comes the question of drawing things behind the other. I'd guess that I could do a table sort on everything (entities and map and the like [may forsee a problem with having to get agents to draw in front of some tile pieces and behind some others. So I may have to put them in the same table O.o that would at least be my idea of a fix...]).
Here's my project so far, it's very very messy. Where I implemented the selecting tile with mouse is map.update in the map.lua file. I'll continue to try and get this to work. I'll let you know if I fixed it so you don't have to go through trouble.
Re: Isometric
At the very bottom of map.lua in sti, there are functions that convert world space to and from screen space.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- Zilarrezko
- Party member
- Posts: 345
- Joined: Mon Dec 10, 2012 5:50 am
- Location: Oregon
Re: Isometric
oh... I was.. talking... about... Ivan's tutorial >.>Karai17 wrote:At the very bottom of map.lua in sti, there are functions that convert world space to and from screen space.
<.<
>.>
Re: Isometric
A couple of things about the code that converts mouse position to tile index:Zilarrezko wrote:I'm having some trouble with recognizing the mouse over a tile in diamond (haven't tried staggered). I'm not sure what the problem is, it would probably help if I knew what was going on. The link to that source code showed some behind the scene camera magic. Or maybe I'm wrong and I straight up don't know what I'm doing.
-it's designed to work with tiles tilted at 30 degree. in short "atan(tile_width/tile_height)" should equal 30
-for diamond ordering (mx, my) the "mouse position" needs to be in "map coordinates" where the origin (0, 0) is the center of the left tile in the diamond
-lastly, they Y axis increases in the up direction whereas in Love2D the Y axis increases down so keep that in mind with things like "my = math.ceil(-ty/tile.width)"
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 92 guests