Search Unity

UnitySteer 2.0 released

Discussion in 'Made With Unity' started by Arges, Oct 19, 2010.

  1. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359

    Attached Files:

    Last edited: Oct 19, 2010
  2. defjr

    defjr

    Joined:
    Apr 27, 2009
    Posts:
    436
    Wow, that new example is impressive. Thanks!
     
  3. liverolA

    liverolA

    Joined:
    Feb 10, 2009
    Posts:
    347
    really nice share!!thanks for all the work
     
  4. DavidB

    DavidB

    Joined:
    Dec 13, 2009
    Posts:
    530
    This looks absolutely fantastic. I was moving in the same directly with a project of mine (regarding the structure). I have to check this out, because it's looking like a masterpiece! Great work Arges :D
     
  5. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Thanks a lot!

    (while you asked: the 154 agents demo run decent enoough on a q6600@3.5 ati 5870)
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Awesome work! :)
    The 154 agents test runs fine in my buggy firefox.:D
     
  7. dart

    dart

    Joined:
    Jan 9, 2010
    Posts:
    211
    Nice man, I will try this asap
     
  8. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    OMG, that is something very very interesting.
     
  9. SilentWarrior

    SilentWarrior

    Joined:
    Aug 3, 2010
    Posts:
    107
    Nice, I got some nice behaviors with the old version, but ultimately, it was bit hard to actually force them into doing something, hope this new version obeys better xD
     
  10. adriaanza

    adriaanza

    Joined:
    Jun 24, 2010
    Posts:
    41
    Just tested this on an ordinary Nvidia 8600 GS which is a fairly low-end graphics card implemented in laptops and some desktops a few years back, and it's running midway between choppy and smooth, probably around 18 FPS. It's actually not bad considering the amount of characters. I suppose though if that scene had an LOD implementation for the characters it'd run fairly decent!

    I haven't tried out UnitySteer prior so I've a couple of questions if you don't mind. This primarily only deals with object avoidance, right? Like in this example there's just some random script implemented saying "walk around this scene", and with UnitySteer, it avoids static and other dynamic objects.

    I know with some other solutions such as A* or Path they don't really take into account dynamic objects when you say "move from point A to B", so this is very attractive indeed. How easy is it to implement, for example, giving a character a goal of walking from his current location in the world to another at location X,Y,Z in combination with UnitySteer, e.g. use it alongside Angry Ant's Path.

    Also, how does it handle terrains? So like to avoid walking into high cliffs etc.
     
  11. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Congrats, thanks for the ongoing work
     
  12. SilentWarrior

    SilentWarrior

    Joined:
    Aug 3, 2010
    Posts:
    107
    One thing is pathfinding, another is obstacle avoidance, pathfinding can avoid static obstacles by pathing around them, not by knowing they exist during unit movement (unless more costly real time versions but thats another story).

    As for using it alongside angry ants path, you should check the code inside, the old version had a ready to use plug and play script for it to work directly with Path.

    Right now I have it working with Aron Granberg's A*.

    This version doesnt seem different from the one I had previously, I didnt need any code modifications or anything modded actually, i just drag and drop and it worked, also didnt notice any difference in behavior, still doesnt quite work as I need it to, need to work more on it :/

    One thing I notice is that sometimes some units wont move while others will :
    I have a infantry unit composed of 4 members, and those 4 members, each is a vehicle, they have pre-defined "hotspots" that they try and follow with a priority of 1 (other behaviors have priorities acordingly), those hotspots are moved with my rules for movement (using A*, speeds,etc) and the movement of the vehicles are controlled accordingly also.
    So, sometimes, when I move my hotspots, some units will follow it, and others will stay frozen behind, other times, one unit will wonder off while other units are on the correct positions. Maybe the movement behaviors are too strong or too soft, dont know, what you think Arges?
     
  13. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    It deals with steering in general, with behaviors that can be:

    • Go to that point
    • Wander around
    • Avoid static obstacles
    • Avoid moving vehicles
    • Flee that pursuer!
    • Follow that cab!
    • Walk in the same direction as those guys, trying not to leave them behind, but don't get too close
    • Or any other behavior that deals with, in general guiding a vehicle by controlling its speed and facing

    Behaviors can be trivially combined, and new ones can be easily written.


    Path itself is trivial to integrate, as UnitySteer already includes not only behaviors for following a path, but a class to convert those paths returned by AngryAnt's library. UnitySteer 2.0 hasn't been tested with Path yet, however, as Emil is in the process of updating Path.


    Like SilentWarrior mentions, that's better handled as a function of pathfinding by something like punching a hole in your navmesh. You could mark the mountain as an obstacle, but if you simply pathfind around it you'll get better results.
     
  14. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    You were probably using one of work-in-progress updates I've been doing in the past few months.


    Start off by setting the inspector in Debug mode, as this will allow you to see the force that each behavior is contributing to the vehicle (the Force property). That will likely give you an idea of where to look. Do check that you're not disabling the behaviors by any other mechanism - for instance, in our game I control the behaviors and vehicle via a behavior tree, for better tuning of the character actions.
     
  15. SilentWarrior

    SilentWarrior

    Joined:
    Aug 3, 2010
    Posts:
    107
    Right now, I am just trying stuff out, so, I have at least 6 different ways of moving a unit, also 2 different unit types : tanks and infantry.

    Tanks should only be able to move in one direction vector, forward or backward, but rotate as needed (rotation if higher than 30 degree require full stop).

    Infantry can move in any direction except up/down, but, they should rotate towards the place they are going, if they are going to be moving there longer than 2 secs (normally if distance higher than 10 meters, rotate towards it, unless shooting at enemy).

    Its an RTS game, so, the movement can be a big jerky if it cant be avoided, but generally should be as good as possible without having congestions (the bane of RTS games).

    So, what i am doing is, for infantry, I have mid tier script that interfaces the movement requested by unitysteer with a charactercontroller that has already code to control animations and what not that make the character animate properly (using locomotion for example, will probably be replaced later).

    The tanks are moved using a script that tries and simulate the engine with gears, and overall forces, and moves using wheel colliders. A different movement method just treats the tank as a box and drags it around (this works better atm :/ ).

    As for tanks, they seem to be working properly but are a bit jerky because of the interface, where unitysteers makes small ajustments of +5 forward to -5 backward, the tank shouldnt care about it, but, its rotating totally (mistake on my part), but, i have to find a way for unitysteer to take into account the limitations on movement of the tank, and gauge the need for the tank to move against the units around it, for example, infantry is smaller and can move in more directions (more agile) than the tank, so, in most cases it should be the one to move, but, sometimes, if units are on the move, they normally have more priority and shouldnt be affected too much, and just do a large arc around the tank to move faster.

    Also, I have to make changes to make unitysteer apply forces instead of transform movements, so a single infantry unit doesnt drag my tanks around, but, with that, unitysteer must take that into account and compensate for it.


    But other than that, i have to find a way to filter some jerky movements that unitysteer requests, so that, my units arent always on the move, but, will only move if actually theres a need for it. Maybe something with weights or effort type system, where it will only move if the requested move action is worth the effort for movement, effort beeing controlled with stuff like how good of a protection my current location gives me, against the one that is 5 meter away (essentially the same location, but less optimal).
     
  16. flim

    flim

    Joined:
    Mar 22, 2008
    Posts:
    326
    I asked this steering library in another engine forum however no one interested, I am happy I switched to Unity as this forum is awesome. Thank you so much.
     
  17. Jason-King

    Jason-King

    Joined:
    Oct 28, 2010
    Posts:
    56
    Is documentation anywhere regarding UnitySteer? Even where to set it up or FAQ or best setup practices.

    I downloaded both the UnitySteer library and the UnitySteerExamples. And the Examples just crashes Unity when I try to load: Creating directory library/metadata/00 failed. The crash can be resolved by creating empty missing folders. But in the end the examples fail to run with lots of missing this and that.

    I have no idea where to place the UnitySteer library relative to my project.

    Please advise.

    Thanks,
    Jason
     
  18. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    A description what this plugin does would be neat :)
     
  19. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    Jason,

    There is no tutorial yet beyond the examples, as we're tied up in our own game.

    If you're getting lots of missing this and that after checking out the github samples, getting the whole project from here might help: http://www.arges-systems.com/articles/48/unitysteer-20-released

    Are you using Unity Pro? If not, that would explain the troubles you're having. Basic Unity does not support external version control.

    Cheers,
     
  20. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    That's an impressive demo, nicely done!
     
  21. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    I'm getting around 12 FPS in the 77 character demo on an old nVidia GeForce 7100/nforce 630i. Not bad lol :L!
    Also, it might be wise, i think for future releases, launch it as a unitypackage file, rather than us having to download the whole project and make a package from that.
     
  22. Jason-King

    Jason-King

    Joined:
    Oct 28, 2010
    Posts:
    56
    Hi Ricardo,

    I believe I'm using Unity Pro (still under the 30 day license). I did get the project from github via the zip download. Are you saying that the zip is significantly different than a straight pull from github?

    Thanks,
    Jason
     
  23. markis

    markis

    Joined:
    Oct 11, 2010
    Posts:
    51
    Nice. Did you have webplayer to look how it works?