Depth sorting flickering on same tile

All things HTML5 or text based engines, or really any web based engines.
Post Reply
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Depth sorting flickering on same tile

Post by robaldred »

I have a test using isometric, when objects end up on the same time, the depth sorting seems to flicker every frame
[youtube]http://www.youtube.com/watch?v=DBaQcZDxFrM[/youtube]

Is there anyway to fix this without manually setting a Z offset for everything individually?
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: Depth sorting flickering on same tile

Post by coolbloke1324 »

Hey ya,

Technically the engine doesn't know what to do when two objects exist at the same location because they effectively share the same depth. The flickering is caused because on every frame the depth sorter checks the order based on the current order of the entities so they end up getting flipped around over and over.

Theoretically two items shouldn't occupy the same space at the same time... I can't think of a game mechanic where it would make sense to have two items at the same place... usually they would be stacked along the z-axis or something like that.

If you really NEED two objects to occupy the same space and not flicker then I guess I could investigate a solution in the depth sorter but it is a very complex part of the engine so I'd be hesitant to change anything in there unless it was a major issue for you. Does your game allow for two sheep to exist on the same tile?
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: Depth sorting flickering on same tile

Post by robaldred »

Hey,
The particular thing I'm working on is just a prototype of some AI characters interaction with a player.
I guess a could adjust the translation of the entities across the z axis.

I'm using a TileMap and a TextureMap imported from Tiled.
So things like scenery objects my Trees for example are mounted to the same TileMap as the player and are translated to and occupy the tile as defined in the map.

But I want the player to be able to go to the same tile as the tree. So I have defined in the aStar PathFinder callback that the character does not avoid tiles if they are occupied by a tree.
I'm just experimenting really, and in fact I have a different z translation on the trees so they're not really an issue.

Is this not what you'd expect?

Image
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: Depth sorting flickering on same tile

Post by coolbloke1324 »

robaldred wrote:Hey,
The particular thing I'm working on is just a prototype of some AI characters interaction with a player.
I guess a could adjust the translation of the entities across the z axis.

I'm using a TileMap and a TextureMap imported from Tiled.
So things like scenery objects my Trees for example are mounted to the same TileMap as the player and are translated to and occupy the tile as defined in the map.

But I want the player to be able to go to the same tile as the tree. So I have defined in the aStar PathFinder callback that the character does not avoid tiles if they are occupied by a tree.
I'm just experimenting really, and in fact I have a different z translation on the trees so they're not really an issue.

Is this not what you'd expect?

Image
You could make the tree's 3d bounds very thin. That way a dog could not walk "inside" a tree. Then I think the depth sorter will be able to determine the correct position. Worth giving it a go to see if it works :)
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
Post Reply

Return to “HTML5/Web Engines”