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.

DarkBASIC Discussion / Waypoint help with AI... help please!!!

Author
Message
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 29th Jul 2005 18:02 Edited at: 29th Jul 2005 18:06
See, the thing is I have a map set up with waypoints. Well, not setup, but with a lot of waypoints. What i need to do is to get a monster to follow the waypoints in a way such that he finds you. But, since this is an fps, you will be constantly moving. I don't want monsters to go thru walls, so i decided to set up a small AI system. So here's my question... how do i set up the monster to follow the waypoints around walls to find u?

This is the pseudocode, but i have no idea as to how to code it:



P.S. Can u even create lists in dbc??

EDIT: Btw, the site i got the code from was http://www.ai-depot.com click on tutorials and look for pathfinding for beginners or something like that

Thanks a lot if you can help

If practice makes perfect and nobody is perfect, then why practice?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 30th Jul 2005 14:58
Metrion,

You could always check close ways points to the monster, checking which of these waypoints are closest to the player. Therefore, to clarify, have a standard, that your program will evaluate any waypoint that is within so many units away from the monster. Once each waypoint is selected from evaluation, as being close enough, then they are each compared against eachother. As in, which waypoint is closest to the player. Then, the monster would move to that waypoint, and the process would start all over again.

Process:

1.) Find all waypoints that are within x amount of units to the monster

2.) Find which waypoint, of the selected group, is closest to the player

3.) Move monster to that waypoint

4.)Start the process over again

Now, the above process would enable a monster to find the player, but get stuck in corners. Therefore, let us take out step 3, until a map of waypoints can be created, as a clear path to the player, with no obstructions in the way. Let us not use way points, but setup our level into grid sections. Read this tutorial, which will explain in depth. http://www.policyalmanac.org/games/aStarTutorial.htm


+NanoBrain+
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 30th Jul 2005 23:47
See, the thing is that the monster can only detect you if he sees you or 'smells' you... so A* wouldn't really be that efficient because he can't always detect you. So the only real time when the alien would be able to detect you is basically around a corner or when you go up to his face and say "Blaargh! Come and get me!".

I really appreciate the help, though... thanks!

If practice makes perfect and nobody is perfect, then why practice?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 31st Jul 2005 02:06
Metrion,

So, do you first need to know how to make the monster "detect" the player? If not, then once the monster detects the player, follow the above four steps. If you need help with them, I would love to write an example program.


+NanoBrain+
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 31st Jul 2005 02:57
I'd really appreciate it if you could write an example

If practice makes perfect and nobody is perfect, then why practice?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 31st Jul 2005 04:37
Metrion,

I will then write one up tonight, before I go to sleep.


+NanoBrain+
Metrion
19
Years of Service
User Offline
Joined: 8th Jul 2005
Location: In the darkest cave
Posted: 1st Aug 2005 02:35
Thankss NanoBrain, I really appreciate it

If practice makes perfect and nobody is perfect, then why practice?

Login to post a reply

Server time is: 2025-05-22 13:40:29
Your offset time is: 2025-05-22 13:40:29