HN2new | past | comments | ask | show | jobs | submitlogin

Right now the units are moving in tile-sized increments. I'll be implementing floating point movement soon. I move the map around while the units are moving and you'll see its not at 4 FPS.

I think with any quasi-infinite growth game, you are going to run into a problem of it slowing down, eventually. That's what inspired me to create this algorithm. I wanted a game that could scale, and traditionally path finding is a CPU intensive task.

The video I linked is out of date, I'll be making a new one soon.

Now: building the path finding graph is now stored in a vector (i.e. array) instead of an unordered_map (and still has constant time access/find). This cut CPU cycles by 66% since a vector doesnt use linked list/pointers/store a hash, and reduced RAM requirements by 75%. Then I parallelized that part of the code base.

So for my 6 core machine, I can find all the all-pairs, all-possible shortest paths in a 50 x 50 grid of roads in 10 seconds. This is about 13 square miles of city if each block is the size of a Manhattan block. I'll be working around this time by implementing a planning mode so it only updates as needed.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: