Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback My RTS like group movement

Discussion in 'General Discussion' started by Tomasz_Pasterski, Sep 30, 2023.

  1. Tomasz_Pasterski

    Tomasz_Pasterski

    Joined:
    Aug 12, 2014
    Posts:
    99
    Guys, just asking for feedback about how it looks for you, that group movement and their behaviour when they reach the firing range, start shooting enemy tank while maintaining to get position to shoot aroung firing range then i give attack-move order to other smaller group to check how they behave while they have ally units already attacking on the way to attack-move target position with enemy on the way.
    I use simple Navmesh with navmesh agents behaviour, tweaked it for a long time now and then, even tormented unity muse to help but it end up suggesting me to make other algorithm for that behaviour which is beyond me.
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,716
    Doe it work as expected?
    Does your performance is ok?
    Did you profile it?
    Did you try with max units count?
    Did you try on largest map size, if you expect have one?

    What doesn't work?
     
  3. Tomasz_Pasterski

    Tomasz_Pasterski

    Joined:
    Aug 12, 2014
    Posts:
    99
    I just wanted to know how it looks in other ppls eyes, those group movement, if it feels somewhat acceptable. I spend so much time tweaking that behaviour and i think i somewhat dont see clear picture and just need honest opinion if movement of those units looks bad or not.
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,484
    Units do not try to keep distance from each other, they should do that. See boids algorithms, apply the same principles to units. I'm also certain that if there will be narrow corridors anywhere on the way, the whole thing will get stuck.
     
    Antypodish likes this.
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,716
    Looks decent. But units get pushy each other.
    So Boids + formations could help.
    Boids should solve your collision issues.
    Formation may be more challenging. Specially when ordering moving units between none pathable terrain. I.e. rocks, buildings etc.
     
  6. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,838
    You can have more varied controllable movement by using waypoints. They also do not fail in levels that go up stairs/ramps, geometry existing above or below other geometry. Waypoints themselves can have varied instructions on them for the agents to use when they reach vicinity by having one to umpteen next waypoints to navigate to with rules for divying them up. You could cluster them to a waypoint which sends the first seven to attack station waypoints, the next four to flanking position waypoints and the final four hold position for 10 seconds and then use an attack vector. Bottom line is a waypoints system is more flexible that navmesh pathfinding and can be made deterministic or procedural. I would get the direction to the waypoint or attack vector first and then an avoidance vector to route around obstacles and finally the distance between units checked and those avoidance vectors added to get the directional for the next rotation.