Skip to main content
The 2024 Developer Survey results are live! See the results

# Questions tagged [hexagonal-grid]

A regular tesselation of a surface where regular hexagons are used for grid tiling.

92 questions
Filter by
Sorted by
Tagged with
0 votes
1 answer
472 views

### Which way to subdivide a hex grid?

Here are, it seems, two ways to draw a smaller grid of tiles from an initial hexagon: On the left, we halve the side length $s$ and create most of the new tiles centered at the midpoint of sides. ...
17 votes
4 answers
11k views

### Pleasing isometric hexagons

What angles and long-side/short-side ratios give the most aesthetically pleasing and graphically regular isometric (squashed and flat side up) hexes, that additionally resolve to whole pixel sizes for ...
0 votes
1 answer
702 views

### Placing rectangular outlines on a hexagonal grid

I'm prototyping a base-building game that uses a hex grid as the basic structure. Hex grids have benefits, but when humans want to build buildings or divide up space, they usually use square/...
3 votes
4 answers
733 views

### How to sub-divide a hexagonal grid reference system

I have been using @amitp's excellent guide (and javascript library) to create a hexagonal grid system https://www.redblobgames.com/grids/hexagons/. I'm using flat-top, inverse-y cubic/axial system. ...
7 votes
1 answer
899 views

### How can I create a six sided tillable perlin noise image?

I'm attempting to create a tillable hex shaped terrain map using c++. As part of the process I'd like to use perlin noise, but it seems that in order to make it tillable I'll need to generate it 5 ...
4 votes
1 answer
502 views

### Find a encircliement in Hexagonal grid (optimization issue)

I have a hex grid of 10000 cells (100x100). The player can grab a cell next to one of his cells (borders). If the player has formed a ring after placing a cell, I want to get a list of cells that ...
1 vote
0 answers
120 views

### Improve performance of hexagonal tiles

I am trying to create a game similar to a board game on a hexagonal grid (also similar to Civilization game). I want the tiles to be able to display various textures and of course be able to detect ...
11 votes
2 answers
11k views

### How do I rotate a structure of hexagonal tiles on a hexagonal grid?

My 2D isometric game uses a hexagonal grid map. In reference to the image below, how do I rotate the light blue hexagon structures by 60 degrees around the pink hexagons? EDIT: Main hex is (0,0). ...
6 votes
6 answers
6k views

### Technical differences between square and hexagon for a grid?

I'm developing a 2D city-building game and trying to decide on the type of grid. There will be vehicles, so the unit movement is important too. I know there are visual differences for using Squares ...
60 votes
6 answers
33k views

### Vertical vs horizontal hex grids, pros and cons [closed]

With hex grids, you can choose to arrange the tiles with the pointy sides up, so that you can move along the west-east axis, or you can arrange them with an edge up, so that you can move along the ...
7 votes
3 answers
1k views

### Inconsistent movement / line-of-sight around obstacles on a hexagonal grid

In a roguelike game I've been working on, one of my core design goals has been to allow the player to "Play the game, not the grid." In essence, I want the player's positioning to be tactical because ...
0 votes
2 answers
348 views

### How to find words on a hex grid

I am trying to make a hex grid based word game. Currently the words are placed from a list of pre-defined words(a list of animals in this case). All colored cells make a word that was placed, while ...
0 votes
1 answer
311 views

### Struggling with breadth first search for hex grid

I cant seem to get breadth first search right. Ive gone through redblobs implementation guides of hex grids and have that all figured out but pathfinding is proving to be difficult. So I have a search ...
2 votes
2 answers
511 views

### Finding nearby tile objects with a certain tag more easily

I have generated a grid with hex tiles. I am using two different types of tiles and would like to at some points ask the tiles, how many tiles of each type they have as neighbours (or really, it would ...
4 votes
3 answers
355 views

### Elegantly transition from 4-grid to 6-grid and back

I find in general map creation that I prefer hex grids for natural environments, but square grids for interior and urban/constructed environments. Is there a smooth or elegant way to transition ...
13 votes
7 answers
12k views

### How can I implement hexagonal tilemap picking in XNA?

I have a hexagon tiled map in which I need to check when a hexagon is clicked. The hexagons aren't actually touching, rather they have a slight gap in between each of them. Does anyone know how could ...
0 votes
1 answer
321 views

### Best ways to navigate a single step on a hexagonal grid depending on input

Problem In my puzzle game, the player moves one step at a time on a hexagonal grid. (Not an action game.) The sequence of steps is important for the gameplay, so it is not only about getting from A ...
2 votes
2 answers
2k views

### Converting hexagon grid coordinate system

I have been building a RTS game based on a hexagon grid in JavaScript and I stumbled across a problem regarding the coordinate system. I have been trying to implement an A-star system to find paths, ...
16 votes
3 answers
14k views

### Finding shortest path on a hexagonal grid

I'm writing a turn based game that has some simulation elements. One task I'm hung up on currently is with path finding. What I want to do is move each turn an AI adventurer one tile closer to his ...
10 votes
6 answers
12k views

### How do I get pixel to hex coordinates on an array based hex map?

I'm trying to make a pixel to coord function for a hex map but I'm not getting the math correctly, everything I try seems to be a little off, and the examples I've found were based on circled centered ...
1 vote
1 answer
696 views

### Why does my tile palette not arrange nicely?

I made my own Hex Point Top Tile sprite sheet, ensuring it's pixel perfect and align well. Slicing in Sprite Editor has no problem too. However, when I drag the sprite sheet to a new Palette in the ...
2 votes
1 answer
593 views

### Formula for attack range using hexagons

I need a little help with a formula to calculate the attack range for my turn-based strat game. Since it's a hexagon grid, I'm having trouble coming up with a formula that would pick the character ...
9 votes
4 answers
6k views

### Is there a library that handles hexagon tiled 2D maps? [closed]

It would represent a map that is semi-square of arbitrary size. It would have a simple system for representation of the map coordinates, such as 0101 (first column, 1st hex). I'd want the map to be ...
0 votes
2 answers
215 views

### Touch control pan 3D map

I'm working on recreating the board game "Hex" as a mobile game. I'm working on implementing zoom and pan features using two fingers. I feel like I managed to get the zoom to work, but the ...
6 votes
3 answers
3k views

### How do I sort edge tiles for a hex grid in order to draw a border?

I am trying to sort the edge tiles of a region in my hexagon map. Once it is properly sorted, I can then try to walk through them and attempt at creating a Civ style border map, but I can't seem to ...
1 vote
1 answer
234 views

### Finding equivalent axial coordinates for a wrapping hexagonal map of radius n

I'm creating a wrap around hexagonal map that will potentially render infinatly. With the method I'm using, I have an x-y coordinate I use to find it's equivalent axial coordinate with the equations:...
7 votes
1 answer
4k views

### Converting between Spiral Honeycomb Mosaic and axial hex coordinates

There seems to be quite a lot of logic in dealing with hexagonal grids using a system of axial coordinates like the one described here. In doing some reading about hex grids, though, I ran across the ...
10 votes
3 answers
3k views

### Showing range on hexagonal grid

Here is the situation. I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range. My solution ...
13 votes
6 answers
5k views

### Efficient Algorithm for the boundary of a set of tiles

I have a grid of tiles of a known finite size that forms a map. Some of the tiles inside the map are put into a set known as a territory. This territory is connected, but nothing is known about its ...
0 votes
2 answers
425 views

### Calculate size of hexagonal map libgdx

I have a staggered hexagonal map created with "tiled" map editor and I want to calculate the height of this map in pixels, the example map below should be ...
4 votes
1 answer
630 views

### How to efficiently (no pointers) store hex grid with shared edges and vertices?

I have a hex grid stored in a 2d array; now I want to add some properties to the edges of the grid (e.g. rivers between hexes) and also potentially to the vertices. How can I store edges and vertices ...
0 votes
1 answer
130 views

### Generate a HexMap where each tile has a different tile on each edge

I’m trying to generate a 7*13 hexmap, with 9 different types of tiles, numbered 0 through 8. I need the map to be randomly generated on each run and it has to be so that each tile has a different ...
1 vote
1 answer
501 views

### How can I seamlessly animate textures across tiles like in Civilization 6?

I am trying to make a much simpler version of the graphic effects we see in the game Civilization 6. This question applies to the graphics on land and ocean tiles. But I first noticed this effect on ...
1 vote
1 answer
193 views

### Looking for a square-to-hex pixel coords algorithm

So as the headline suggests, I am looking for an algorithm/algorithms used for square-to-hex and hex-to-square pixel coordinates convertion. I have an image which looks kinda "interpolated", meaning ...
4 votes
3 answers
5k views

### Creating a hexagonal wraparound map

I'm trying to create a wraparound map for a hexagonal map, so when you exit a tile on one side of the big hexagon-shaped map, you enter a tile on the other side. Example image from Red Blob Games ...
0 votes
1 answer
103 views

### Get range of hexagon based on specified center

I have this method to get the cells inside a given N range: ...
1 vote
2 answers
673 views

### Find hexes on a hex grid given an angle

I'm trying to find an elegant solution to calculating the x, y values of hexes that are crossed or intersected by a line or ray at a given angle from a given hex position on a hex grid. I do not want ...
5 votes
1 answer
359 views

### How to determine what hexes are in an area bounded by 3 hexes

I've been searching for hex grid algorithms for a while now, but I'm not having much luck. I'm working on a game that will be using hex grids for the board. There seems to be sufficient resources to ...
3 votes
1 answer
127 views

### Preferred option for indicating player's movement choices on a hexagonal grid on touch [closed]

I'm building a prototype turn-based game and I'm considering the best approach for user interaction with the game board. It's a hexagonal grid, where the user can select units and move to other cells ...
1 vote
1 answer
357 views

### Subdivided Icosahedron Hex/Pent grid efficient rendering?

How to performantly display a hex/pent grid on a subdivided icosahedron? I have a subdivided icosahedron planet used as the "board" for a strategy game. It usually has anywhere between a few thousand ...
3 votes
0 answers
285 views

### Batch z-ordering problem in Cocos2d (Python)

I have a weird problem with my hexmap drawing code. My code uses "squished" hexagons to achieve a pseudo-isometric view. Because of that, the order of drawing them on screen matters a lot. ...
1 vote
0 answers
56 views

### Selecting a range of hex tiles within radius of main tile [duplicate]

What I'm doing is pretty new to me, or at least I think it is, so I'm not really sure of what I'm looking for. Hopefully someone here knows =-) Using a grid of hexes I generate, I can hover over any ...
10 votes
3 answers
6k views

### Storing a hex grid

I've been creating a small hex grid framework for Unity3D and have come to the following dilemma. This is my coordinate system (taken from here): It all works pretty nicely except for the fact I have ...
4 votes
0 answers
279 views

### Magnitude of a vector in Generalized Balanced Ternary?

Generalized Balanced Ternary is a fairly obscure but very elegant method of indexing a hex grid, using only a single integer coordinate. Operations like addition and multiplication on these ...
4 votes
1 answer
3k views

### Pathfinding in hex grid based game

I'm making a TBS using a hex grid. Player can move units from one hex to another using bridges, which will be randomly generated. I'm using cubic and axial coordinate system for my grid, it's well ...
4 votes
2 answers
2k views

### Pointy top hexagonal A* pathfinding

I'm trying to create a game with a hex based map with the points at the top. I have most of it working, however the path finding is being a little awkward. The heuristic I'm using is called Euclidean ...
29 votes
5 answers
19k views

### How to create a hexagon world map in PHP from a database for a browser based strategy game

I'm trying to create a hexagon world map for my PHP browser based strategy game. I've created a table in my database with the following data per row: id, type, x, y and occupied. Where type is the ...
18 votes
2 answers
6k views

### Get ring of tiles in hexagon grid

Thanks to this post: Hexagonal tiles and finding their adjacent neighbours, I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of ...
2 votes
2 answers
202 views

### Moving a continue condition into the for loop produced something NOT logically equivalent?

I'm setting up a hex grid. The column/row system I use puts 0, 0 as the top left corner, and increasing columns (x) moves to the right but also vertically upwards. So columns run straight up and down, ...
14 votes
4 answers
2k views

### Generate equal regions in a hex map

Taking for example a large (X by Y) hex map, how can I divide it into N regions of connected hexes to simulate countries? The goal is to generate a hex map that looks like a real life map with ...