Live data from Hacker News

Hexagonal Grids (2013)

redblobgames.com

11–20 of 47 posts

Re: Hexagonal Grids (2013)

#11
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Hey Amit

A big thanks for your site. As someone who fiddles around with small hobbyist game projects, your site is the defacto bible for me.

I was wondering if you plan on writing something on game AI. specially where the AI has infinite permutations of actions that they can take. How do these game AIs actually formulate a list of possible actions and how do they prioritise them?

Re: Hexagonal Grids (2013)

#12
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Love all the content on your site, keep writing more new things please!

Re: Hexagonal Grids (2013)

#13
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Thanks a lot for your website (an in particular this page and the hexagonal terrain generator page). I use it for small side projects quite often and I've actually re-implemented the terrain generator in C++ for a school project[1][2], with a 3D renderer for generated worlds[3].

[1]: https://github.com/H/2IV06-report [2]: https://github.com/Heightened/2IV06-map-generator [3]: https://github.com/Heightened/2IV06-map-viewer

Re: Hexagonal Grids (2013)

#14
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Your page is not only awesome in creating my Catan clone, but also very useful when communicating on it with others. You have set the gold standard or the defacto standard.

If you're interested in my implementation: https://github.com/generateui/jsettlers-web/blob/master/src/... https://github.com/generateui/jsettlers-web/blob/master/src/... https://github.com/generateui/jsettlers-web/blob/master/src/... https://github.com/generateui/jsettlers-web/blob/master/src/...

A hex has a coord. A coord has 6 nodes and 6 edges. An Edge can be created from 2 coords or 2 nodes. A node can be created from 3 edges or 3 coords. The implementation is immutable and memoized.

Re: Hexagonal Grids (2013)

#15
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

You have no idea how helpful this page has been for me in the development of my hex game. Chuck a donate link on there, I would love to buy you a few beers to say thank you

Re: Hexagonal Grids (2013)

#16
There's also square version of hexagonal map. It is made of squares, but every second row (or column) is moved by half a tile. Like bricks in a wall or tiles in pavement.

It doesn't look nearly so neat if the tile borders are visible, but when they aren't it doesn't make a difference as long as you draw tile backgrounds right. And it's easier to calculate on which tile you are, but it still keeps some of the benefits of hex grids.

One advantage of hexagonal grids for procedurally generated maps is that you only have 6 neighbors instead of 8 to consider when generating each new tile.

If you care about 1 bit of information from neighbors that's already 4 times less combinations to prepare. With more bits it's even bigger difference (but then manually drawing a tile background for each possible combination becomes too much work anyway).

Re: Hexagonal Grids (2013)

#17
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

It's not the first time it is here.

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

Re: Hexagonal Grids (2013)

#18
I used this page so much when creating my HexMap Library for Unity [1] (it's MIT Licensed so I hope its okay to advertise it here). Are there any other pages comparable to redblobgames which covers game related topics in such a engaging way?

He really inspired me to step up the effort spent in writing good documentation.

[1] https://aurelwu.github.io/

Post reply on HN