# Hexagonal Tiles on a rectangular Tilset? How would you automap it?

(Matias) #1

Hi everyone!
This is my first Topic, after some research I came up with a hexagonal grid with rectangular tiles:

Placeholder Tileset:

Example:

this model has the advantage that I can work the unions of tiles. In individual hex-tiles, I have to draw them completly separate or do over 30 different combinations.

But right know I am having trouble finding a solution to use automap or terrains with this tileset, any ideas so I can avoid doing it by hand?

(ThorbjĂ¸rn Lindeijer) #2

Iâ€™m not sure what you mean. The map you show in the screenshot could be done with only two hex tiles. Would you care to explain what 30 different combinations youâ€™d need to â€śwork the unionsâ€ť?

Well, those algorithms already donâ€™t actually handle hexagonal maps correctly, and handling an orthogonal-map-pretending-to-be-hexagonal could be even trickier.

Or maybe it will be possible in some way, if you consider that your â€śhackâ€ť essentially creates a Wang set where you could define for each tile what neighbors it can have on each side. This is something @Benjamin_Trotter could eventually explore as part of his summer project.

(Matias) #3

Hi! Thanks for responding! that was just an example, this is the actual tileset:

tiles â€śbleedâ€ť into one another, so i canÂ´t work with hex-tiles because of all the border combinations, I just did a test:

Im probably forgeting some combinations, but there already over 50.

The idea is to have more than 2 type of terrains interacting, so this would become huge.

IÂ´m gonna reserach about Wang sets, never heard of them before!

(ThorbjĂ¸rn Lindeijer) #4

Ah, those are some nice looking tiles!

You can easily calculate how many. There are 6 sides and each side is one of 2 terrains. So 2^6 = 64 total combinations.

Yes, at 3^6 youâ€™d be having a whopping 729 combinations, which is already unmanageable. Though possibly not every combination would make sense.

In practice, the idea would be to define the color of the sides of each (rectangular) tile, and an algorithm could then use these colors to find tiles that can fit adjacent to other tiles. This algorithm can then be used to keep the map in a non-broken state while editing. It could also be used similarly to the terrain tool, in that you could allow painting with a color and it would find out which tiles to replace based on the new combinations of colors.

For the top and bottom edges of the tiles in your first screenshot, I can see three colors, which would represent â€śgrassâ€ť, â€śsandâ€ť and â€śsand in the middle with grass on the sidesâ€ť. For the sides I can similarly see three variations. If each of your 4 edges can have 3 colors, then you would need 3^4=81 tiles, which appears to be worse compared to using hex tiles though (but an orthogonal map will be more efficient to render and the tiles likely easier to edit).

(Matias) #5

Thanks! We are still working on it, but I dont want to get into more detail until I figure out the technical side, just in case I have to go re-do everything .
Had no idea how to calculate the number of combinations, appreciated!

What do you mean by non-broken?

I Should have moved the grid 2 pixels down, that angle that touches the border of the tile doesnÂ´t affect the color, I count 5 colours per tile.

I also have the problem that I have odd and even tiles(the extra break in color is on the top in one, and on the bottom on the other), so I can never have an even tile is a odd line, adding complexity to the terrain tool

(ThorbjĂ¸rn Lindeijer) #6

Ah, I just meant in a state where all tiles connect visually.

Ah, right, I missed those lines.

Unfortunately I donâ€™t think I can help you further right now. I hope you will manage to find a good solution!

(Matias) #7

Hi! After some trial and error with automaping I manged to get a set of rules that mostly does the work, it fails at times when I get two conflicting rules, but itÂ´s little work correcting those compared to doing thr whole map by hand.