Simple Object Avoidence

Just wanted to show off a simple pathfinding/object avoidence script I’ve been working on in my spare time.

Nothing really advanced. The script allows the AI to avoid obstacles using to raycasts, shooting one from each side, both facing forward.

Webplayer : Loading...

Comments/Criticism welcome.

Updated 17/9/2010
Changed camera from First Person to Overhead. Just try not to fall off…

i don’t see the avoidance at all. The screen gets filled with black bars (with red spheres ontop), surrounding the player, not able to see one thing, but black and red.

If you would do a pathfinding demo with auto avoidance build in, i would suggest doing it so from the isometric view, so the actors walk a path, with each time a different obstacle in their way, which they need to avoid. (the obstacle is random to the actor).

I thought it was really neat.

Looks like something I could use in my project. :slight_smile:

@ saymoo
Did you try moving around? The actors are set to follow the First Person Controller, avoiding the walls between them and the player. I might add other views and obstacles in future builds.

@ TwiiK
Don’t get your hopes up. I’m not doing script handouts… yet.

The little red/black guys are the AI following you. You can see how they avoid sticking into a wall, so they can keep chasing you. It works great, well done!

I have something similar for a game I’m working on. The Enemy ships chase the player ship while avoiding the islands in the way. Made it with two collisions protruding from the ship at opposite angles.

http://www.puppeteerinteractive.com/gallery/games/WarShips/

Noted. :slight_smile:

Luckily my project is on hold indefinitely for the moment being.

very cool stuff. this kind of stuff seems easier and more dynamic than A* or other pathfinding stuff. Now if you combined this with something like bounding box navigation seen in the A* pathfinding stuff I think it would have some major potential to not only avoid stuff but also find a path to the player so that they dont get stuck behind walls and such.

You could use the bounding box navigation for navigating around static objects like walls and the avoidance you created for moving around dynamic objects.

lots of potential

EDIT: I like your bear fighting the sprinkler avatar. It makes me LOL.

@Puppeteer - nice little game you’ve got there. :wink:

Why ya gotta be a tease like that? :wink:

Nice script you got going there
Just a tought: I think the demo would be better with a 3rd person/RTS camera, so we can see the AI react better!

This is actually quite fun 8) Good work!

@ zergcow
I might take a look at that. And by the way, it’s a dog.

@ ikke998
I’ll try and update it later today.

Updated 17/9/2010
Changed camera from First Person to Overhead. Just try not to fall off…

Anyone else found this hilarious? When it had first person view, I remember clicking the web link before even reading the description, so I didn’t know what it was all about when suddenly I realized I was being followed by these red eye cyclops, what did they want from me???

Now that you made it top view you made the ai sweetness more obvious. Works beautifully!

Yea top down allows me to see what the AI is trying to do more clearly. Great work there. I can still get them stuck in corners if I try (they follow so close it is hard to do). IF the AI bots were slower or further away I could see them getting stuck behind things easily. Would be good to see how this works in a more complex maze with deadends and such.

Either way I am impressed. Good work here.

Also, no way that is a dog! it looks 100% like a bear (although looking closer I kinda see how it MIGHT be a dog.)

Updated 18/09/2010
Slightly improved maze, and slowed AIs.

Also, it is a dog, here’s the original image: http://www.syncose.uni.cc/wharrgarbl.jpg