• Home
  • About us
  • Articles and Tips
  • Contact us

Articles

Home / Articles / UnitySteer: How are you using it?

UnitySteer: How are you using it?

Posted on: 04-18-2011 Posted in: Unity, UnitySteer

About a week ago I saw in Amsterdam a video of a pretty cool game (still unannounced) that Mike and Matt from M2H are building based on UnitySteer. While I’d heard they’d been working on it, I hadn’t seen it until now.

This got me thinking that one of the few downsides to doing open source is that you may not have a good idea of what people are using your tools for, so it’s difficult to consider it when designing changes, and how my own UnitySteer usage has changed with time.

As I mentioned on the last post on experimental changes, initially my use was a lot closer to the OpenSteer view of the work of vehicles moving along their forward vector, since I originally ported it for a prototype dealing with pirate ships of all things. That’s also closer to the dictionary definition, which is to guide by means of a device such as a rudder, paddle, or wheel.

My own current usage for the experimental branch has actually moved in the direction of bipedal agents, where for more natural movement you don’t want them to simply move along the forward vector – you want an agent to be able to side step to let another one pass, while not suddenly changing the direction they’re looking at. This is precisely what brought about the aforementioned change of changing the Vehicle’s Velocity to no longer be a function of their forward, but an independent vector on its own.

Since the experimental branch is still a work in progress, now would be an ideal time to help increase the chances of the end result being in tune with your needs. What are you using UnitySteer for? Is it for car- or ship-like agents, or is it more for humanoid creatures? Are you building your own components on top of it, or just using the behaviors that come out of the box? Did anybody end up building their own radars, or are you just using RadarPing?

About the Author

Ricardo J. Méndez

  • Popular Posts
  • Related Posts
  • Quick SteerToFollow example
    Quick SteerToFollow example
  • Screenshot Saturday 20110813
    Screenshot Saturday 20110813
  • Screenshot Saturday 20110806
    Screenshot Saturday 20110806
  • UnitySteer - AutonomousVehicles and Bipeds
    UnitySteer - AutonomousVehicles and Bipeds
  • Hairy Tales Previews
    Hairy Tales Previews
  • Quick SteerToFollow example
    Quick SteerToFollow example
  • UnitySteer - AutonomousVehicles and Bipeds
    UnitySteer - AutonomousVehicles and Bipeds
  • Hairy Tales progress - new elements and a boss
    Hairy Tales progress - new elements and a boss
  • (27) Comments
  • (0) Trackbacks
  1. Chris Forrester04-20-11

    I’m currently using unitysteer as the character movement coordinator for a dota-style game on the iphone.

    Iphone usage of course means the experimental branch is broken at the moment (hopefully the unity team will eventually patch their software to do a full c# compilation for the iphone platform), but using the development branch i’m having some good results with the package as a quadraped & biped & vehicle use-case.

    The major issue I have at the moment is getting position-perfect movement. Ie I want the characters to actually stop at x,y,z but with any non-instant turning values they will occasionally just run in circles around the target. So I use the destination distance and that looks okay, but I’d much prefer perfect placement with some sort of stopping ability if they would need to turn around once already going.

    (reply)
    • Ricardo J. Méndez04-21-11

      Hello Chris,

      Which components are you using that you end up with that behavior?

      (reply)
      • Chris04-26-11

        I’m using the “steer to target point” script, and a destination distance of around 15 for a 10 size object. I find that if i have a destination distance of 3 or 4 the character will just run around that spot.

        (reply)
        • Ricardo J. Méndez04-27-11

          Hello Chris,

          Please post a debug screenshot of your agent set up where I can see the vehicle settings and the force that steer for point is contributing, that’ll help me point you in the right direction.

          (reply)
  2. Victor04-25-11

    Well i am going to use this for a sports game but the scripts folder from the examples project is empty

    (reply)
    • Ricardo J. Méndez04-25-11

      That’s because the github project includes the actual script repository as a submodule. If what you did was getting the repository for the examples, just unzip the UnitySteer code on that folder.

      (reply)
      • Victor04-25-11

        Thanks

        (reply)
  3. Gajan04-27-11

    Hi Ricardo,

    Thank you for sharing your excellent piece of work, UnitySteer.
    I plan to use UnitySteer for “vehicle use-case”. Could you please let me know which branch or which components from the source code I am supposed to use?
    Is there an example for vehicle use-case?

    I am sorry, I am new in game development.

    Thank you in advance.

    Sincerely
    Gajan

    (reply)
    • Ricardo J. Méndez04-27-11

      Hello Gajan,

      Use the released version, or at most the development branch. I would not recommend the experimental branch, as it’s changing often.

      Regarding vehicles, I expect you mean like cars. There is no single example that demonstrates how to do it, since there are too many variables depending on your game – do you care about stop lights and other traffic? Is it simply a race track? Are there any rules to respect? I’d recommend you check out the examples project to see how the components are set up and go from there, but if you’re new to game development, it might be a bit overwhelming.

      Good luck!

      (reply)
      • Gajan05-09-11

        Hi Ricardo,

        I am sorry for being late. Thank you for your reply and guidance.

        Yea I meant cars by vehicles.

        Yes I do care about the rules like stop lights and other traffic in real city scenario. First I want to implement an application
        - which can move a car/object from one point to another,
        - improve it move across multiple points
        - use navmesh, waypoints
        - use collection avoidance for static objects
        - use collection avoidance for dyanmic objects
        – Respect the rules like traffic light, traffic.

        As you suggested, I will check the components of the project. I am sure it look really promising to suite my purpose.
        Thank you very much again for answering my questions and sharing the source code.
        Gajan

        (reply)
        • ZiadJ08-16-11

          Hi Gajan,
          I’m trying to simulate cars moving around in a town and I’m a bit lost on how to proceed with UnitySteer right now. It seems however that we’re sharing the same requirements. So I’d like to know how you’re getting along with UnitySteer and I’d be grateful to you if you could offer me some advice in what I’m trying to achieve.

          Thanks
          ZiadJ

          (reply)
          • Ricardo J. Méndez08-17-11

            Hello Ziad,

            Actually I’m mostly using it for bipedal characters right now. For cars in a town you’ll need to define and implement a lot of things that we tend to take for granted, for example:

            * Lanes
            * Traffic flow
            * Maximum allowed speed
            * Right of way
            * Traffic lights
            * Pedestrian crossings

            And so on. These things are very specific and outside the scope of UnitySteer’s methods, so I recommend you first make a good list of what you wish to implement and then start defining those behaviors top down.

  4. Chris V Gail05-02-11

    I just wanted to thank you for the nice tools you give us. I first used it to test some characters animation and interactions.
    Then i used it for modding the Unity car tutorial. Now i am planning to test the new version
    in Unity3, in a realtime visualisation like little project.
    keep up the good work!!!

    (reply)
    • Ricardo J. Méndez05-03-11

      My pleasure Chris. If you have some samples live, I’d love to see them. Cheers!

      (reply)
  5. kurtmel05-15-11

    Ricardo,
    Thanks you for sharing not only your hard work but your postmortums as well. I am an Instructional Designer by trade, but the serious games and immersive learning simulations area is getting so much focus in my circles, I would be remiss if I did not learn as much as I can about their design, development and production. Although I’ve worked with flash and various indistry standard e-learning development tools for years, Unity and 3D are a departure to be sure. But it is sites like your that are a godsend, especially your honest and insightful feedback about project management. Having dealt with both codemonkeys and all manner of creatives it is definately a gauntlet that the average self-respecting business process project manager would throw their hands up and run screaming like a little girl from the room. SO, I hope to not only learn from and use your AI wherever feasible/appropriate, but have marked your site as one of my “must read often” resources. Thanks you for all your hard work, wisdom and voice of experience to share with other.

    (reply)
    • Ricardo J. Méndez05-16-11

      Hello Kurt,

      Thanks for the kind words. I’m currently hard at work on our game, which has slowed down the article flow, but we’ll get back to that soon. I can’t wait until I’m finally comfortable showing it, and will probably do an article series on it once it’s out – it’s been a very fun process.

      (reply)
  6. Jorge05-18-11

    Hi

    I’m currently using this library for bipedal characters in conjunction with a pathfinding solution (i assign the result of the pathfinding to steertotarget and it works ok). The problem i have now is exactly what you mentioned in this article: i need the characters to keep looking in certain direction when they are moving so the movement cannot be through the forward vector all the time.

    Can you give me some advice on how to implement this? should i use a existing behaviour or modify one? or should i wait for a next release?

    Regards and thank you for this project.

    (reply)
    • Ricardo J. Méndez05-19-11

      Hello Jorge,

      Depending on how adventurous you’re feeling, you might want to check out the experimental branch, in which the velocity is separate from the forward vector. What you would need to do is override the Vehicle method “LookTowardsVelocity”, which (as you might expect) makes the vehicle gradually look towards the velocity vector, and instead make the agent turn by whatever criteria you want to apply.

      https://github.com/ricardojmendez/UnitySteer/blob/427535ef36096bdfb3c7a79fa93f1eead15287bf/Behaviors/Vehicle.cs#L315

      Writing this has made me realize that I should probably rename that to something like “UpdateAgentForwardVector” – I’ll do that change and push.

      As a warning, note that the experimental branch does not contain SteerForSphericalObstacleAvoidance since I’m implementing both obstacle and neighbor avoidance in a single behavior now (which I’ve yet to add to the main repository).

      (reply)
      • Jorge05-19-11

        Thanks, i’ll give it a try.

        (reply)
  7. xiaohaozi07-25-11

    Hello, UnitySteer is so cool,I’m currently using it in my RPG game on the Android and have some problems.I put some NPCs in the game scene and use the “SteerForPursuit”.The target of the NPCs is my game’s HERO.Other necessary scripts are also added.If I reduce the number of the NPCs(under 10),the game runs well on computer or cellphone.If the number of NPCs is over 15,the frames become unsmoothly,especially when the NPCs gather around the HERO.
    Firstly,I guess the reason is that those models have too many faces.So I replace the NPCs with cube but the problem still exists.Finally I think I know why.Every NPC have the component character controller to seprate from other NPC.When NPCs gather They collide with each other. Maybe the CPU CAN’T work well to do the Collision Detection.
    Anyone can help me solve this problem?Thank you very very much.

    (reply)
    • Ricardo J. Méndez07-25-11

      If I understand correctly, you’re using multiple agents each with its own CharacterController. Is that correct? I strongly advise against that, as character controllers are very expensive. You can read more here:

      http://www.arges-systems.com/articles/47/handling-slopes-with-autonomous-vehicles/
      http://forum.unity3d.com/threads/81181-CharacterController-performance
      http://forum.unity3d.com/threads/69766-Many-Character-Controllers-moving-at-the-same-time-and-Process-consumption

      This goes double for more limited platforms such as mobile.

      (reply)
      • xiaohaozi07-25-11

        Thank you very much^_^
        I exactly used multiple agents each with its own CharacterController.In my game the NPCs always follow the character and seprate from others,sometimes they will gather around the character.I tried Rigidbody but it is not appropriate because it will give a force to other NPC.
        Do you know any solution to my problem?I want that crowd of NPCs follow the character and they should not overlap.
        thank you O(∩_∩)O~

        (reply)
        • Ricardo J. Méndez07-25-11

          Since it sounds like strictly a PhysX issue, you might be better off asking directly on the forum. I can think of a few options, like making the rigidbodys kinematic, but that would require you to then handle vertical positioning yourself via something like raycasting against the floor (much like in iTween’s click-to-position examples). When asking, make sure you focus the question on the force issue and replacing CharacterController.

          (reply)
          • xiaohaozi07-26-11

            Thank you
            Frankly, I’m making a game similar to “Minigore”.

          • Ricardo J. Méndez07-26-11

            If your playing field is flat, like in Minigore, you might be able to get away with making the rigidbody kinematic and fixing the character’s Y.

          • xiaohaozi07-26-11

            eh,I marked the rigidbody kinematic and fixed the character’s Y.But the NPCs overlaped.

  8. Matthew03-29-12

    I’m using UnitySteer for NPC spaceships

    Using radar ping

    I’m also using a custom script to manage the weightings of the behaviours when an NPC has more than one behaviour (for example pursue target until NPC’s health is almost depleted, then run away)

    (reply)

Leave a Reply

Click here to cancel reply.

Recent posts

  • Hairy Tales Previews
  • Quick SteerToFollow example
  • UnitySteer – AutonomousVehicles and Bipeds
  • Hairy Tales progress – new elements and a boss
  • Public Alpha 2

Recent comments

  • Ricardo J. Méndez on Quick SteerToFollow example
  • Ben Ezard on Quick SteerToFollow example
  • Ricardo J. Méndez on UnitySteer 2.1 released
  • Elie on UnitySteer 2.1 released
  • Ricardo J. Méndez on Upcoming changes to UnitySteer
© 2009-11 Arges Systems Inc.. All Rights Reserved
TwitterStumbleUponRedditDiggdel.icio.usFacebookLinkedIn