View Single Post
  #24  
Old 08-26-2007, 06:38 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by coreys View Post
Well the way my baddy class works, a player getting up next to a wall, or even half on one, isn't a problem.
It would cause the script to return what would more or less be false positives.

Quote:
Originally Posted by coreys View Post
But now I'm having trouble with the pathcheck...in some cases it thinks theres a wall in between us, when there isn't...O.o
Perhaps the line it's checking partially intersects a wall? Try having it put something (putnpc, showimg, even putbomb) at each point it checks along the line.

Regarding pathfinding and CPU usage, I don't know much about the limitations Graal servers have to work under, but Yen has claimed that pathfinding is impossible to do for every baddy without crashing the server.

If I were going to try to make a pathfinding script, I'd have it have two "levels". Macro and micro. First I'd divide each level into sectors (like in the attachment) and have the baddy first determine which sector the player is in. Each baddy would have a preprogrammed path to each sector within its level and it would follow its preprogrammed path (while checking if the player changes sectors and adjusting its path accordingly by determining the best route to get to the preprogrammed path to the new sector). Once it got to the same sector as the player then it would go into "micro" mode and do normal shortest-distance-to-the-player pathfinding. There's minor problems like the player changing sectors while the baddy is in micro mode, but they wouldn't be too hard to solve. The biggest problem would be that it's hard on the scripters as unique preprogrammed paths would have to be created for every single baddy.
Attached Thumbnails
Click image for larger version

Name:	sectors.jpg
Views:	181
Size:	119.2 KB
ID:	42614  
__________________
Reply With Quote