3 ms·
One efficiency update you can make is that if background objects don’t move, then you don’t need to recalculate the path. So check if anything moved before reca
by ninetyninenine 1y ago
One efficiency update you can make is that if background objects don’t move, then you don’t need to recalculate the path. So check if anything moved before recalculating.
- inetknght 1y agoThat's true until the map itself changes, eg other objects moving around in the calculated path
- ninetyninenine 1y agoYeah I said that. If nothing moves. No need to change.
- blt 1y agoSure, but in games sometimes improving the average case is less important than the worst case.
- ninetyninenine 1y agoSo you're saying everything always moves all the time so it's more efficient to just never check and have the algorithm assume something moved always.
- Maxatar 1y agoFor most real time systems, including many games, it doesn't matter if one is more efficient than another because what matters is the predictability that comes from always rendering a complete frame in 1/60th of a second. In many cases checking if absolutely nothing changed in a system isn't trivial either. You either have very fine grained tracking which involves a great deal of complexity and increased memory cost, or very broad tracking which results in a lot of false positives.
- stonemetal12 1y agoNo, if it takes 1 ms to check if things have moved, and 5 ms to do the pathfinding then the worst case is 6ms when something moves. A guarantied 5 makes for a more stable frame rate than a sometimes 1ms, sometimes 6ms calculation. Often times 60 FPS average with high variability feels worse than 30 FPS with low variability.