News for hackers. Stuff that matters.
Re:Documentation related to the implementation of SimCity 2000 by chongli on Wednesday February 15, 2023 @06:48AM (#34802580)
Exactly. The only time you should be calculating paths is after the player places new roads. Repeatedly calculating paths on a fixed graph is a huge waste of time!
Re:Documentation related to the implementation of SimCity 2000 by db48x on Friday February 17, 2023 @10:43PM (#34843645)
It’s even easier than that since each agent only needs to plans a path once, when they start their trip. After that they are simply following a cached path, removing road segments from it as they go. Most games will simply not recalculate those paths when you change the network, because it causes a lag spike every time the player makes a change, and because most routes wouldn’t end up changing. Better to just have cars ignore roads that didn’t exist when they departed, and have them vanish if they need to take a road that has since been deleted.