Reputation
3,628
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
8 20
Newest
 Civic Duty
Impact
~96k people reached

  • 0 posts edited
  • 0 helpful flags
  • 316 votes cast
Jul
21
answered How can I improve the efficiency of my procedural terrain generation and smoothing?
Jul
16
comment Efficient parsing of text file to map
Best approach I've found for reading map files is to do the simplest thing at the beginning, and then revisit it later. A huge switch statement is fine. The engineering tradeoffs (especially with performance) aren't always apparent until I get farther into the project.
Jul
6
answered Finding the “Important” nodes of a grid path
Jul
4
comment Line of sight on a 2d grid
Here's a demo: redblobgames.com/grids/line-drawing.html
Jun
22
comment Diagonal movement behaving strangely when other key is pressed
Many keyboards can handle only some simultaneous key presses. I believe shift, ctrl, alt are more likely to work with other keys than space, but I am not certain. Also see en.wikipedia.org/wiki/Rollover_(key)
Jun
15
comment Short distances from reference point
I agree with Ali.S — BFS will work well here. It's simple and fast. It also works if you have multiple reference points (see demo), which is handy for figuring out which reference point is closest to where you are.
Jun
10
awarded  Civic Duty
Jun
6
comment Map coordinates system
I've written a little bit about hex coordinates here.
Apr
9
awarded  Nice Answer
Mar
20
comment A* pathfinding for grid with direction-dependent nodes?
Yes. A* considers whether you can move from A to B separately from whether you can move from B to A. You can have one or the other or both or neither. It also considers the cost of moving from A to B separately from the cost of moving from B to A, so climbing up could be slower than climbing down.
Mar
14
comment How to select random points within grid meeting min/max distance requirements from each other?
I'm guessing poisson discs will be useful for this. You can use a quad tree or sorted range data structure to help find the closest point to your new proposed point. Jason Davies has a demo of an efficient algorithm but it only handles M and not your L condition. Still might be a good starting point.
Mar
7
answered Estimate the time it takes for an object to travel from point A to point B
Mar
1
answered Finding neighboring coordinates on offset tile map
Feb
21
answered How to get more gentle (cloud like) noise?
Feb
17
comment Optimization of A* in Python
200 000 times per second is quite unusual. Can you describe more what you are trying to do here?
Feb
16
awarded  Revival
Feb
15
answered How to find all the possible places to go on a grid?
Feb
14
comment How can I use graph traversal to generate a round region?
CA doesn't start from a root node and expand; it evaluates all nodes equally. You may be thinking of graph traversal algorithms.
Feb
11
comment Possible A* Optimizations
@PieterGeerkens The same node can occur in the neighbors list of many other nodes. A* usually checks if the node is already in the Open set. If it's already there, and the previous 'g' value is lower (better) or equal then you don't need to insert the new node. If it's already there, and the previous 'g' value is higher (worse) then you should put the new node into the priority queue. Some implementations will update the existing node in the priority queue to reduce the number of nodes it has (speeding up the PQ) and to reduce the number of nodes processed (speeding up A*).
Feb
11
comment Possible A* Optimizations
Does the profiler tell you which lines are slowest?