Auto-squad for area patrol?

Discussion in 'Backers Lounge (Read-only)' started by exterminans, August 13, 2014.

  1. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    EDIT: Discussion moved to public: Auto-squads for area patrol

    Well, as we all know, area patrol is a troublesome feature.

    While it surely helpful, it also gets very troublesome for the server as soon as more than just a handful of units is patrolling due to the cost for pathinfinding.

    And then there is also the issue that most units are pretty much useless when straying around individually. (Unless for scouts. But then again: Only a limited number of scouts is required for full coverage.)



    So why not solve both problems at the same time?

    Whenever a large crowd of units is set to patrol an area, automatically group the crowd into squads of 3-20 units, depending on the size of the crowd. Units inside each squad move in formation with common goal.


    Squad size isn't fixed, so if new units are added to the patrol group, they get attached to the nearest squad.

    If squad size exceeds a reasonable limit then the squad splits in half at next waypoint.

    If the number of squads exceeds a reasonable limit, a simple "easiest match" is performed to merge two squads which are below the size threshold.

    Both thresholds scale dynamically with the total number of units patrolling per planet/command/whatever.


    As a bonus: For inhomogeneous unit groups, ensure that each squad has an evenly distributed unit composition, so you can just set factories to auto-produce your favorite unit-mix and have the area patrol feature group units accordingly.
    Last edited: August 20, 2014
    komandorcliff, NERDsEd, doud and 6 others like this.
  2. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Nice idea, sounds a little complex to me (the auto changes to squads may prove more costly to calculate than the pathing), however I think the principal is good.....
  3. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Considering how expensive path finding is:
    I doubt that anything can be more expensive. "Easiest match" algorithms for finding appropriate squads for iterative squad building process are actually quite cheap in terms of algorithmic complexity.

    Anyway, it's only a one time cost for building the squad, opposed to the recurring costs for calculating dozens of new path fields per second.
    planktum and cdrkf like this.
  4. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Ah ok, I must admit I don't really have any knowledge of the algorithms used for this kind of thing so I was just speculating. At any rate anything that reduces the impact of area patrols is a good idea!
  5. websterx01

    websterx01 Post Master General

    Messages:
    1,682
    Likes Received:
    1,063
    I think that this should only happen if it is from the same command. Like, if I tell 20 units to area-patrol, but I do so one at a time, let them do it, one at a time, however if it's from a factory, have them all try to get into patrols because it's still the same command.

    Really neat idea, though I think the squad size should be 1-n (n being whatever the dev's want.) so that even tiny groups technically get a squad mechanic.
  6. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    Very very cool idea indeed. I would like to have this also for Air units.
  7. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    I think it would make sense for about any type of unit, as soon as a certain number of units is exceeded.

    Only exception is mixed platoons where one unit type is expected to act as a meat shield, since the system can't possibly understand this intention. That's not a big issue however, mostly since meat shields are supposed to be ignored by the target selection algorithm anyway. (As any human player would target high DPS and fabber units first manually.)
  8. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    Yep. and patrolling is not only about recognizing threat. It's also being able to counter the threat. So allways having a single unit patrolling means either you have to micro manage it, or let it die when the threat is discovered. While having more than one unit would provide the oppotunity to discover a larger piece of threat and even possibly engaging the ennemy. Currently patrolling is much more about patrol and die (unless you micro-manage).

    Well I think this can be implemented later with not that much extra work (hopefully)
  9. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986

Share This Page