2,958 reputation
616
bio website redblobgames.com
location California
age
visits member for 3 years, 10 months
seen 1 hour 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).


Jun
9
answered Line draw on “even-q” vertical flat topped hex grid
Jun
7
revised JavaScript “Floats”, or ThreeJS wrong positioning?
Retag question - it's about floating point in general, not three.js
Jun
7
answered JavaScript “Floats”, or ThreeJS wrong positioning?
Jun
4
awarded  Nice Answer
May
26
answered Pathfinding library
May
24
comment Hexagon collision detection for fast moving objects?
I've not tried this before but it seems that instead of hexagons in 2d space, you can think of the movement in 2d as volumes in 3d space where one axis is time. You're then intersecting two 3d polyhedra with (x,y,t) coordinates. If the two solid objects intersect then you want to find the minimum t value. You might simplify a little bit by converting all of B's coordinates to be in A's reference frame. I haven't implemented this but that's where I'd start.
May
18
answered Converting hexagon grid coordinate system
May
14
comment Using random numbers with a bias
I do mean on paper :) … first you want to decide on what shape you want, because it's part of your game design. Only after you have a shape do you figure out the corresponding formulas or code. You're not limited to using a standard function like sqrt or pow. Don't limit yourself! :) You can use any arbitrary shape encoded in a table (“piecewise linear function”).
May
14
awarded  Organizer
May
14
answered Hexagonal grid/tiles tutorials
May
14
revised How do I rotate a structure of hexagonal tiles on a hexagonal grid?
Add hexagon tag
May
14
answered How do I rotate a structure of hexagonal tiles on a hexagonal grid?
May
5
answered Job finding algorithm
Apr
27
comment Creating an update “Tick” on tiles for simulating growth of plants
It has to be granular enough to be able to represent the smallest simulation tick. Note that you can limit the range if you want to use a smaller integer type. For example if you set the beginning of the game to be 0 and you have 10 simulation ticks per second then a single game would have to run for 6 years before overflow. However unless space is a premium a 64 bit int or DateTime is probably fine :)
Apr
27
answered Using random numbers with a bias
Apr
13
comment Simultaneous game states
If the states are independent, you might use multiple FSMs to track them separately.
Apr
9
revised Time of Day Lighting / Day Cycle
Edited based on suggested changes by Deukalion (to make it proper C# code), but with less extensive changes
Apr
9
comment Time of Day Lighting / Day Cycle
Yes, it's “centered” at the wrong point (at 6am); you have to add a constant to time to recenter it where you want. Probably -½π; I'm not sure.
Apr
7
answered Time of Day Lighting / Day Cycle
Apr
7
answered Creating an update “Tick” on tiles for simulating growth of plants