Questions tagged [hexagonal-grid]

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

Filter by
Sorted by
Tagged with
4 votes
1 answer
353 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 ...
ArtemiZ Studio's user avatar
1 vote
0 answers
71 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 ...
I_Keep_Trying's user avatar
0 votes
0 answers
201 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. ...
clwhisk's user avatar
  • 101
0 votes
1 answer
335 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/...
JRandomHacker's user avatar
0 votes
2 answers
249 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 ...
Daniyal Ibrahim's user avatar
0 votes
1 answer
227 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 ...
cwahlfeldt's user avatar
2 votes
2 answers
419 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 ...
Maree's user avatar
  • 21
0 votes
1 answer
225 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 ...
Close Call's user avatar
2 votes
1 answer
418 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 ...
ガビ ユカチノ's user avatar
4 votes
3 answers
342 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 ...
Weckar E.'s user avatar
  • 822
0 votes
2 answers
179 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 ...
Cooper Rutan's user avatar
5 votes
3 answers
2k 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 ...
TyCobb's user avatar
  • 329
6 votes
1 answer
674 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 ...
Knackname's user avatar
1 vote
1 answer
189 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:...
Knackname's user avatar
1 vote
1 answer
576 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 ...
Raptor's user avatar
  • 141
3 votes
3 answers
525 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. ...
George of all trades's user avatar
0 votes
2 answers
369 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 ...
Jose Lopez's 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 ...
ScienceSnake's user avatar
4 votes
1 answer
500 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 ...
Sergey's user avatar
  • 141
0 votes
1 answer
121 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 ...
The Forgotten Machine's user avatar
1 vote
1 answer
394 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 ...
Big T Larrity's user avatar
1 vote
2 answers
610 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 ...
jpwrunyan's user avatar
  • 111
1 vote
1 answer
174 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 ...
Mr Jox's user avatar
  • 15
1 vote
1 answer
1k 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 ...
Saad Moutalib's user avatar
2 votes
1 answer
2k 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 ...
Vitozz_RDX's user avatar
1 vote
1 answer
316 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 ...
Jax's user avatar
  • 420
0 votes
1 answer
99 views

Get range of hexagon based on specified center

I have this method to get the cells inside a given N range: ...
Enrique Benitez's user avatar
0 votes
1 answer
317 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 ...
Enrique Benitez's user avatar
3 votes
1 answer
175 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: ...
Enrique Benitez's user avatar
4 votes
0 answers
255 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 ...
Draconis's user avatar
  • 161
3 votes
1 answer
598 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 ...
Brian Sturk's user avatar
2 votes
0 answers
130 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 ...
Luke B.'s user avatar
  • 1,257
4 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 ...
InsOp's user avatar
  • 153
2 votes
2 answers
1k 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 ...
chewpoclypse's user avatar
1 vote
0 answers
320 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. ...
Jason Howells's 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 ...
Joshua's user avatar
  • 175
3 votes
0 answers
279 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. ...
Daniel Tyomin's user avatar
2 votes
2 answers
200 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, ...
DrZ214's user avatar
  • 338
1 vote
1 answer
900 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: ...
moin khan's 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 ...
PKCLsoft's user avatar
  • 213
3 votes
2 answers
803 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: ...
user85780's user avatar
5 votes
1 answer
626 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 ...
Don Jewett's user avatar
3 votes
3 answers
425 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 ...
warbaque's user avatar
  • 153
9 votes
2 answers
2k 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: ...
aaron-bond's user avatar
3 votes
1 answer
126 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 ...
aaron-bond's user avatar
3 votes
1 answer
428 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 ...
T. Apeltauer's user avatar
1 vote
0 answers
118 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 ...
TheMagicShroom's user avatar
2 votes
0 answers
435 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 ...
Abdel5's 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 ...
Jazzepi's user avatar
  • 153
4 votes
2 answers
563 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 (...
Abdel5's user avatar
  • 173