![]() I haven't profiled any of it myself of course, so I'm not sure what typical numbers would be.Ī funny thought would be just sorting the unit vector by active / inactive status, but sorting it may not have a trivial time component and isn't particularly useful if there are multiple flags or fields it checks for this purpose. Linked list traversal is very slow compared to iterating over a vector so I'd expect it to be a bad trade, but it depends on the typical size of the collection and how often it changes. I literally had to be handed a save that had a pathfinding edge case (24 tightly-closed doors) before I even found the pathfinding function, since it's buried so deep due to its, again, not being a major use of CPU time. If I seem bothered by this, it's because I pondered the pathfinding a good deal too before I actually bothered to do the bare minimum work in actually figuring out why the game runs slowly and learned that, no, pathfinding has basically nothing to do with it. You can get an FPS boost from fixing up pathfinding a bit-6% is 6%, reducing that helps!-but FPS death will set in just as it does now, even with magic oracle pathfinding that takes 0 time. Sorry, people have just been wrong about this the whole time. Pathfinding is not a major contributor to FPS issues. I don't know if this is a gatekeepy viewpoint, but I've seen people so hyperfocused on pathfinding, which does not cause FPS issues except in extreme edge cases and tightly-closed door mishaps, that they seem to be convinced that fixing the pathfinding will fix the FPS issues. If you want to contribute to figuring out what is causing FPS issues, first you have to figure out how to actually use the tools that let you find out what's causing FPS issues. blind flailing at nothing of consequence. Trying to optimize a program without profiling is just. A lot of the CPU time in unit checks is wasted in branch misprediction due to the fact that it's checking the units vector and just skipping everything that happens to be inactive/caged/a ghost if those units' indices (or pointers to them, as the case happens to be, unfortunately) were simply cached in a vector that contains only active/uncaged/non-ghostly units, that would be avoided and the game would probably run quite a bit faster. Not to say there isn't some major high-level optimizations to be made. The truth is that FPS death is not a matter of multithreading pathfinding or anything like that, it's a combination of just about everything in there. ![]() This is compared to the largest cause, one whose contribution to total CPU usage actually grows faster than pathfinding and one that is still the slowest thing in early game: units checking other units for line-of-sight/proximity checks (running away from hostiles etc), which is more like 20%. Pathfinding happens so rarely that my profiling has shown it contributes to about 6% of an individual tick's processing time. This usually happens because you're using tightly closed doors. When it does, fortresses drop to sub-single-digit FPS levels. The thing is, it doesn't happen often at all. Source: I actually profiled the game, which is the only way to actually determine what is slow in a program. No payment, no installer, no spam ads.Because we test every single game before uploading.Since 2010, ApunKaGames posted more than 8000+ games including 80+ of categories for PC! ![]() We working 24/7 to provide you latest and best Full Version Games for PC. The website for Download PC Games, one of the best and popular site of all time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |