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
2answers
35 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 ...
3
votes
3answers
183 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 ...
6
votes
1answer
269 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 ...
1
vote
1answer
56 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:...
0
votes
1answer
120 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
2answers
154 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. ...
0
votes
2answers
148 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 ...
13
votes
6answers
3k 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 ...
4
votes
1answer
233 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
1answer
79 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
1answer
174 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
2answers
285 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 ...
1
vote
1answer
126 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 ...
1
vote
1answer
609 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 ...
2
votes
1answer
718 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 ...
1
vote
1answer
213 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 ...
0
votes
1answer
94 views

Get range of hexagon based on specified center

I have this method to get the cells inside a given N range: ...
0
votes
1answer
218 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 ...
3
votes
1answer
129 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: ...
4
votes
0answers
168 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 ...
3
votes
1answer
424 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 ...
2
votes
0answers
104 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 ...
3
votes
3answers
3k 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 ...
2
votes
2answers
785 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 ...
1
vote
0answers
230 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. ...
3
votes
1answer
818 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 ...
3
votes
0answers
251 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. ...
2
votes
2answers
189 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, ...
1
vote
1answer
677 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: ...
6
votes
2answers
3k 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 ...
3
votes
2answers
629 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: ...
5
votes
1answer
378 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 ...
3
votes
3answers
256 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 ...
8
votes
2answers
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: ...
3
votes
1answer
119 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 ...
3
votes
1answer
388 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 ...
1
vote
0answers
92 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 ...
2
votes
0answers
315 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 ...
5
votes
1answer
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 ...
4
votes
2answers
474 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 (...
7
votes
2answers
4k 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 ...
8
votes
3answers
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 ...
0
votes
2answers
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 ...
2
votes
1answer
1k views

Hexagonal Game Board Modal?

Tile-based games like Chess have a simple modal: an array of arrays, each coordinate with an X and a Y value. This is easy to implement, and it is easy to figure out what is going on. Chess Board ...
3
votes
2answers
435 views

XNA - Making 2D Hexagons Connect With Each Other

I'm working on a top-down 2D strategy game in XNA, and the tiles are hexagons. I can't have a grid because of the game mechanics, so everything has its own location, and every tile object is stored in ...
7
votes
2answers
927 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 ...
6
votes
5answers
5k 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 ...
7
votes
1answer
2k 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 ...
1
vote
0answers
52 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 ...
15
votes
3answers
844 views

How to divide hex grid evenly among n players?

I'm making a simple hex grid based game, and I want the map to be divided evenly among the players. The map is created randomly, and I want the players to have about equal amount of cells, with ...