Re:Amit’s Thoughts on Grids
by ghshephard on Thursday August 30, 2012 @12:04PM
(#4455255)
Is it it just me, or is the font, clarity of writing, color combination and diagram presentation extraordinarily clean on that site. There is a small bug with word wrapping beside some diagrams on my iPad, but everything else pulled me into about 25 minutes of awesome reading on grids.
Re:Amit’s Thoughts on Grids
by headbiznatch on Thursday August 30, 2012 @12:35PM
(#4455418)
I agree that it is above average. Subtle little touches (like the highlight gradients and thoughtfully padded section texts) really add to the readability. And, of course, the content. It's a good blog in general - unpretentious and informative.
Re:Amit’s Thoughts on Grids
by swah on Thursday August 30, 2012 @02:39PM
(#4456093)
Only nitpick is that everything is on the left side of the screen, with a lot of whitespace on the rest of the page - other than that, its pretty great.
Re:Amit’s Thoughts on Grids
by dripton on Thursday August 30, 2012 @01:50PM
(#4455818)
I don't like the way he does coordinates for triangles and hexagons, having hexes with the same y-coordinate slope up to the right. I prefer having hexes with the same y-coordinate stay as close to horizontal as possible, meaning that even hexes will be shifted up or down by half a hex compared to odd hexes.
I found that keeping the hex coordinates as close as possible to the square coordinates that your GUI library uses makes things easier.
Re:Amit’s Thoughts on Grids
by jamesflorentino on Thursday August 30, 2012 @10:53AM
(#4454910)
I'm not exactly sure what's new on this page, but his articles about game design and path finding were huge help to me when I was starting out in game development.
Re:Amit’s Thoughts on Grids
by dxbydt on Thursday August 30, 2012 @06:33PM
(#4457235)
Regarding implementation, he says "All the algorithms are straightforward. How might you implement them? You’ll first want to choose data structures for each of the three coordinate systems. I recommend keeping it very simple and transparent. All the coordinate systems I listed have an integer u and an integer v, and some of them have an annotation like L or W ; in Java use a class with public fields; The next step is to implement the algorithms you need. The simplest thing to do is to write functions (or methods) that take A and return a list of B. "
Atleast in Java ( and therefore in Scala, Clojure etc), the data-structure of choice is a general path, and all of those algorithms have built-in implementations, mostly on Path2D or other concretes. Also, instead of dealing with squares, hexagons & triangles separately... a square is just 2 isosceles triangles, and a hex is 6 equilateral triangles. So if you have a Triangle2D class extending Path2D, you get all of the algorithms and the you can handle all 3 face types. The transformation between cooordinate systems is handled by affine transforms
Re:Amit’s Thoughts on Grids
by shanelja on Thursday August 30, 2012 @11:14AM
(#4454991)
Love it, I have had to design 2d and 3d grids before now and the information you gave on faces for polygonal grids has been really helpful and will help me to break the square mold, so to speak.
Re:Amit’s Thoughts on Grids
by psykotic on Thursday August 30, 2012 @03:42PM
(#4456369)
I'd say he's likely best known for this very website on game programming. It's been around for a long time by Internet reckoning. In the olden days, it was where you went to learn about A* path finding for games.
Re:Amit’s Thoughts on Grids
by alpb on Thursday August 30, 2012 @12:00PM
(#4455232)
That's a very nice talk especially if you are interested in 3D mobile games development (like I was once in the past). I wish I'd knew all these before. Thanks for the post.
I found that keeping the hex coordinates as close as possible to the square coordinates that your GUI library uses makes things easier.
Atleast in Java ( and therefore in Scala, Clojure etc), the data-structure of choice is a general path, and all of those algorithms have built-in implementations, mostly on Path2D or other concretes. Also, instead of dealing with squares, hexagons & triangles separately... a square is just 2 isosceles triangles, and a hex is 6 equilateral triangles. So if you have a Triangle2D class extending Path2D, you get all of the algorithms and the you can handle all 3 face types. The transformation between cooordinate systems is handled by affine transforms
Path2D: http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Path2...
AffineTransform: http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Affin...