Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / RAIPF - Path finding

Author
Message
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 20th May 2005 06:24 Edited at: 20th May 2005 06:30
I'm still working on this one, but it's getting quite better.
I've removed the diagonal movement (between two walls), but now the AI tries to avoid every form of diagonal movement, still working on a better method.



Here you can see a working example. The final version should allow you to add pathfinding to your game the easy way.

First you need some arrays:


Now it's setup for 1 AI ( slot 0 ).

You can calculate a path for him using this code:


Now there's a path calculated on the mask_buffer array. Let me explain this:



And now you just move him towards the "waypoints"/path stored in the Maze_AI_Path array.

The final version will have better instructions. Tell me what you think

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th May 2005 17:57
Looks interesting.

However, you may want to change the name... When I read it first, I was quite shocked that you'd called it "Rape-F"...

Just food for thought

Jess.


Team EOD :: All-Round Nice Guy
dbHelp
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 20th May 2005 18:05
Seems very nice routine, what method does it use for finding the correct path (A*, flood fill, etc) ?

Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 20th May 2005 22:58
@JessTicular
Uhm... you're right You're not supposed to call it that way though!

I'll think of a better name later.

@Baggers
Well, it's certainly not A*. I coded this myself without using a method from the internet. The method probably exists already though

Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 21st May 2005 02:45
How about TAIPF:
True Artificial Intelligence Pathfinding.

And tape is alot more benign than...what you had.

My name is Underhill. Commit it to memory.

Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 22nd May 2005 23:20
hehe...nah just call it RAPE...at least we'll understand.

Would you mind explaining how it goes about looking for the path. Itll help me when looking through the source.

Login to post a reply

Server time is: 2024-11-23 04:43:20
Your offset time is: 2024-11-23 04:43:20