Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Flow Field Pathfinder

Discussion in 'Works In Progress' started by asasababoon, Sep 26, 2015.

  1. asasababoon


    Apr 6, 2013
    Hey guys, I'm currently working on a pathfinder asset based around Flow Fields. an example:

    I would really apprectiate if you could give me feedback and ideas on what features you would like to see in the pathfinder that you might be missing in other assets in the asset store, or what you miss in the API .

    At the moment the general idea is: a pathfinder that is easy to setup and works with flowfields, which makes it especially good for large groups/swarms of units. The pathfinder can work with multpile levels of terrain going over itself (like a bridge and such). and it will have a path management system that ensures no useless data stays floating around.
    one_one likes this.
  2. Velo222


    Apr 29, 2012
    I thought about doing this 2 years ago. I got the algorithm down, but bilinearly interpolating the positions I could never get down. As well as how to go from one sector to the next seamlessly. So I'm glad to see you want to work on it!

    That aside, I would love to have flowfield pathfinding as an option in Unity. When I think flowfield pathfinding, the main feature I expect from it is a pretty good ability to solve the "local avoidance" problem with most pathfinding, which I'm assuming the flowfield will do very nicely. I want my units to "go around" other units when necessary, and not bump into them. However, I also would like for the pathfinding to be able to cover quite a large area (for example a pretty large terrain size in Unity) if possible? I know the larger it is, the harder it is to make it perform well (like pretty much anything). Also, for my specific game, I often have areas that are enclosed and unreachable (i.e. an area of terrain that is surrounded by walls), so that units can walk around inside that area, but units outside the walls can't traverse into the area -- if you get what I mean. Not sure if the flowfield would solve that automatically or not, it might?

    I can't really tell you what I miss in the API, or what's missing in other assets in the asset store, because I don't think there are any true flowfield pathfinding options on the asset store right now? Correct me if I'm wrong. The only one that might use some sort of flowfield that I know of is the Apex pathfinding solution....but I'm not even sure if they do either.

    I hope you succeed in this! Good luck. Let me know if you have any questions. Also, are you Frank Cheng by any chance? lol.
  3. brute-


    Mar 2, 2013
    Looks great so far. It would be really cool for a tower defense type game.
    The ability to control how much the agents spread out would be a neat feature. That way you could have "less-sophisticated" agents that all flow through the closest path straight toward the player. But then other agents could choose alternate paths because they want to spread out more. It would add much more dynamic game play.
  4. asasababoon


    Apr 6, 2013
    Thanks guys, really appreciate the feedback, to answer your questions:
    - I'm not Frank Cheng :p
    - making units go-around each other is definitely a feature I want to work on, but no promisses yet on how good its going tot be.
    - Covering large areas is something I have/am fixing with the use of HPA*. I dont know how large you want to go. But at the moment maps of 512x512 are perfectly do-able, it also depends for what platform you want it.
    - units being walled of is no problem, but this should be the case for any pathfinder, regardless of using flowfields. However HPA* does help me figuring this out
    - To control how much units spread out would be cool, and i'm going to look into it. Units would move like a zerg horde if there is almost no spreading out, a little spread looks more like a batalion walking, and large spread taking perhaps different paths in the world? That last one might be to tricky/ time consuming for now as i have a deadline to finish this project by January.

    I forgot to mention this project builds further on an assignment I did earlier, that explores the diffrences between using paths & flowfields. You can check it out here, with a link to the paper in the description, it gives you you insight of how to build the systems and how well they perform in different scenarios.

    Dont pay to much attention to the unit steering :p. It was not part of the assignment and I put in at the last moment just to have some units moving around.