Jump to content

Solution to pathfinder, the CPU hog?


Recommended Posts

I read at some time that pathfinder is a real CPU hog in the game. I have been wondering if pathfinder use 3d data to solve paths. If so why not make a terrain dummy layer with fixed size 2d footprints for all 3d elements to solve paths. It would run so much more smooth and easy on CPU right?

If units were represented in 2d as a circle and other static things (no go zones) just represented by the shape of their footprint. Trees, bushes and such should also just have a circle footprint. Steep terrain would also just have a footprint of no go zones. Like this units would not so easy get stuck and CPU cost would be very low as far as i can understand at least.

Edited by woodpecker
  • Like 1
Link to comment
Share on other sites

27 minutes ago, Nullus said:

I think that what you've described is the way the pathfinder already works. The pathfinder is 2d already, and I'm fairly sure that the everything 3d is only in graphics, not in pathfinding or simulation.

That would make sense to me, as when units climb hills, they do not slow down in horizontal velocity components, which indicates that the vertical dimension does not affect the pathfinders. This results in a greater overall velocity when climbing the hill. This is not a problem, it looks weird but it is in almost every game.

Edited by BreakfastBurrito_007
  • Like 3
Link to comment
Share on other sites

3 hours ago, woodpecker said:

pathfinder is a real CPU hog in the game

yes i heard that too. i heard that smaller maps smaller pop max reduce the energy consumption much. if you have any idea. let know. maybe we could greater objects. for example this big trees. the name i forgot :D

  • Like 1
Link to comment
Share on other sites

The pathfinder overhead was greatly reduced by using more CPU cores (on things that have them at least) Nowadays graphics and javascript simulation are quite big on performance.

Wraitii made a patch to reduce some performance loss due to the AI (data was copied to it which is slow)

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...