[Released] PathBerserker2d - 360° platformer pathfinding

The Automatic 2D Pathfinding Solution

Released! Find it here: https://assetstore.unity.com/packages/slug/175968
YouTuber? I will give away free copies in exchange for shout outs. You must have a channel with at least 400 views on your recent videos. Contact me if you are interested. (Any give-aways are up to my discretion, no promises made)

What is it?

PathBerserker2d is a new pathfinding solution for 2d platformers.

No longer do your enemies have to be constrained to the boring “move from left to right and back again” movement pattern seen so often in platformers. Stand out from the crowd with smart enemies, for which even walls and ceilings are fair game to path on.

Features

  • Full 360° pathfinding. Let your characters walk on walls and ceilings!

6087369--660894--threesixtydegree.gif

  • Supports different agent heights on the same graph!

6087369--660891--heights.gif

  • Supports pathfinding on moving platforms!

6087369--660885--moving_platform.gif

  • Build-in support for elevators, ladders and teleporters!

6087369--660888--elevator.gif

  • Mark areas with custom tags. Tell your agents to avoid/prefer those tags when pathfinding.
  • Bake navigation data at the click of a button from your existing colliders! Automagically!
  • Fully multithreaded pathfinding Find paths with as many threads as you want

Videos

Web-GL Demo

I host a Web-GL demo here:
https://oribow.github.io/PathBerserker2dDemo/

Read the Documentation

I host the documentation that ships with this asset here:
https://oribow.github.io/PathBerserker2dDemo/Documentation/

Got any suggestions, ideas for features or need help with the Asset?

Please comment below!

Hello,
I’m wondering, when it comes to path-finding, the AI follows a pre-made track, right? Or does it behave according to the surroundings, understanding where it can step and where it would fall to its death?
Because you wrote “smart enemies”, and seeing the last 2 GIF (cute ones, by the way), does that mean that you can “tell” them to go somewhere, and they’ll move along their own optimal path while avoiding dying? (like in your third GIF)

Its like a 3d navmesh, but for 2d. The navigation data is prebaked and the agent pathfinds on this data.

Figured out how to host a demo web-gl build of the plugin. Please check it out to see the pathfinding in action.

https://oribow.github.io/PathBerserker2dDemo/

Made a new Video to showcase an example setup for the plugin. (Video editing is hard)

Polishing is going well. It should be ready soon.

Oof. Just finished writing the documentation. I never want to write a documentation again. Its so boring!


(One of the silly graphics I made for the docu.)

Did you know that you can’t use Gizmos.DrawIcon in an asset package?
The icons for that must be placed in the Gizmos folder. But that folder can’t be included in an asset package.

Thanks Unity! \s

I’m preparing the final video for the store page. When its completed the submission process can finally begin. Yay!

Here’s a clip for the video. It showcases how PathBerserker2d in combination with user defined markers can produce unique agent behavior. In this example some robots are heat resistant and just go through the lava, others are not and have to take the longer way.

Video completed and it turned out really good! Didn’t make it my self, but had help from a cool guy.

I have submitted the asset to the store now. Hopefully it will be approved soon.

Asset is now live on the AssetStore! https://assetstore.unity.com/packages/slug/175968

is there a road map?

real time beking for the nevmesh?
differnt jump distnaces ?
wall ditection? (even if i can make it with raycast, having the logic from the path will be nicer)
edge climb?
free flying?
moving platforms in x and y?

its looking intesrting , and i would want to give it a try, but for now its a bit missing alot. from tutrials + more demos + looking at the docs, everything require payment (there is no refund ) so its 44$ with out seeing what i get.
and yes, i think there is some features left before making it a full product

Hi there!
Thanks for the interest, sorry if the features of this asset weren’t communicated clear enough.
Let me go through your questions point by point.

Is there a road map? - Not yet
Not yet, but a good suggestion. I’m definitely planning to further develop this asset based on feedback. I wanted to wait for a little more feedback before promising any new features, as I don’t want to develop features no one asked for.

Real time baking for the navmesh? - If there is demand for it
You can load and unload prebaked navigation data which should cover most use cases. Baking at runtime is possible to implement, but I’d like to know if there is even a demand for such a feature first.

Different jump distances? - Already there
JumpLinks can be as long or short as you want them to be. They really are analogous to Unity’s OffMeshLinks https://docs.unity3d.com/Manual/class-OffMeshLink.html.

Wall detection? - Already there
Right now, you can use the physics system to raycast for an intersection and then ask the pathfinder about what data it has about that intersection. That should be pretty way faster then me rolling my own raycast implementation with all the bells and whistles.

Edge climb? - Up to you
This asset is meant to solve pathfinding for a broad range of 2d platformer games. I can’t predict in what way edge climbing is going to work in your particular game. The simplest solution would probably be to change the animation of the NPC’s when it’s following a path on a ceiling to a climbing animation. You could also mark certain edges for climbing and solve it that way.
So in a sense edge climbing is already supported.

Free flying? - No and maybe never with this Plugin
Definitely a neat feature to have, I agree. But the current system only deals with edges. Implementing this would require a completely different pathfinding system that handles the empty space between colliders. That might as well be an entirely new Plugin. Maybe I will do that if there is sufficient interest in it. But it probably will be its own thing.

moving platforms in x and y? - Already there
That is already possible.

from tutorials + more demos + looking at the docs, everything requires payment (there are no refunds) - Going to make Doc available on here
I guess I could upload the docs to this thread. Thanks for that suggestion!
I don’t quite get what you mean by (there is no refund). All Assets on the Unity AssetStore can be refunded, at least to my knowledge. I’d even personally do so on request.

Did you play the WebGL demo? If so, what else would you like to see in a demo?

Alright edited the OP to include a link to the docs.
https://oribow.github.io/PathBerserker2dDemo/Documentation/

When I bake my path, it gets offset, as seen below.
Also, I notice there is a gap on all of the bottom-left corners.

When I baked, I received this warning message:
CreateMesh returned null
UnityEngine.Debug:LogWarning(Object)
PathBerserker2d.ColliderConverter:Convert(Collider2D)
PathBerserker2d.IntersectionTester:ColliderToPolygon(Collider2D)
PathBerserker2d.NavSurface:StartBakeJob()
PathBerserker2d.NavSurface2dInspector:OnInspectorGUI()
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I’m kind of in the dark here. The documentation is good, but there is no setup guide so I’m just trying to do my best by looking at the example scenes.

Hi,

“CreateMesh returned null” is a message that gets triggered when Unity’s CreateMesh returns null. That means a collider could not be transformed into a mesh by unity. What colliders are you using? Edgecolliders are handled differently by the system so that shouldn’t cause an issue. The message is just a warning the collider in question will be ignored by the system.

I’ve adjusted the warning to be more helpful.

Thanks for the documentation feedback. I will add a setup section to the next update.

It would help me a lot if you could post an example scene with the issue occurring. If you do, please PM (or email) me the scene to prevent any accidental leaks of my asset.

I am using a composite collider on a Tilemap. I just PM’d you the project.

Okay, I found the bug that caused the offset. CreateMesh acts weird when Rigidbodies are involved, which where used to enable the composite collider. I fixed that now.

The warning also was given because of the composite collider. A composite collider can’t be turned into a mesh and it also shouldn’t be. I will change the system to ignore composite colliders.

As for the gaps, I’ve drawn an image to illustrate why this is happening. In your case I suggest to switch the collider type of your tiles from “Sprite” to “grid”.

hello,

first of all, great work with this asset. I’m trying to use it in my project but I have a problem with segment slopes. I will attach an image for explanation.


Could you tell me where is the problem? I don’t know why the agent don’t go to the red point. If I move the red point left of the agent, it works well.

Thank you.

Interesting. Could you make an image of your collider setup? Or better yet send me that scene in a pm? I can’t tell from the image alone what issue might be.

I would guess, that the slope’s green line doesn’t connect with the horizontal green lines. This might be an issue with the collider setup.

Thanks, I identified the problem.


The colliders meet at a single point (encircled by red). This can either lead to the creation of one polygon containing all (what you would want), or of 3 seperate polygons (marked in yellow), which is what caused the wierd behaviour.

Such single point touching of colliders should always be avoided.

I suggest you add a filler tile to make it a real hull.


The yellow hull now definitely is one polygon, instead of being multiple. That filler tile does not need to have a texture. It can be entirely invisible to the player, but it must be set to have a collider.

This explanation is definitely something I will add to the documentation of the next release as it isn’t immediately obvious.