Skip to main content

Pathing system for 2-D square grid

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
superinventor
Offline
Joined: 2012-08-20

I'm creating a game, city populization, and my worker pathing system isn't working very well. I first built it, so they ran right through everything, then I rebuilt it into an intelligent one... but it lagged like crazy because it looked at every possible path. After that, I rebuilt it into one that always turned right- causing workers to run in circles before they finally honed in on their destination. Now, I rebuilt it into annother intelligent one, but it gets laggy when there are many houses and you change any plot. It works the same way as the first intelligent one, except it searches ahead of time and stores all the paths it finds. None of these four pathing systems work good enough for me; I need an intelligent pathing system that quickly and easily finds the fastest path with no lag, no matter how extensive the area to path through. What would be an algorithm that I could use for this pathing system?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
superinventor
Offline
Joined: 2012-08-20

City Populization Main Page
City Populization Downloads Page
Version 1.1 is the one with the buggy pathing system