
08-26-2007, 06:45 AM
|
|
Will work for food. Maybe
|
 |
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
|
Kaimetsu had a good theory on pathfinding. Instead of actually calculating tiles, he said that it would be easier to predefine nodes in levels, and have the NPC 'pathfind' through the nodes instead of the tiles. This means you'd be able to up the accuracy in tight spots by placing more nodes, and get lax in large spaces by only placing a couple nodes. I'd honestly put aside pathfinding though, it's way too much for something so simple.
I made a baddy, that instead of going in the direction of the player, moved left or right/up or down, depending on the player's position. This meant that instead of running straight into a wall and stopping, he'd run into the wall, but if the player was still lower than him keep running down and around the obstacle. Of course this wouldn't work in messy levels, and not too effective if the player is still right in front of the baddy, but it was better than the average running towards the player script. |
|
|
|