Naming tiles similar how chess names their tiles

Hey, so basically I’m trying to make a tile based strategy game (see Noobs in Combat / Xcom 2 as an example.). And I was wondering, how I could name my tiles by coordinates like chess does it.

Chess example: “X” is the point I want to get coords for. In this case being B3
1
2
3 X
4
A B C D

But instead of letter, I wanted to do numbers as the x coordinate so I can have unlimited tiles to the x axis.

Here is an example of some test map I made:

You can tell the bottom [X] is made out of 4 tiles and the side [Y / Z] is made out of 5 tiles. So for example the Green tile would be at position 2|5

I already tried using positions as a way of getting coordinates but it really didn’t quite work out because they require a starting point (at least the method I tried) and it can get messy if you have tiles for example detached from others.

So I was wondering if someone knows another way of achieving what I’d like to do.
Thanks!

1 Like

im a bit confused on what your problem is, sounds like you’ve got it figured out

you’re always gonna have an origin just by nature of bits & bytes, if you mean like storing positions, then make your own system using attributes/tables

define them in local space relative to wherever the origin of their island is

if it helps then don’t forget you can go negative on the coordinates so that 0,0 may be in the center of whatever grid you’ve got

1 Like