Skip to Content

# Tile Shapes

6 replies [Last post]
Chorkstain
Offline
Joined: 02/21/2010

I'm making a fighting game inspired board game which takes place on a square grid with a 'Manhattan' metric, which is to say, moving diagonally is two moves: up and across, for example.

However, there is a subtle problem with this grid.

Let's say there is one space between you and your opponent. Relative to your opponent, there are eight squares that you could occupy, four that are in 'straight lines' from your opponent, that is, the up, down, left and right squares, and four that are on the diagonals with the vertices of you and your opponent's squares touching.

On the 'straight line' squares, you have one avenue of approach. On the 'diagonals', you have two avenues of approach.

HELP!

I'm sure it's not going to ruin the game, but it's just tearing away at me. Hexagons appear to do the same thing, and pentagons are just ridiculous. The Cairo style pattern has the same problem.

So yeah, I'm quite distressed about this. Could anyone conclusively prove to me that there is no answer to my problem, or supply me with a solution other than having movement measured with a ruler?

EDIT: Seem to have found a solution, just after I posted my cry for help. Regular tessellating TRIANGLES appear to be free of the problem. Has anyone else ever had this problem before?

metzgerism
Offline
Joined: 06/19/2009
A "fighting" game with

A "fighting" game with two-dimensional spatial relationships seems pointless. One dimension should do fine unless it is not always a 2-player game.

That said, hexagons actually do not have this "problem" that you describe. If I understand you correctly, your game does not recognize the diagonal as an 'adjacent' square, so when you are diagonally one space away from your opponent, you are actually two spaces away.

If you don't want to use hexes and are really having problems, you should treat diagonal movement as 1.5x the distance of orthogonal movement (in reality the distance is approx. 1.414x), and treat it as such.

Chorkstain
Offline
Joined: 02/21/2010
Things looking grim.

It could quite easily be more than two player, I suppose. I use the term 'fighting' game loosely - it's more of a dueling deathmatch tactical kind of game. It's about controlling/threatening the game space effectively, sort of like Chess. It's also like a fighting game in that it has a roster of characters with signature abilities. Anyway, I'm getting off-track here. My point is that it must be two dimensional.

I would love to use hexes, but I'm afraid that it does indeed have the same problem. Draw up a hex grid and you will see that this is true.

Anyway I've thought about this a little bit more, and I have a better way of phrasing my requirement of a game board.

For two positions on the space (in which the positions are discrete), I would like for each 'straight' path (the shortest possible path between two points) to be unique in that property. So for the 'grid that doesn't recognise diagonals as adjacent', this does not happen because on the diagonal, there are two 'shortest paths'.

The diagonal movement as 1.5x appears to have the same problem as well. As for my triangle 'solution', it is fine for distance two, but at greater distances there are many cases of multiple 'shortest paths' between two points.

DogBoy
Offline
Joined: 12/15/2009
Use Graph Theory?

I suspect your problem doesn't have a good solution, even with a nonregular grid, but you may find it easier to think about if you use dots connected with lines, instead of spaces connected by edges. (The two representations are interchangeable. )
Your problem requires at least that the smallest cycles have an odd number of edges in them. Work from there...?

Pastor_Mora
Offline
Joined: 01/05/2010
Starting Move & Turning Costs

I most probably didn't get this right, but maybe I did so here it goes. It sounds like an NPC movement pattern.

I assume you keep track to where the character is facing at all times, so:

a) first move must always be ahead
b) you can turn just 1 vertex at a time (60º in triangle pattern, 90º in square)
c) you can advance, turn, advance again and turn again in your move
d) turning costs more movement points (or however you call them) than advancing

This is too easy, I must be wrong...

Keep thinking!

Taavet
Offline
Joined: 08/15/2008
Grids

Maybe with a little more information as to what exactly you are trying to accomplish we could help more.

If I am understanding, regular grids produce the following:
Hexagons: Center hex 'A', 6 adjacent hexes 'B'. All 'B' hexes can directly influence/attack 'A' because they are adjacent. But for some reason this will not work for your game because all 'B' hexes can also indirectly influence/attack 'A' in 2 ways, by first going to an adjacent 'B' on either side and then to 'A'.
Squares: 4 adjacent squares forming a larger square, have 2 that are adjacent and can be directly influenced/attacked as well as 2 ways to indirectly influence/attack the diagonal square.
I couldn't completely follow why Triangles wouldn't work.

Essentially with a grid the pattern is repeatable so over a distance there will always more then one way to get from point A to point Z.

My only other thought since Triangles seem the closest would be an offset triangle pattern. Imagine the following all pushed together. So the point of point triangle is in the bottom middle of the other triangle. There would be 4 adjacent spots with direct access and then two diagonal, but those diagonal triangles would have 2 space indirect access as would 6 other spaces around.

<<<<<<
<<<<<<
<<<<<<

At any rate, I don't think what you are looking for will be found because of this statement: "As for my triangle 'solution', it is fine for distance two, but at greater distances there are many cases of multiple 'shortest paths' between two points." Any grid (repeated pattern) will have multiple shortest distances unless you setup dead space/obsticles.

Pastor_Mora
Offline
Joined: 01/05/2010
Movement, not distance

Taavet wrote:
Any grid (repeated pattern) will have multiple shortest distances unless you setup dead space/obsticles.

I don't agree. You are just calculating distances, not movement. By keeping track of unit facing and turning costs, you get a single shortest route that goes over the perimeter of the "inner regular figure" (only turning once is required) through the side you are facing.

The thing is when the target is exactly behind you, then you could set an "interception" course based in the target heading, but this may not solve everything.

KT!

forum | by Dr. Radut