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.

Newcomers DBPro Corner / pathfinding...

Author
Message
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 10th Apr 2003 21:18
ok so a* pathfinding is WAYYYYYYYYYYYYYYY to slow in my game...
i tried using a* but it was so slow it dropped my framerate to 5fps...

i need a simple way of telling the "monster" to go around walls and stuff to get to me...

any ideas or code snippits?
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 10th Apr 2003 22:19 Edited at: 10th Apr 2003 22:20
This is the simplest method i could come up with, check out the code snippet and demo and tell me what you think! if you have any problems just tell me

download link:
http://www.realgametools.net/forums/attachments/path_finding.zip

picture:


everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 10th Apr 2003 23:41 Edited at: 10th Apr 2003 23:42
i dont think that will work for me because i have HUGE levels and lots of different monsters... and the destination changes depending on where the player is positioned...

if i try to set up waypoint coordinates then it wont work out...

EDIT: i have the monsters following me already i just want them to go around walls and other obstacles...
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 11th Apr 2003 17:02
ok then since your controlled character doesn't pass through the walls you could like have the monsters log your characters coordinates periodically and move/point them to that coordinate, if the target character is not visible for a certain period then you can discontinue the persuit!

everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 11th Apr 2003 17:36
thats sort of what i have right now....

the only problem is when i run around a corner, they just walk to the wall and stay there, i want them to go around it

and i have no idea how to make them do that without slowing down my game 100x
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 11th Apr 2003 19:57
ok i think i get it, so the computer logs your coordinate b4 you get around the corner and when your around the corner so tries to move in a straight line and collides with the wall right? why not try logging the coordinates more frequently or something?

everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 12th Apr 2003 09:08
the coords are logged 81 times per refresh

i dunno what to do
just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 14th Apr 2003 06:03
why not try having the npc walk the coords in order (tracking)? that way if you walk around around a corner, it'll walk the previous coords before it turns the corner. and you could use this method to reduce the frequency of your coord logging, and increase the size of the array holding the log. in essence, it won't know it's walking around a corner.. it'll just walk what it saw.

don't know if that helps.. (i'm VERY new to this little language, so i don't know what it can do just yet)

there are 10 kinds of people.. those who understand binary logic, and those who don't.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 14th Apr 2003 07:35
i dont understand what you mean

the way i have it right now is it will turn towards the player and walk in that direction

and right now it updates the coordinates every 0.8 seconds
i have that timed

i dont know how to make it log the coordinates and use those to go around the walls
just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 14th Apr 2003 10:09
like i said, i'm very new to the dark basic thing, but i'll try to better express what i mean...

say your npc has a limited amount of vision (small logging), then have an array that you would use to keep track of pc movements, say every second or two, until the array hits, say 50 logged coords. then, when whatever 'follow code' kicks in, the npc walks to the first logged pc coord in the array. once he's there, move the npc to the next logged coord that he 'watched' the pc go to. so, the general effect would be that...

-npc spots pc
-npc moves to 'follow mode'
-npc begins logging what he sees (logs pc's position)
-npc begins moving to where he just saw the pc
-pc keeps moving (to a new coord but still in view)
-npc logs pc coords some more
-npc reaches first dest and changes course to next coords logged
-pc walks behind a wall (thinking he's smart)
-npc continues following what he saw (up the the edge of the wall where he saw the pc last)
-npc reaching the end of the coords list, scans the area...
-being in reaching distance of the pc... (who's attached player didn't think your ai could best him)
-npc enters 'attack mode'


sorry i hope i didn't just waste a lot of space on this post..

there are 10 kinds of people.. those who understand binary logic, and those who don't.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 14th Apr 2003 17:10
that sounds like a very good idea i will have to try it

thanks man

Login to post a reply

Server time is: 2024-09-20 06:56:27
Your offset time is: 2024-09-20 06:56:27