3,238 reputation
717
bio website redblobgames.com
location California
age
visits member for 4 years, 2 months
seen 3 hours ago

I help people make games. On my new site ("Red Blob Games") I post interactive tutorials and guides to game algorithms. On my previous site (Amit's Game Programming Information) I collect links to useful pages about maps, grids, tiles, pathfinding, and AI. On my blog ("Blobs in Games") I post experiments and projects and ideas. Previously I was an advisor to Wild Shadow Studios (Realm of the Mad God) and Root 1 (educational games).


Nov
4
comment A*, Tile costs and heuristic; How to approach
Note: "tile.H = Math.Abs(endTile.x - tile.x ) + Math.Abs( endTile.y - tile.y ) * 10;" is multiplying only the second Abs by 10, and not the first. You need parentheses if you want to multiply both by 10 (and you do)
Nov
3
comment How to make natural-looking paths with A* on a grid?
I think the bit about obstacles is expected; there's a diagram on the Heuristics page that is titled “less pretty with obstacles”. The tie breaking approaches don't help much around obstacles. One of the other approaches (such as Theta*) may be what you want.
Nov
2
answered How to make natural-looking paths with A* on a grid?
Oct
13
answered How to march tiles together like in Terraria?
Oct
11
awarded  Yearling
Sep
25
comment Placing nodes in a graph in a random but readable way
In general, graph layout is a hard problem, with lots of different algorithms. Only "planar" graphs can be drawn without the lines crossing each other. You might look at the force-directed graph examples from d3.js.
Aug
25
answered Is there a library that handles hexagon tiled 2D maps?
Aug
21
revised Hexagonal grid/tiles tutorials
edited tags
Aug
21
comment How do I get pixel to hex coordinates on an array based hex map?
This is a reasonable approach. You can speed it up by scanning a smaller range of rows/cols instead of scanning all of them. To do this you need a rough idea of where the hex is. Since you're using offset grids, you can get a rough guess by dividing x by the spacing between columns and dividing y by the spacing between rows. Then instead of scanning all columns 0…cols-1 and all rows 0…rows-1, you can scan col_guess - 1 … col_guess+1 and row_guess - 1 … row_guess + 1. That's only 9 hexes so it's fast and not dependent on the size of the map.
Aug
21
answered How do I get pixel to hex coordinates on an array based hex map?
Aug
19
comment How could I figure out the shortest way to turn, and whats the angle?
Note that in most cases you should use atan2 instead of atan. It handles the divide by zero case, as well as figuring out which quadrant you're in.
Jul
26
comment Procedual terrain generation and biomes/predetermined variation
You write in a comment that biomes determine height. Have you considered making it the other way around? Generate noise functions for height, moisture, and anything else, and then use that to determine biomes. That way, the underlying height, moisture, etc. are all continuous across biomes and won't have any nasty borders.
Jul
26
comment What are some methods to represent train tracks?
I've written a longer article about using circular arcs to represent roads and train tracks.
Jul
18
comment Procedural river or road generation for infinite terrain
The roads in that project were contour lines that followed specific heights, so you could possibly generate them locally. It worked there but the height maps not generated with Perlin noise.
Jul
5
awarded  Necromancer
Jun
17
comment Vertices shaking with large camera position values
Wild guess: are you using single precision floats anywhere? That could be loss of floating point precision.
Jun
16
comment How to determine the demographics of a game after release?
It seems like you want to use demographic data as a proxy for ways to make the game better. Is there a more direct way to figure out how to make the game better? Do you need to choose to make something for only one audience, or can you make options for multiple audiences and then see which ones work best?
Jun
12
comment Generate equal regions in a hex map
Real countries often have boundaries on rivers or mountains. As you're expanding in a random direction, you might try decreasing the probability of expanding if the next hex is on the other side of a river or a mountain ridge.
Jun
10
awarded  Caucus
Jun
9
revised Line draw on “even-q” vertical flat topped hex grid
Added "hexagon" tag