Page 2 of 2

Posted:
Wed Jun 21, 2006 2:57 am
by DilloDude
I have just started preparing for an isometric type game, and I have two problems
- I want to be able to walk behind bits of wall, but the wall should go transparent. As far as I know, I can't make just one section of wall transparent unless I make them separate clones. Harder still is adjusting z-depth.
- With tiling, it appears in the editor that the tiles individual z-depth is determined by their order of creation. However, in game mode, it is different. I want to
- have it look the same in the editor as it will in the game, and
- have a means of editing those z-depths
These are the problems I have encountered so far.

Posted:
Wed Jun 21, 2006 3:20 am
by DilloDude
I want to be able to walk behind bits of wall, but the wall should go transparent. As far as I know, I can't make just one section of wall transparent unless I make them separate clones. Harder still is adjusting z-depth.
The best way may be to make each section of wall a clone, then I just have to figure if you are behind it or in front of it.

Posted:
Wed Jun 21, 2006 2:27 pm
by duracel92
I wouldn't use z-depth, Transparency is really much easier, but the game will need to be played on a faster computer... I still like z-depth sorting, it can be helpful.

Posted:
Wed Jun 21, 2006 3:42 pm
by Fuzzy
The real best way to do it is to set the z-depth of the actor with the create actor event. Set the z-depth based on the y coordinate of the actor. The Lowest depth tile is going to be at the top of the screen, and the highest at the bottom.
Once you have that, set your player and monsters depth as well, using the same formula, but with a slight offset.

Posted:
Thu Jun 22, 2006 4:12 am
by DilloDude
I ended up making the walls that overlap bits of ground cut away. Then I added another actor that filled in those cut-offs, and made it transparent, and darker. You then get dark transparent bits. The z still isn't right (you don't go behind them), but oh well. I might make it an option to turn them off if they affact performance too much.

Posted:
Tue Jul 25, 2006 3:25 am
by DilloDude
The basic method of zdepth (yscreen/view.height, or in my case ((yval + (H + 1) * zval) / ((H * 11) + 70)) + .01)works well for some cases, where the actor has a square or round base but where it goes diagonal you could get problems:
- Code: Select all
Above the line is behind, good at ^, not at *
Bolow the line is in front, good at v, not at x
/|\
/ | \
/ | \
| /\ \
| / \^ \
|/ \ \
\ \ \
*\ \ \
---\-----\--+-
\ \x|
v \ \|
\ /
\ /
\/

Posted:
Tue Jul 25, 2006 3:45 am
by DilloDude
One solution would to be to make it out of separate square blocks, but it wouldn't work so well for doors, so they would have to be made square.

Posted:
Tue Jul 25, 2006 10:01 pm
by Game A Gogo
make it like
- Code: Select all
if(zdeph<0.333)zdeph=0.333;
in draw actor, thats what i used in one of my uncoming game so, it dosnt disapear under the grass.