Live data from Hacker News

Hexagonal Grids (2013)

redblobgames.com

61–70 of 77 posts

Re: Hexagonal Grids (2013)

#61
post #38

A surprise to be on HN! Tech notes for the curious: I started the page in 2013 based on notes I had been collecting for ~20 years before that. I update this reference page as I come up with better visualizations and explanations. The last major update was in 2018 when I rewrote it from using d3.js to using vue.js. It greatly reduced the amount of code I was writing, and also let me make the page more interactive. I t…

Was this by any chance inspired by the Well World series of books?

Re: Hexagonal Grids (2013)

#62
post #15

FWIW, I strongly prefer square grids for tabletop games. Hexagonal grids give you precise measurements in exactly 6 directions. If you approximate sqrt(2) as 1.5 then square grids give you pretty darn accurate measurements in 8 directions, including 2 pairs of directions that are orthogonal, which is good for rectangular features like buildings. Furthermore the distance between two points can be quickly calculated wi…

I like octagonal grids. Sure, you have to have your game in hyperbolic space, but you can have accurate movement in 8 directions. Your players will just have to deal with parallel lines diverging, there being unique things like pseudocycles, horocycles, circles with a circumference that grows exponentially with increasing radius, etc. Sadly such geometry isn't supported by any tabletop software I'm familiar with, and…

I haven't been able to play hyperbolic tabletop games since I lost my hyperbolic table in my last move. YMMV.

Re: Hexagonal Grids (2013)

#63
post #38

A surprise to be on HN! Tech notes for the curious: I started the page in 2013 based on notes I had been collecting for ~20 years before that. I update this reference page as I come up with better visualizations and explanations. The last major update was in 2018 when I rewrote it from using d3.js to using vue.js. It greatly reduced the amount of code I was writing, and also let me make the page more interactive. I t…

Thanks so much for your awesome article. It was a fantastic resource which gave me invaluable insight while I was working on this project: https://github.com/ajxs/jsFO

Re: Hexagonal Grids (2013)

#64
post #38

A surprise to be on HN! Tech notes for the curious: I started the page in 2013 based on notes I had been collecting for ~20 years before that. I update this reference page as I come up with better visualizations and explanations. The last major update was in 2018 when I rewrote it from using d3.js to using vue.js. It greatly reduced the amount of code I was writing, and also let me make the page more interactive. I t…

I'm the author of a Swift framework for working with Tiled tile maps and want to thank you for your work; your site was invaluable in helping me wrap my head around hexagonal grid mapping & pathfinding.

There is truly nothing out there like it. :)

https://github.com/mfessenden/SKTiled

Re: Hexagonal Grids (2013)

#65

I love this page. I've used this page as a reference, it saved me a lot of time and left me with a stronger understanding as well. It reminds me of old school web. When google first came on the scene I was amazed at how many informational pages from either hobbyists or professionals existed (but which I wasn't finding with older search engines), where someone just decided to put everything they know about some topic…

Yes, old school web! A few of the others I like: https://faculty.evansville.edu/ck6/tcenters/ ; http://paulbourke.net/ ; https://pomax.github.io/bezierinfo/ ; https://www.fieggen.com/shoelace/ ; https://www.wood-database.com/ ; http://www.oftenpaper.net/sierpinski.htm ; https://www.animatedknots.com/ . There are lots more out there but social media favors new content rather than timeless content.

I want to see more pages like that so, following “Be the change that you wish to see in the world”, I am writing informational pages.

Re: Hexagonal Grids (2013)

#66
post #52

For a semi-goofy take (CGPGrey) on hexagons: https://youtu.be/thOifuHs6eY

More hexagons in nature: Image: "Hexagonal formations on the surface of the Salar de Uyuni (Bolivia, 3,656 meters above sea level) [0] as a result of salt crystallization from evaporating water": https://en.wikipedia.org/wiki/Salar_de_Uyuni#/media/File:Sal... "During the rainy season (December to March) the salt flat gets covered with a layer of water. As the water evaporates under largely still conditions, the salt…

Also in nature: there is a giant hexagon on Saturn! http://www-cs-students.stanford.edu/~amitp/diagrams/saturn-h...

Re: Hexagonal Grids (2013)

#67
post #38

A surprise to be on HN! Tech notes for the curious: I started the page in 2013 based on notes I had been collecting for ~20 years before that. I update this reference page as I come up with better visualizations and explanations. The last major update was in 2018 when I rewrote it from using d3.js to using vue.js. It greatly reduced the amount of code I was writing, and also let me make the page more interactive. I t…

Welcome back! :)

Previous discussions and commentary:

https://news.ycombinator.com/item?id=19184412

https://news.ycombinator.com/item?id=14627711

https://news.ycombinator.com/item?id=8941588

https://news.ycombinator.com/item?id=5809724

https://news.ycombinator.com/item?id=5680336

Re: Hexagonal Grids (2013)

#69

Earlier quoted context omitted.

If you take diagonals to be 1.5, then distances are The half-short-side heuristic (sqrt(aa + bb) ~= a + b/2) makes taxicab very close to correct for non-square distance as well.

But only if you move multiple cells in one turn. If movement is restricted to one cell each turn, your field distorts. The same happens when you split your movements: For example: player A moves 6 each turn; player B moves 2 thrice in a turn. Conclusion: A outruns player B at speed (4,4)/turn vs (3,3)/turn. (For A d(4,4)=6; B has d(1,1)=1.5)

Yes, hex grids are better when the number of cells moved per turn is very small.

Handling multiple moves in a single turn is easy either by doubling the movement points you get (then N/S/E/W is 2 points, diagonal is 3), or informally by treating every other diagonal move as costing 2 points.

Re: Hexagonal Grids (2013)

#70
post #15

FWIW, I strongly prefer square grids for tabletop games. Hexagonal grids give you precise measurements in exactly 6 directions. If you approximate sqrt(2) as 1.5 then square grids give you pretty darn accurate measurements in 8 directions, including 2 pairs of directions that are orthogonal, which is good for rectangular features like buildings. Furthermore the distance between two points can be quickly calculated wi…

> Hexagonal grids give you precise measurements in exactly 6 directions. Square grids give you precise measurements in exactly 4. > If you approximate sqrt(2) as 1.5 then square grids give you pretty darn accurate measurements in 8 directions, including 2 pairs of directions that are orthogonal If you approximate sqrt(3) as 1.75, then hex grids give you pretty darn accurate measurements in 12 directions, including 3…

> The equivalent loose approximation on a hex grid would seem to be long direction minus 1/4 short direction, which doesn't seem any harder.

As promised in a sibling comment I would work it out on paper. By my path, using the 7/4 approximation for sqrt(3), the ratio between X and Y directions is 12:21 which is much harder to do in your head than the 3:2 that a square grid gives you. However, a simpler approximation of (5:3) with acceptably low error came out.

Math (see diagram below)

Normalizing your 1.75 approximation to 7 "units" then the sides of the hexagon are of length 7, the distance from center to corner is length 7, and the distance from center to side is 6. This gives a distance from A to other points as:

B: 12 (Center -> Side -> Center)

C: 12 (Center -> Side -> Center)

D: 21 (Center -> Corner -> Corner -> Center)

Given that the actual value of A->D is ~20.784 that suggests approximating A->D = 20 alowing us to reduce as follows:

B: 3

C: 3

D: 5

This has a ~3.7% error in the horizontal direction.

       ______            ______      
      /      \          /      \     
    /    B     \______/          \___
    \          /      \          /   
      \      /          \      /     
        ----      C       ----       
      /      \          /      \     
    /    A     \______/    D     \___
    \          /      \          /   
      \      /          \      /     
        ----              ----       
      /      \          /      \     
    /          \______/          \___
    \          /      \          /   
      \      /          \      /     
        ----              ----
Post reply on HN