Author Topic: grid based pathfinding help  (Read 2856 times)

I never knew you could use bitmasks to do something neat like this, I wish I knew that sooner.
they're pretty useful, I've been using them for pretty much everything map generating related

they work well with road/maze generators because you can do a switch statement to put the correct road tile down
and it's easy to generate the bitmasks in the first place (linking two nodes is just %westNode |= $paths[east]; %eastNode |= $paths[west];)

May I see a bigger example? Would really love to try this out.

https://www.cs.drexel.edu/~phf29/blockland/city.html
source code is near the bottom
to run it, you're going to need to find and replace 6887 with your ID
run DCG_update(); to update the file (and do it after you spawn in)
run DCG_buildCity(); to generate and build the city
(DCG = DuckCityGenerator)