pathfinding and flowfield much better for small units why ?

Discussion in 'Support!' started by doud, June 11, 2013.

  1. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    At the beginning of the Alpha i only used tanks.
    And pathfinding/flowfield did not look at good as i expected :
    All tanks are usually coliding with each other.

    Until i recently started to use massive amount of Kbots.

    And then big suprise : pathfinding flowfield is just working so much better and smoother for kbots and all small units.

    So i was just wondering if it's because of the same implementation used for all units without changing the distance in between each units (based on unit size).

    Was also wondering if it would make sense to enfore a minimum distance in between building in order to ensure bigger units can easily exit from the base and move faster to the battlefield.

    So far i'm putting my building not too much close to each other in order to improve pathfinding.

    thanks :)
  2. xanatosx

    xanatosx Member

    Messages:
    39
    Likes Received:
    0
    Re: pathfinding and flowfield much better for small units wh

    Please look at these bug reports:

    FS#450

    FS#259

    If one of these reports describe your problem vote for it or leave a comment if not please search for something similar and if you don't find anything post it as a new bug.

    Befor posting a bug read trough this post.
    Last edited: June 11, 2013
  3. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Re: pathfinding and flowfield much better for small units wh

    I think the issue might be caused by the concept behind the flowfields.

    It works quite well as long as the individual unit isn't much bigger than the resolution of the used map or if the rate of change in the map is rather low as a single sample is sufficient to get accurate informations.

    However if the unit gets bigger and there are obstacles, I think it might necessary to make a second map in a different resolution for larger units which has small gaps marked as non traversable, I'm not sure. But map already HAS a rather low resolution and many gaps are marked as not traversable, although the unit would fit through without collision due to the lack of dynamic tessellation where it would be necessary... Using a quadtree instead of a static map might help, but that might also lookups are now O(log(n)) rather than O(1), integration might become a bit tricky and it would no longer be that easy to use OpenCL or alike for flow field calculation, if that was desired later on.

    While thinking about it, it would seem as you would need to extend the data format of the cost map. Rather than storing the fully calculated cost, you would need also to store the distance to the next obstacle for each field, so you are then able to integrate a flowfield which is not only accurate for a specific goal, but also for a specific unit size by treating all fields as impassable or high cost if radius > distance to obstacle. No need to store the distance if it is bigger than the radius of the largest, moving unit.
    Only "real" terrain costs should be hardcoded in the cost map, simple obstacles like rifts or rocks should only make fields impassable the actually block, surrounding fields only get the "distance field" set.
  4. asgo

    asgo Member

    Messages:
    457
    Likes Received:
    21
    Re: pathfinding and flowfield much better for small units wh

    I think some the big vs. small unit issues could be explained by using just the center of the unit for calculations.
    At least with the big ships I got the impression, that you can (not including other bugs) drive a ship up to the center of its model onto the beach. Depending what they are using as a basis for pathing that might be one of the reasons (since small units aren't much more than their center).
  5. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Re: pathfinding and flowfield much better for small units wh

    Thats only half the truth. Issue is, ALL units just use the center and the same cost map, but the cost map was calculated assuming a static unit radius (or no radius at all so far for the water map).

Share This Page