Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] Breadcrumb Ai (v2.0 IN DEVELOPMENT)

Discussion in 'Assets and Asset Store' started by kbmikemood, Sep 16, 2014.

  1. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Yep. Just wanted to make sure you keep that in there as many AI systems make it so that the AI runs for the player wherever they are, which is just dumb. Cool.
     
    kbmikemood likes this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Looking forward to seeing some new stuff here! :)
     
    Last edited: Aug 2, 2015
    kbmikemood likes this.
  3. Deleted User

    Deleted User

    Guest

    Good to see you're back. I think we can all relate with getting caught up with work and personal issues. I'm a previous purchaser, do you need any early testers for 2.0? I'd be interested, but I can understand if that's not realistic for your situation. Either way, looking forward to the new version.
     
  4. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Hey @Black Lodge Games

    I'd love to have 'testers' but this is update is more about the interface than the features themselves. So once I have a base model of the new interface and can control Ai and Teams better it'll be ready for 'beta'. At which point I'd love feedback on what to add/remove/etc.

    This version is kind of like a UX design, I need to make the user experience much better than it was with 1.2.2.

    Cheers! :)

    Mike
     
    Deleted User likes this.
  5. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    While setting up my new UI and prepping for the AI portion of development on BreadcrumbAi2 I was thinking about what types of Ai I can add other than the current basic ground and basic air. I was wondering about putting this old flight system I made to work with BreadcrumbAi. Would work for airplanes, spaceships, whatever. And still hold the same logic of Player > Breadcrumb > Allies > Hunt > Wander > Patrol, etc.

    Just a thought I figured I'd share. ;)

    Here's a look at the flight system in a test scene with 4 teams, all Ai:
     
  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Another environment to consider is water, which could possibly mix some behaviors of air and ground. But I wouldn't want to slow you down. :)
     
    John-G likes this.
  7. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Like hopeful said water would be the next logical area.
    Also under water sub AI would be very similar to air.
     
  8. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Water is a good idea, though I think all I would do is add buoyancy to a ground unit, so wouldn't be hard. :)
     
  9. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    Hi @Zero Logics, maybe Breadcrumb Ai for 2D platformer in the future?
     
    kbmikemood likes this.
  10. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Yeah that's a definite must. What I'd like to do is have an option in the Ai menu for 3D or 2D and if 2D is it top down (Zelda) or side scroller (Mario). It's not too difficult to implement. Just time, like all other things. :)
     
    arkhament likes this.
  11. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    Oh mate, I really want that.. 2D enemies with the AI of the Breadcrumb Ai asset will be great!
     
  12. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Yeah me too, it won't be too tricky really all I need to do is switch to rigid2D and vector2. :)
     
  13. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    I'm going to try to get it to work with some AI cars I have. See if I can get your AI to go to a car, get in, then have the AI cars drive to a place, and the Ai gets out and does other stuff (like chase the player or grab some quest item).
     
  14. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    The new version would probably do this a lot easier because movement will be based on velocity. But yeah this could totally be done. Only down side is you're not making a car using wheel colliders so it would really ultimately be just a different model using a ground unit AI hehe. Which isn't a bad thing.
     
  15. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Well, I already have a car solution (Realistic Car Controller) which recently included AI Cars. so that will be doing the driving.
     
    kbmikemood likes this.
  16. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Welcome back!

    Like the others said, water should be next. Terminators sink, but zombies should float and do an ugly swim stroke.

    Permit me to suggest longer range bread crumbs. Think tracking.

    Can't wait for 2.0, (though you know we have). ;-)
     
  17. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Mini update on what I'm working on. Nothing huge to update but figure I might as well give you some update.

    I'm working on implementing basic movements for Air, Ground, and Water using Rigidbody as well as basic movements for 2D side scroller, top down, and top down with rotation using Rigidbody2D. What I want is a simple selection of 3D or 2D in the Ai Menu, then a simple drop down of Air, Ground, Water, All [or] Side Scroll, Top Down, Top Down with Rotation. Should be pretty straight forward.

    I've also been working on a state machine for the ai, simple state machine that goes between things like idle, wander, engaging, etc. within each state is a condition weather or not to continue with this state or to go to another state.

    pseudo example:

    IF state is ENGAGE
    check type TargetType
    IF TargetType is Enemy
    continue in ENGAGE
    ELSE IF TargetType is Friendly
    change state to TARGETFRIENDLY
    ELSE IF TargetType is Breadcrumb
    change state to TRACKING
    [IF state change success is TRACKING]
    IF previous TargetType was Enemy
    continue in TRACKING
    ELSE previous TargetType was not Enemy
    change state to IDLE

    Conditions of course are the main thing about Breadcrumb Ai that's customizable. You'll be able to tell the Ai what conditions you want to have. Follow allies only, hunt down enemies, wander and ignore everything, whatever you want. So I'm hoping to have a huge amount of conditions that determine how the state of the Ai is handled.

    and for those that are curious, the state machine is run under a coroutine that is launched on the Start() of an using a while(true) loop. Within this is a large number of switches and conditions for more switches. ;)

    questions, comments, concerns, let me know. I'm off to sleep then back to work :p
     
  18. chrisoooooooooooooooo1

    chrisoooooooooooooooo1

    Joined:
    Mar 30, 2015
    Posts:
    53
    Can you please add an example for an air-enemy on the next update.
    Am i right to assume i can use an air-enemy like a ghost, like in the ghostbusters game? Meaning a flying enemy in a room, not like a plane in space.
     
  19. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    @Zero Logics Can you add some mechanism for the AI to climbing ladders(or maybe One-Way Platforms where the AI can jump if the player is above or below), That would be super useful for 2d platformer game where zombies or attackers can climbing ladders to following you like crazy.

    Regards,
     
    Last edited: Aug 10, 2015
  20. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    There's a couple of ways to do air units here, here's some info below on how I'm going about it. Let me know if this makes sense or not.

    Air
    Vehicle - constant forward velocity, pitch, roll, yaw, etc.
    - Free roam, can go up down left right
    - Locked, unit is positioned X distance from the ground (moves with slopes)​
    Regular - movement controlled by behaviour
    - Free roam, can go up down left right
    - Locked, unit is positioned X distance from the ground (moves with slopes)​
     
  21. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    So currently BreadcrumbAi avoidance can jump over obstacles as well as jump over gaps, so I don't see having them go up a ladder be hard. However It's almost a specific thing that would be done on a per game basis not a generic ai system.

    What you, the developer, would do is create the Ai then have your own trigger for ladders and such. Just a quick spitball would give me an example like this:

    Ai is following the target, while running towards the player the Ai bumps into a ladder, the following commences.

    Code (CSharp):
    1. void OnTriggerEnter2D(Collider2D other)
    2. {
    3.      if(other.something == something)
    4.      {
    5.           ai.isActive = false;
    6.           ladderScript.enabled = true;
    7.      }
    8. }
    So you would stop the Ai from being in control and then switch over to a ladder script that would essentially move the Ai up and down the ladder. Once you reach the top of the ladder you would just disable the ladder script and reactivate the Ai. Again this is something I feel is more specific on a game to game basis and not something you would add to a generic Ai. Until the logic works, I don't think this is something I can add right away.
     
  22. chrisoooooooooooooooo1

    chrisoooooooooooooooo1

    Joined:
    Mar 30, 2015
    Posts:
    53
    Sound cool, thats what i need. But when i add an enemy in my current scene with the air box checked, the enemy doesnt move around. He/it does only shoot at me.
     
  23. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Make sure you have movement and rotation speeds set to something. If the speed is 0 you won't move, and if the rotation is 0 you'll move in one direction.
     
  24. chrisoooooooooooooooo1

    chrisoooooooooooooooo1

    Joined:
    Mar 30, 2015
    Posts:
    53
    Well, for my quick-try, i just used your ranged prefab enemy and gave him the fly movement... would that work?
     
  25. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    I wouldn't suggest using any of the 'prefabs' from the example, those ai were made specifically for the example. I would toss a new Ai component on a new gameobject and play with the options. If you choose Air and turn your rigidbody gravity off, you should see how it works.
     
  26. Deleted User

    Deleted User

    Guest

    Wow, I really like the direction you're going with the new version. I can use ground, water, air, space, and 2d AI, so having that level of flexibility in one package sounds extremely enticing... intoxicating almost really... Hope it goes smoothly in the implementation! Thanks for the updates!
     
  27. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Here's a quick something I was working on this evening. A console specific to each Ai, it displays in the Inspector. I'll add a Copy and Save button. I think it could be helpful to see what certain Ai were doing while you weren't around to see it. Thought I'd share. :p



    giphy link: http://gph.is/1TzkJJg
     
    Deleted User and hopeful like this.
  28. ZombieAnomaly

    ZombieAnomaly

    Joined:
    Aug 2, 2014
    Posts:
    19
    Great addition! The console would work wonders while debugging! :)

    Also! Quick question. I have about 4-5 waypoints throughout my level and the AI navigates them rather well. The only problem i'm really running into is while the AI patrols it will sometimes get stuck between waypoints and just go back and forth between two. Any suggestions to fix this?
     
  29. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Do you mean it get's stuck as in the Ai stops moving or moves spastically? or are you saying it can only see 2 of the waypoints so it goes back and forth between them. The current Patrolling system essentially picks a random waypoint that's in line of sight. If any of the waypoints are out of line of sight it just disregards it.

    I'm working on having a different waypoint system for version 2. One where you can either randomly patrol different waypoints or use a specific waypoint path from point A -> B -> C -> D -> C -> B -> A etc.

    Hope this explains your issue! :)
     
  30. ZombieAnomaly

    ZombieAnomaly

    Joined:
    Aug 2, 2014
    Posts:
    19
    Yup! Everything is resolved now! The new way-point system sounds wonderful by the way :)

    Also! Quick fix you might want to consider: The AI (or at least when I initially integrated into my game) would draw line of sight from AI to player on the feet and it would cause issues with the collision line as my terrain is uneven. I've raised this collision line to start from the AI's head and end at the players chest, after this everything worked flawlessly. Maybe have a public offset variable if people need to adjust that detection line?
     
  31. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    This has been discussed for quite some time and I'm absolutely fixing it. It's mainly due to the origin of the raycast being "transform.position", and since some people don't have their pivot of the GameObject in the center, instead they use the bottom, the raycast becomes obstructed by the ground or self.

    SO, the fix will be a customizable vision point, so a StartPoint (the Ai's eyes) and a customizable retrieval point (end point) so what the ai is looking for. This way it doesn't go from transform.position to transform.position it goes from StartPoint to EndPoint both completely modifiable.

    This itself is quite the task ;)

    Cheers!
    Mike
     
    hopeful likes this.
  32. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    I was rereading some of the posts above, and your mention of "teams." Would it be possible for you to include an alternate system for "factions," as not all my groups compete against each other, and sometimes their alliances change. Thanks again for your great assets!
     
  33. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    I'm not entirely sure what you mean in terms of differences between faction and teams.

    The way it will work is there will be 4 defaults. None, Neutral, Player, Enemy. You can add as many as you want. Blue Team, Red Team, whatever name. Then by default all teams are against each other with same modifiable settings like Neutral doesn't have any enemies. More to that you can choose which team will ally with another. I'm still working on how that'll work in runtime but it's pretty basic and will hopefully work as intended.

    Think how teams in Starcraft work, that'll be kind of how this works.

    Cheers!
    Mike
     
    hopeful likes this.
  34. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    I mean factions like an RPG, like Elder Scrolls. Starcraft has RTS teams.

    Each "team" needs to be independent of each other. Red team and Blue team can be allies, But Red team can be enemies with Green team at the same time that Blue team is friendly with Green (or neutral with Green).

    Plus, the player is treated like a another separate team. The player can be part of Red faction, but be enemies with Blue, In spite of Red and Blue being allies, (which usually happens because the player killed to many blue members.)

    Basically, I need each team to have a war list of its enemies, and I need to be able to add or remove other teams and/or individual players from a team's war list in real time, so breadcrumb will know who gets attacked by who.

    What this does is it makes breadcrumb RPG ready, which if you would accept that genre as a potential customer, might not be a bad thing. I use ORK Framework off the asset store. ORK comes faction ready out of the box, but I need breadcrumb ai to permit and remember my setting the shifting alliances in real time, so the breadcrumb ais know who to attack. This may be beyond the intended scope of your project, but it would be cool.
     
  35. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    @wood333 basically that's how it'll work. You have control, through code, to say who is allied with who. If Red Team is allied with Blue Team that doesn't necessarily mean Blue Team is allied with Red Team. It would essentially be a list like

    Red Team: <My Allies>
    Blue Team: <My Allies>
    Green Team: <My Allies>

    I don't have the syntax nailed down yet, but it would be something like thisTeam.AddAlly(team).

    In the end, to answer your questions, it should work for what you're doing :D

    Cheers!
     
    hopeful likes this.
  36. Deleted User

    Deleted User

    Guest

    I exclusively work on RPGs, so I love the faction feature!
     
  37. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    That's Great! This means breadcrumb ai can be used for any entitiy/faction in the game. Enormous potential.
     
  38. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Hi All!

    Just little update letting you all know I'm still working away on BA2. This next month is busy due to work but all my extra time is still going towards BA2 dev. As soon as I have something new or interesting to show I'll post it here!

    Cheers!
    Mike
     
    Deleted User, 99thmonkey and hopeful like this.
  39. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Any update?
     
  40. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Sure!

    Things are progressing nicely, unfortunately I've been hit with a bit of real work but I'm still putting a lot of time during the evenings into BA2.

    I've got a lot of work done on the new state machine so and things are working quite nicely. Yesterday I started working on the Waypoint system for patrolling. Waypoints can now have paths as well as be continuous paths.

    Ai can make decisions to go between wander, idle and patrol. Soon I hope to have the ai look for the nearest patrol path.


    Patrolling paths can be continuous with the click of a button


    More to come! :)
     
    hopeful likes this.
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I've also been wondering about how Breadcrumb AI might be hooked up to a behavior tree system like Behavior Designer.

    I'd like to have a robust navmesh-free 3D navigation system that could plug into a behavior system.
     
  42. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    I actually started BA2 dev designing a state machine that looked exactly like the Animator Controller node based state machine. I ran into too many issues and decided to keep an internal state machine until I can better develop a node based system in the future if it'll work.

    It would be fun but for now the new system works well and if any coders want to add or change states and state behaviours, it's pretty flexible.

    :)
     
  43. ZombieAnomaly

    ZombieAnomaly

    Joined:
    Aug 2, 2014
    Posts:
    19
    Any updates on breadcrumb 2.0? :)
     
  44. kbmikemood

    kbmikemood

    Joined:
    Dec 12, 2013
    Posts:
    68
    Working away on it whenever I have free time! :D
    I've been quite busy the last little while with contract work, my own gamedev, and most recently my kickstarter (shameless self promotional link if anyone is interested)

    The goal was end of sept to release breadcrumb ai 2. I'm hoping to finish a lot of development during the course of my kickstarter since the success of said kickstarter dictates where my priorities will lie. So while I have the time, I plan to push it out soon! (again with that soon word...)

    Sorry for the quietness on the forums, I'll try to push out more regular "where I'm at" updates in the future.

    Cheers! :D
     
  45. Deleted User

    Deleted User

    Guest

    Cool stuff man. Congrats on getting to work on the Meatly game; I hope you get funded!
     
  46. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    I have Strange problem That is stopping me doing anything in Unity.

    In a brand new empty project I imported Breadcrumb AI from the asset store
    A window popped up "API Update Required"
    This project contains scripts and/or assemblies that use obsolete API's etc.

    I clicked I Made a Backup. Go Ahead.

    I tried the Breadcrumb AI demo scene and the player automatically runs into a wall and wont stop running no matter when key I press.

    So I create a new scene, import Standard Assets "Characters"
    Drop a First person controller on to a newly created terrain like I've done hundreds of times before.
    And that controller runs off into the distance too!!

    So I create a brand new project, create a terrain, import the unity standard Asset Characters drop an of the controller prefabs into the scene and the run off on their own !!

    So I open a project I was working on last week load the scene and my player runs off on its own!!

    It seems Breadcrumb AI has changed something within my unity installation and I don't know what, but it is stopping me do anything?

    Any ideas what it could be or ideas how I could identify what it is?

    Cheers

    Roy

    UPDATE....
    I made a video showing what is happening

    Also I've tried deleting my preferences folder and restarting Unity, that didn't work

    UPDATE 2 .....

    OMG I Figured it out

    Nothing to do with Breadcrumb AI that was just a coincidence
    A few day ago I was playing around with TrackNoIr (head tracking software that uses your webcam.) for Elite Dangerous it wasn't for me so I Uninstalled it.
    But I hadn't noticed that it had installed a "virtual joystick" driver, this is what was causing the problem, I uninstalled that and everything is back to normal Pheeww!

    Gawwwd that was doing my head in.

     
    Last edited: Oct 4, 2015
  47. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Been a month since last progress report. How is BC2 going? I am really looking forward to it.
     
    arkhament, hopeful and Mr-Stein like this.
  48. DA_ATeam

    DA_ATeam

    Joined:
    Dec 6, 2012
    Posts:
    5
    Breadcrumb AI looks very nice. However I'm looking for AI that enables the enemy to attack after they follow or get with in range. I saw on the video where you mentioned 'attack within range' but you blew over it. Does this work well with Mecanim animations and will Breadcrumbs transition into playing Attack animations? Thanks!
     
  49. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Oh where, oh where, has Mr.Zero Logic gone,
    an update, well nothing could be finer.
    With nothing to do without BC 2,
    we must play with Behavior Designer. :-(
     
    Last edited: Dec 6, 2015
  50. RickRok

    RickRok

    Joined:
    Dec 23, 2014
    Posts:
    2
    This looked like such a promising asset, especially BC2, but concerned with what looks to be support slipping away