As I mentioned, I'm pretty new to Cerberus, I figured I'd share my journey so far.
I've always loved the 2D "iso" thing (yes yes I know it's technically dimetric due to foreshortening on the one axis but everyone calls it isometric) and I'm finally getting around to trying to make a game I've wanted to do on some level for a while, it's gone through a few forms and shifts in my head.
The first step was relatively painless, get some tiles drawn, have a Tile class that bothered with knowing which image to draw and its own position, then a class for an IsoMap with a Tile[][][] property.
So far so good, drawing out tiles with mojo isn't especially hard and even I can manage that in a couple of evenings
I did decide to have a twist on it, and render ~6 tiles in each direction from the player, and I got something like so out of it:
Again, no big deal, good with all that (ignore the off-by-one of the character's height, that was later fixed). (The character sprite is... borrowed... from Unity's isometric assets pack until I can actually get a real isometric character sprite sorted, but I have plenty to do first.)
And then I start messing around with Tiled (which I don't have import for yet, but no worries, I can copy/paste for now!)
And suddenly I'm starting to have problems. I know Tiled is rendering my 2x height bricks wrong, but I'm not worried about Tiled getting it wrong.
So let me relate that journey - I will come back to solve it when I'm not being hammered with major integration development work at, well, work.
So, I started out asking here for advice, and got a really interesting pointer to using a shader, and I made the requisite mask images that would do what I think I need to do. The next challenge was porting to mojo2 - in hindsight a simple enough task, but without deep familiarity, it felt daunting but only really took an evening or two to hammer out.
I haven't yet gotten round to understanding how to implement the shader in the way I need to, but mostly because I have to solve something a bit deeper first.
If you've ever tried to implement iso before, you've probably encountered some variant of the Painter's Algorithm problem, making sure that you draw things in the correct order, and drawing the static terrain is relatively straightforward, that's already mapped out in tiles in a convenient grid, so iterating over it in the correct order is easy enough.
Buuuut, it's a bit more tricky when starting to figure out things like 2x high cubes. Now I could split this out into two cubes and insert both into the map data as such, but this doesn't solve some of the other challenges - either cubes that cross boundaries by their dimensions, or cubes being placed not on an actual boundary (like the obelisk which is conceptually a 4x high object placed, in this case, at .5 into a tile)
So I'm currently thinking about how to solve this. The current plan, when I can actually get into the right headspace is to make a single pass when the level is first loaded, to build all of the static terrain into a sort of 3D array structure, where I divide it broadly into cells aligned along the xyz axes, and use that to collect each of the contents of each volume along the axes, which can be used to collect knowledge of which objects (including the character), could inhabit that cell which means collisions can be handled more efficiently, by doing it somewhat locally and can be used to draw things in the correct order.
The problem is that in my head, this feels like an awful lot of computation to be done each frame, hence trying to start by computing all the static geometry at level load, cloning that as a base, then running each of the level entities' update routines to calculate updated positions for that frame, and as part of that, applying it into the 3D grid so it can be iterated over correctly and rendered.
But I'm probably over-worrying and over-fretting because this seems way more daunting to execute, but I'm pretty sure right now that issue is mostly because my professional world is... complicated... right now.
So that's my journey so far. I'll try to remember to write more as I solve it, but right now I hear PHP + MySQL calling...
I've always loved the 2D "iso" thing (yes yes I know it's technically dimetric due to foreshortening on the one axis but everyone calls it isometric) and I'm finally getting around to trying to make a game I've wanted to do on some level for a while, it's gone through a few forms and shifts in my head.
The first step was relatively painless, get some tiles drawn, have a Tile class that bothered with knowing which image to draw and its own position, then a class for an IsoMap with a Tile[][][] property.
So far so good, drawing out tiles with mojo isn't especially hard and even I can manage that in a couple of evenings
I did decide to have a twist on it, and render ~6 tiles in each direction from the player, and I got something like so out of it:
Again, no big deal, good with all that (ignore the off-by-one of the character's height, that was later fixed). (The character sprite is... borrowed... from Unity's isometric assets pack until I can actually get a real isometric character sprite sorted, but I have plenty to do first.)
And then I start messing around with Tiled (which I don't have import for yet, but no worries, I can copy/paste for now!)
And suddenly I'm starting to have problems. I know Tiled is rendering my 2x height bricks wrong, but I'm not worried about Tiled getting it wrong.
So let me relate that journey - I will come back to solve it when I'm not being hammered with major integration development work at, well, work.
So, I started out asking here for advice, and got a really interesting pointer to using a shader, and I made the requisite mask images that would do what I think I need to do. The next challenge was porting to mojo2 - in hindsight a simple enough task, but without deep familiarity, it felt daunting but only really took an evening or two to hammer out.
I haven't yet gotten round to understanding how to implement the shader in the way I need to, but mostly because I have to solve something a bit deeper first.
If you've ever tried to implement iso before, you've probably encountered some variant of the Painter's Algorithm problem, making sure that you draw things in the correct order, and drawing the static terrain is relatively straightforward, that's already mapped out in tiles in a convenient grid, so iterating over it in the correct order is easy enough.
Buuuut, it's a bit more tricky when starting to figure out things like 2x high cubes. Now I could split this out into two cubes and insert both into the map data as such, but this doesn't solve some of the other challenges - either cubes that cross boundaries by their dimensions, or cubes being placed not on an actual boundary (like the obelisk which is conceptually a 4x high object placed, in this case, at .5 into a tile)
So I'm currently thinking about how to solve this. The current plan, when I can actually get into the right headspace is to make a single pass when the level is first loaded, to build all of the static terrain into a sort of 3D array structure, where I divide it broadly into cells aligned along the xyz axes, and use that to collect each of the contents of each volume along the axes, which can be used to collect knowledge of which objects (including the character), could inhabit that cell which means collisions can be handled more efficiently, by doing it somewhat locally and can be used to draw things in the correct order.
The problem is that in my head, this feels like an awful lot of computation to be done each frame, hence trying to start by computing all the static geometry at level load, cloning that as a base, then running each of the level entities' update routines to calculate updated positions for that frame, and as part of that, applying it into the 3D grid so it can be iterated over correctly and rendered.
But I'm probably over-worrying and over-fretting because this seems way more daunting to execute, but I'm pretty sure right now that issue is mostly because my professional world is... complicated... right now.
So that's my journey so far. I'll try to remember to write more as I solve it, but right now I hear PHP + MySQL calling...