Pathfinding + avoidance for RTS / MOBA / Tower defense / Diablo - like

---------- EDIT 06 / 02 / 14 -----

---------- EDIT -----

---------- EDIT -----

Hi, here is the latest video showing Paradoks Astar + local avoidance with an character manager.

---------- EDIT -----
Hi here is a video showing the local avoidance:

all the assets should be sold when done

---------- EDIT -----
Hi here is a video showing the local avoidance:
I made the character and the grass texture too , tell me if you are interested in.

---------- EDIT -----

Hi here is a video showing the avoidance queuing behavior:

first video:

Hi all,

I am making a pathfinding tool wich use pathfinding and light avoidance.
I used to use pathfinding solution from very talented people, but found out that when i had to modify their script the code was too big and complicated.
So i begun to make my own with in mind :
Simplicity and Inexpensivness.
So the project is for now only 3 Scripts:

  • Astar script
  • Map script
  • Seeker script
    all are around 400 lines of code.

Here is the video of the first version:
The quality setting are all on fastest.
the code profiler is the one from Duckets :

My computer is an old Q6600 - ATI HD 5700 - with 2 gigs of RAM.

The 100 clients are totally autonomous, and dont know about each other.
The fps count is usually 30/40 fps greater than in the video certainly because of the video recording software.
You can see little spikes when i change the target location, its because the pathfinding is launched at the same time for the 100 clients otherwise there is never any lags.
I made that the clients can overlap a little so they not get stucks, but this can be tweaked in the inspector.
Sometimes you can see that clients pass trough a wall, its because the map/obstacle need a little optimisations:
The clients cant avoid concave walls made of two walls because of raycasts it just follow the the first wall and continue.

For the movement i am using a simple :
transform.position += transform.forward * moveSpeed * Time.deltaTime;
And it use a simple Collider.

I plane the sell the tool in the asset store when finished.

Paradoks

Little Update on the first thread showing:

Tell me what you think about.

Looking good, keep going!

This is awesome. How did you make it? Is there a particular technique that you used?

@Cookimage: thx ! i continue but its hard work, soon a new video

@jRocket: thx, if you mean by “technique” the pathfinding, i use a simple Astar algorithm.

Just have to say the avoidance looks great. Does it work on a navmesh or a tile system as your game seems to be a 2D map layout?

Hi all, in the first post edit, you will find the latest video wich includes:

Astar + local avoidance + character manager that that does the enemy finding etc.
the FPS is fairly high, around 100fps with 64 clients.
You can see lags sometime, it is due to the instantation not the astar.

As is said to Gnimmel: I still dont know if i will be able to finish the tool and if so, if i will have enough time to make my game AND give support for the tool, as i realised that its a lot of work.

If i could i would move the thread to an other topic, but nothing is definitive.

Paradoks

This is awesome, just wondering if you have a webplayer avalable for it?

Guys, sorry for not answering earlier.

@ Gnimmel: the tool is pure 2D grid, the Y is handeled by the character controller.

@ 3 : i am trying to get a webplayer as soon as possible, the tool is becoming more a unit/player system than a “simple” pathfinding system.
but you will see that soon !

For now here is a new video, brown vs blue team, the towers are spawning units every X seconds.
the spawned units aim is the opposite team tower but when an enemy comes close the unit attacks it.

Whats the fps of 500-600 units?

@GCat, i dont really know as my computer would probably burn with that amount.
my max test for now is 100 and i was around 80 fps if i remember well. but my computer is very old
Q6600 ( 2007!) + ATI HD 5700 + 2GO ram.
on a recent computer fps count the could easily be 240fps for 100 units i think.

  • with 500 maybe you dont need a very good precision too, you could get a few cycles too.

Hey Paradoks, great work! Looks fantastic. What do you hope to do with this once you’ve finished? Are you going to release it as a plugin or something? If so, I would be very much interested!

Thanks.
Ollie

Wow this looks really good. Has anyone else here tried local avoidance code on their own? Im using aron’s a* pathfinding and trying to write my own avoidance code right now, but its being quite troublesome. Anyone know of a solution? I may end up writing my own pathfinding code that incorperates occupied spaces of a grid, or try modifying aron’s code. thanks,

Hoping this becomes something available whether for free or purchase. Now that A* pathfinding no longer supports local avoidance, we need a new solution!

Hi all,

@ oliver-jones @ rxmarccall
As is said, i would really like to release it but found that the support would probally kill my game dev activity, so i still really know if i will be able to release it. but i promess i will try!

@ camtronius
I had similar problems in fact, as i begun with the a* but was unable to make a local avoidance to work, so i made mine from scratch.

BTW I am trying to get a demo running soon!

I’m in the same boat as you. I’m currently messing around with aron’s A* pathfinding too, and I need to now include some kind of local avoidance. Although I’ve never built my own before, so I don’t really know where to start.

Hence why I’m asking around the community :slight_smile:

Hi all,

In the first post you will find the latest video.
I added “light-evasion” so the clients are not stuck ( too much) anymore when they are chasing an enemy.

You can also see that i added a game environement to test the tool in real game situation.
the additional draw calls are heavily impacting the performance, now with around 60-70 DC and 30-40 clients going to the opposit base i got around 100-120 fps in “maximize on play mode”.

I tried to be as close to DOTA as i could, improvement will come anyway.

if you are interested in some assets present in the video dont forget to check my asset store page please:

if you see something that is not yet on the store just let me know i will put it in asap.

Thumbs up for an awesome display of pathfinding + avoidance!
Count me in for purchasing the asset. Also, I can be an early backer to this kind of work, to support the developer to finish it.