Wednesday, April 9, 2014

An experiment in dealing with occlusion

One of the fun ("fun") problems you run into when developing an isometric tactics game is that of obscured visibility or occlusion.

With terrain that can take on arbitrary heights, it is very easy to build levels that will allow the player to place their characters right up next to one or more walls, blocking them from view. Any level with moderate complexity will likely afford this situation.


Here's an example from Final Fantasy Tactics. Our hero looks woefully outnumbered, but have no fear. Four of his allies are just on the other side of that building! Let's hope they've got an alchemist able to use Phoenix Downs amongst their ranks..

Information is the key resource in these kinds of games, so when a player can't see the board properly, they will make it very clear to you, the developer, and anyone else they can get a hold of.
  "I hate this annoying camera!"
  "Why can't I just rotate the camera around here?"
  "This game is terrible!"
And all the while the poor designer in charge of the game camera is just trying to line up some quality shots of the action. I feel you, buddy.

I think this tendency to victimize the camera is a learned one for most gamers. Many games give the player some level of control over the camera, so they are accustomed to a certain level of agency when it comes to problem-solving visibility issues. Unfortunately, in most games it is quite difficult to design a flexible camera that will thoroughly empower the player while always creating a compelling composition on screen. Kudos to you if you're making a first-person or top-down game!

So yes, we have implemented the standard Tactics rotate and tilt controls in Hellenica. But recently I've been experimenting with a different approach as well.

From within our editor, I can mark up sectors of the tile map to assign tiles to specific visual groups. Here's what that looks like on one of the levels I showed off last week:


At run-time, the game splits up the environment into separate meshes based on the visual group assignments. This allows me to selectively modify material properties on individual visual groups, properties such as alpha, for instance.

So, what's the point of all of this?

Basically, I can evaluate the camera's position and direction and decide what I want the player to be able to see at any given moment. This is usually a set of characters that should be in view and any highlighted, interactive tiles. If any of these things are obscured by tile geometry, I can pick out the guilty party, and make it temporarily transparent.

Here's a before and after shot:


This is just a first pass at this technique, but I'm pretty optimistic given the results. I have some changes coming down the pipe to clean up the tile geometry a bit which I think will really make this approach work well. Obviously, each additional visual group has a distinct performance cost. That is still something to explore in more depth, but I am not too concerned.

I'm really hoping that this solution will be a win for usability and player happiness as well as visual fidelity. I know I can count on the players to let me know if that's the case in the end.

No comments:

Post a Comment