Questions tagged [hexagonal-grid]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
59 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/...
user avatar
0 votes
2 answers
76 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 ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
2 votes
2 answers
118 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 ...
user avatar
  • 21
0 votes
1 answer
94 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 ...
user avatar
2 votes
1 answer
171 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 ...
user avatar
4 votes
3 answers
318 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 ...
user avatar
  • 792
0 votes
2 answers
64 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 ...
user avatar
3 votes
3 answers
1k 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 ...
user avatar
  • 147
6 votes
1 answer
447 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 ...
user avatar
1 vote
1 answer
98 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:...
user avatar
0 votes
1 answer
346 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 ...
user avatar
  • 131
2 votes
2 answers
318 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. ...
user avatar
0 votes
2 answers
253 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 ...
user avatar
13 votes
6 answers
4k 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 ...
user avatar
4 votes
1 answer
350 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 ...
user avatar
  • 141
0 votes
1 answer
99 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 ...
user avatar
1 vote
1 answer
290 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 ...
user avatar
1 vote
2 answers
445 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 ...
user avatar
  • 111
1 vote
1 answer
157 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 ...
user avatar
  • 15
1 vote
1 answer
980 views

How to convert game object world position to hex grid cell coordinates?

I have a hex grid and a game object, let's say it's the player. What I want to do is know on which cell the player is on based on his world position, this would be easy on a simple grid but on a hex ...
user avatar
2 votes
1 answer
1k views

Finding all hexagonal grid coordinates inside cover arc

I got a turret that points at the corner of hexagon (point A). It can shoot in cover arc that's shown here: I need to check if my target lies within this cover arc. From this tutorial: Hexagonal ...
user avatar
1 vote
1 answer
256 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 ...
user avatar
0 votes
1 answer
94 views

Get range of hexagon based on specified center

I have this method to get the cells inside a given N range: ...
user avatar
0 votes
1 answer
279 views

Finding cells within range on a hexagonal grid

I'm looking for a way to get the cells based on a N range. But no luck. I'm converting Row Column offset to Cube Coordinate system QR -> XYZ ...
user avatar
3 votes
1 answer
143 views

Place hexagons together

Just made it with some more investigation thanks to this site: Hexagonal grid math, but the hexagons have a little bit spacing horizontally. Here is the code: ...
user avatar
4 votes
0 answers
205 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 ...
user avatar
  • 161
3 votes
1 answer
486 views

Algorithm to determine all hexagons within an arc from a starting hexagon

I have a game engine which handles hexagon based war games and things like LOS, etc, for both flat and tip up hexes. A particular game I'm implementing at the moment, Band of Brothers, has facing for ...
user avatar
2 votes
0 answers
113 views

Generating vertices for group of hexagons

I'm working on the map editor of a game, where you can create a grid of hexagons to paint. An example of a grid of radius 6: What I want Once map creation is done, I would like to generate a mesh ...
user avatar
  • 1,237
3 votes
3 answers
4k 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 ...
user avatar
  • 143
2 votes
2 answers
997 views

SDL_RenderDrawLines isn't drawing complete geometry

So I am trying to draw hexagons with [SDL_RenderDrawLines][]. It looks to be working fairly well, however, it fails to draw some of the lines. So each of the ...
user avatar
1 vote
0 answers
275 views

hexagonal grid Mouse over

I've been trying to workout the code that calculates the correct row and column in the mouse is over event the following is the code I'm using to draw the grid Tile are 64x64. ...
user avatar
3 votes
1 answer
1k views

How do I calculate hex coordinates from a ring and index?

I am trying to implement field of view (FOV) in a hex grid. I am using the cube coordinate system from here. Then, I am using shadow casting to find FOV as from here. I have a system like in the ...
user avatar
  • 175
3 votes
0 answers
270 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. ...
user avatar
2 votes
2 answers
198 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, ...
user avatar
  • 308
1 vote
1 answer
802 views

How to get connected tiles in hexagonal grid system

I've been developing a game where a number of tiles can drag into a hexagonal grid background. For some purpose I need to find the location of same tiles into an array and merge them. Data Layer: ...
user avatar
7 votes
2 answers
4k views

How to orient a hexagonal tile on a geodesic sphere (Goldberg polyhedron)?

I've recently ported the hexasphere implementation by Rob Scanlon at https://github.com/arscan/hexasphere.js to objective-c for use in a project I'm exploring. As a port, it works very well, and I ...
user avatar
  • 213
3 votes
2 answers
718 views

How can I detect hex edges and corners for Catan map?

The following messy code implements a decent hex map, but I have no way to detect edges and corners: ...
user avatar
5 votes
1 answer
478 views

Are there definitive, unambiguous terms for hexagon tile orientations?

I have been working on a tile map editor and plan to support two orientations for hexagons. I have seen various terms used, but these all seem ambiguous to me. Horizontal, Vertical (ambiguous: does ...
user avatar
3 votes
3 answers
346 views

What is the easiest way to move towards and along the edge on a hex grid?

I have a hexagonal grid with variable radius. My entity can move exactly two hexes per turn. How should I calculate next step towards border and afterwards travelling clockwise around map? Preferred ...
user avatar
  • 153
8 votes
2 answers
1k views

Finding cells within range on hexagonal grid

First up - I know I'm being super-dense here. With that out of the way, I'm trying to write a C# implementation of this algorithm: ...
user avatar
3 votes
1 answer
122 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 ...
user avatar
3 votes
1 answer
410 views

Coordinate system for a strategy game

I am working on a personal project of developing a simple 3D strategy game. I am working on my own game engine (let's assume that I have to have my own) and I have one theoretical question. How to ...
user avatar
1 vote
0 answers
101 views

Hexagonal tilemap is being distorted

So I made a hexagonal tilemap of ocean tiles and then picked a few tiles to be land. When I pick all adjacent tiles to the hexagon it usually works, but for tiles that are on certain columns it does ...
user avatar
2 votes
0 answers
358 views

Hex axial coordinates to table coordinates conversion

I am developing a browser game based on a hex map. I am storing my data based on axial coordinates system. I developed a function which shows me axial coordinates of hexes within ...
user avatar
  • 173
5 votes
1 answer
1k views

Why is libGDX's HexagonalTiledMapRenderer adding extra space?

Why are there large spaces between the hexes when rendered by HexagonalTiledMapRenderer? The tiles ARE black bordered, but that doesn't account for all the extra space. I was also able to get them ...
user avatar
  • 153
4 votes
2 answers
551 views

Map coordinates system [closed]

I am planning to implement in my game a very big map. I won't be showing all map at once but rather only a selected part of it. Additionally, I would need to connect hexes into bigger pieces (...
user avatar
  • 173
8 votes
2 answers
5k views

How to draw the contour of a hexagon area, like in Civ 5

I am trying to achieve the hexagon contour look you find in Civilization V: I want to outline the area a unit can move to on a hexagon grid, so far I can get a list of all the tiles a unit can move ...
user avatar
  • 177
8 votes
3 answers
4k views

Are there any hex tile sizes where both width and height are integers?

I'm trying to figure out the optimal width and height (in pixels) to start building hex tiles for game development. My preference is for "flat topped" hex grids, but the math is similar for both. I ...
user avatar
  • 201
0 votes
2 answers
1k views

Getting neighbors of hex tiles in 3D space

I have a hex tiled model like attached below. Each of the hex tiles are separate objects meaning I can access each of the hex tiles individually inside Unity Now in my program I want to be able to ...
user avatar
  • 425