Nav: (Display/Hide) - Home - About the Author / this page

Current Projects: Americana Engine (Game Engine Development)

Saturday, October 5, 2013

Handling Diagonal Movement in Tactical RPGs


Ignore the Battle GUI - it is a mockup and therefore has incorrect information.

Normally Tactical RPGs do not allow diagonal movement, however I propose a system that handles this while factoring in obstacles.

While designing the war system in Americana Dawn, there were previously a few issues about the move range on a character; because the shoot distance is calculated by absolute distance from the character (instead of grid squares) it would create a disadvantage for some units. Also, it creates movement range more like a circle.

If a melee attacker was hit from a diagonal, it would normally take two turns for it to reach the target. The extra turn is a huge difference - the attacker that could otherwise defeat the enemy may not survive the second turn.

I had a few choices, either restrict attack range, or include diagonal movement. Moving based on absolute distance was considered, but it was ruled out since it can get messy at times and might not find the optimal route when tiles are weighted. So a diagonal is calculated as 1.5 movement points. (It might be 1.4 movement points later if the game requires more precision.)

But this is not factoring in the weights of the various tiles, so this is achieved by taking the weight of the diagonal square that you move to, plus the two adjacent squares that you cross getting there, and dividing by two. Thus the formula is:

Movement Cost = (Tile Weight for upper right tile + upper tile + right tile) / 2, relative to the character.

There's situations where a diagonal move takes up more move points than moving two spaces instead, but the game automatically calculates the shortest distance to a tile anyways so it isn't a real problem.

The drawback is being able to get to normally inaccessible tiles via a diagonal move. Consider it as an advantage - the 'creative designing' process should ensure this happens only when it needs to.

I think more of the creative designing should be the AI script for these battles, which is mostly based on the enemy commander's personality, although it usually looks ahead at least a turn and makes decisions only based on what it can see, and will find cover and ambush if possible.

0 comments: