Pathfinding improvement question

Post » Mon May 21, 2012 7:53 pm

Hi everyone. Would it be possible to improve the pathfinding system in Skyrim? I know there is Script Dragon that seems to give access to skyrim functions ingame, however from taking a quick glance over the function names and nothing seemed to be related to pathfinding. So, does anyone know something about how this could be accomplished? I thought about overriding the skyrim functions like it's done with SkyBoost, however it seems like there is no access to those function. Are they too deeply hidden?
User avatar
Silvia Gil
 
Posts: 3433
Joined: Mon Nov 20, 2006 9:31 pm

Post » Mon May 21, 2012 5:10 pm

The pathfinding in Skyrim is related to a pathgrid, which shows NPCs where it is OK to walk.

You could extend the pathgrid to new areas, like over rocks, but at best this would result in weird animation. Making NPCs capable of clambering over all terrain would require both new animations and code support as well as additional pathgridding.

What specifically did you want to do? In what sense do you want to "improve" pathing?
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am

Post » Mon May 21, 2012 9:24 am

The pathfinding code is all hard coded, I'm pretty sure, so we probably won't be able to edit it. If someone was able to write a superior path finding algorithm (which would require a way to access the navmesh data) you could maybe use it to place waypoints for actors rather than controlling the actors directly, then replace the follow AI packages with something that just makes them approach the waypoint. Though I'm pretty sure there was no way to make a chase/flee package in the Geck that used placeatme-created targets. So each follower would need its own nav marker that just has its position updated repeatedly.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Mon May 21, 2012 11:44 am

I read a bit on pathfinding and thought it was strange that Skyrim still used the old waypoint system, compared to the more modern navigation mesh with A*. To make Skyrim able to use this system, those meshes would have to be put all over the world, but I guess that's the smallest problem.
So I tought of implementing that system. That's why I need a way to get access to the pathfinding functions, however I can't seem to find a way to do that, is there none? That would be really disappointing.
User avatar
lydia nekongo
 
Posts: 3403
Joined: Wed Jul 19, 2006 1:04 pm

Post » Tue May 22, 2012 1:02 am

Actually both of you are wrong, 1- it will be editable, 2- as I recently learned, beth doesn't use the pathgrid since fallout 3.
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Mon May 21, 2012 12:30 pm

It will be editable? In which way? Simply by adding new waypoints? And what does it use, if not a path grid system? Because looking at the strange way that actors move, I can't think of something else.
User avatar
SHAWNNA-KAY
 
Posts: 3444
Joined: Mon Dec 18, 2006 1:22 pm

Post » Mon May 21, 2012 8:09 pm

I read a bit on pathfinding and thought it was strange that Skyrim still used the old waypoint system, compared to the more modern navigation mesh with A*. To make Skyrim able to use this system, those meshes would have to be put all over the world, but I guess that's the smallest problem.
So I tought of implementing that system. That's why I need a way to get access to the pathfinding functions, however I can't seem to find a way to do that, is there none? That would be really disappointing.
Actually both of you are wrong, 1- it will be editable, 2- as I recently learned, beth doesn't use the pathgrid since fallout 3.

What Chaka said. They use navmeshes for their pathfinding. You can edit the physical navmesh but not necessarily the AI that decides where actors walk.
User avatar
SiLa
 
Posts: 3447
Joined: Tue Jun 13, 2006 7:52 am

Post » Mon May 21, 2012 9:38 pm

They use navmeshes? Then how is it possible that actors move like they are on a waypoint system, for example in dungeons? Always going that one way, never moving to the side.
And how can I see/change those meshes? Which tool can be used for this?
User avatar
Elena Alina
 
Posts: 3415
Joined: Sun Apr 01, 2007 7:24 am

Post » Mon May 21, 2012 8:32 pm

They use navmeshes? Then how is it possible that actors move like they are on a waypoint system, for example in dungeons? Always going that one way, never moving to the side.
And how can I see/change those meshes? Which tool can be used for this?

You'll have to wait for the CK.
User avatar
Schel[Anne]FTL
 
Posts: 3384
Joined: Thu Nov 16, 2006 6:53 pm

Post » Mon May 21, 2012 10:56 pm

Aww :/ well then I hope it gets released asap :)
Still, kinda baffling that Skyrim seems to be using navmeshes when the result is so bad..
User avatar
Racheal Robertson
 
Posts: 3370
Joined: Thu Aug 16, 2007 6:03 pm

Post » Tue May 22, 2012 1:06 am

They use navmeshes? Then how is it possible that actors move like they are on a waypoint system, for example in dungeons? Always going that one way, never moving to the side.
And how can I see/change those meshes? Which tool can be used for this?
In FO3 it was all done through the GECK, using XMarkers and AI packages.
http://geck.gamesas.com/index.php/Patrol_Package
User avatar
Jay Baby
 
Posts: 3369
Joined: Sat Sep 15, 2007 12:43 pm

Post » Mon May 21, 2012 10:58 am

The one big problem I have with the (relatively) new navmesh system is the strictness. There is zero room for 'improvised' movement - no navmesh and the location simply doesn't exist for the AI. In Oblivion actors would follow you in a straight line even if there were no path nodes available, in Skyrim (and Fallout) the actors simply run around like crazy looking for a navmesh that doesn't exist (usually they simply run away, which is maybe a safety measure implemented to avoid players slaughtering enemies who can't reach them - still works though).

This is very noticeable when you fight enemies along the northern coast (or generally near bodies of water). Step into the water just a bit and the enemies won't know how to reach you. That way you can easily kill any enemy, which is ridiculous. For example I killed a troll while standing knee deep in the water because he didn't know how to reach me, even though he was only a few feet away from me, there were no obstacles in the way and, like I already said, the water was knee deep. And this also happens a lot on ledges and other areas without proper navmeshing.

I never understood the benefits of the far more complicated navmesh system. Sure, with the path node system it often looked like actors would move on rails if you looked closely (since they moved from node to node instead of calculating their path freely based on the navmesh), but other than that I can't see any advantages of navmeshes, only disadvantages.
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Tue May 22, 2012 12:28 am

I never understood the benefits of the far more complicated navmesh system.
The benefit is two fold. Firstly, it's three dimensional. Getting NPCs to walk on "object based" terrain was very problematic and even when successful it's only in straight lines except when being completely ignored which results in either constantly running against an object or falling to their death. Secondly, since it's an object based system it can more easily be edited during run-time. Neither system is perfect but NavMeshes are certainly much more mod friendly than path grids.
User avatar
roxxii lenaghan
 
Posts: 3388
Joined: Wed Jul 05, 2006 11:53 am

Post » Mon May 21, 2012 10:00 am

The benefit is two fold. Firstly, it's three dimensional. Getting NPCs to walk on "object based" terrain was very problematic and even when successful it's only in straight lines except when being completely ignored which results in either constantly running against an object or falling to their death. Secondly, since it's an object based system it can more easily be edited during run-time. Neither system is perfect but NavMeshes are certainly much more mod friendly than path grids.

That's basically what I said. The movement looks a bit more realistic and not 'on rails', which is good - but not all that great (especially seeing that the AI often doesn't know where to go and acts stupid, something that didn't happen with nodes as long as there were nodes). And for gameplay AI that sometimes runs against objects or falls to their death (when there are no path nodes) is better than AI that doesn't know how to reach you even though you're just two feet away with no obstacles in the way (which happens when there is no navmesh). Either of it looks stupid, but in the former case actors will reach you in most cases even without path nodes while in the latter case there is no difference between a tiny gap in the navmesh and the player standing in a different solar system.

Not sure what you mean with your second point - the only commands I found for the GECK are disable and enable navmesh, which is basically the same as disable and enable linked path points in Oblivion. Certainly easier to use for altering the path grid of large areas on the fly, but how often do you need that?
User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am

Post » Mon May 21, 2012 7:23 pm

However as long as there are navmeshes for every way NPCs should be able to walk on, those problems shouldn't even be there! Like with the water, seems like there is no navmesh there? Clearly that should be a bug, since NPCs are able to swim and thus walk into knee deep water?!
If there are gaps somewhere, they should be fixed by adding navmeshes. Guess I'll have to see the system with the CK to find out why actors move strangely in dungeons etc.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Mon May 21, 2012 9:29 am

The most succinct way to describe the difference between pathgrid and navmesh is so:

Pathgrids lay out where you must walk.

Nav meshes lay out where you can walk.
User avatar
Monika
 
Posts: 3469
Joined: Wed Jan 10, 2007 7:50 pm

Post » Mon May 21, 2012 9:36 am

I don't think there is any navmesh problem with water. Mudcrab can reach you without problems there. It seem to be more they deciding most creatures should never go to water. Considering that you can't fight while swimming while this may not be the case with any other actor, it may be better that way, at least until someone allow players to fight in water.
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Mon May 21, 2012 7:07 pm

The most succinct way to describe the difference between pathgrid and navmesh is so:

Pathgrids lay out where you must walk.

Nav meshes lay out where you can walk.

And most importantly...nav meshes lay out where you can't walk.

Watch a cuddly bear who tries to play with my character. Unfortunately he seems to be afraid of water:

http://www.youtube.com/watch?v=c6zfVzIKtgg

What you see in this video doesn't happen exclusively near water, it also happens a lot on rocks and generally when standing on exterior objects without proper nav meshing. I've seen this in dungeons as well (though not as often).

I've modded a tiny bit for Fallout (made three small mods right after the GECK was released) and I know how the nav meshes work (or better not work). When I made my Ghoul Massacre mod, which has a small worldspace, I navmeshed the place. And at the edges of the map at first I forgot a tiny space (less than a foot width). And guess what? The ghouls weren't able to get there, even though it was a flat, open area. That's what I mean with 'strictness'. If there is no navmesh, even if it's only a tiny, tiny bit of space not covered, actors won't be able to get there. Naturally this creates a lot of problems in a huge world - you can't make sure every single surface is covered perfectly by a nav mesh. And that's why I dislike the system so much. Sure, it looks better and more natural how actors move since they can calculate their path on the whole nav mesh and are not restricted by going from path node to path node. But that doesn't matter if the AI often acts stupid because of a missing nav mesh.
User avatar
Valerie Marie
 
Posts: 3451
Joined: Wed Aug 15, 2007 10:29 am

Post » Tue May 22, 2012 12:58 am

So what? Then that navmesh gets fixed and the problem is gone. Wouldn't it instead be better if the navmesh was a bit bigger than the ground allows to walk? For example in the dungeon: No creature will be able to move into the wall anyway, but with this there would be less "strictness" like you said. So there's less tiny space to be taken care of.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Tue May 22, 2012 12:33 am

So what? Then that navmesh gets fixed and the problem is gone. Wouldn't it instead be better if the navmesh was a bit bigger than the ground allows to walk? For example in the dungeon: No creature will be able to move into the wall anyway, but with this there would be less "strictness" like you said. So there's less tiny space to be taken care of.

That's not how the pathing works. Actors don't know there is something like a 'wall'. They see the navmesh and nothing else. If you make the navmesh larger than the ground actors would constantly walk into walls and/or get stuck.

And fixing 'that navmesh' is not something you could do easily. Navmeshing is a pain and altering all the holes and oversights in the navmeshes of all the dungeons and in the exterior world would take forever. The bear video was made at a random spot along the northern coast, that's how it is everywhere near water and in many other places without water.
User avatar
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Mon May 21, 2012 9:50 pm

It's quite possible to fix some of the water issues, I imagine; you would need to flag all the AI packages as 'Allow Swimming'. I'll see if I can decipher which flag that is later.

This wouldn't fix the areas without navmeshes, though. Someone would need to follow the edge of the borders and fill in some of that. Until the CK's released, we won't know how extended the holes are in the current navmeshes.
User avatar
AnDres MeZa
 
Posts: 3349
Joined: Thu Aug 16, 2007 1:39 pm

Post » Mon May 21, 2012 5:30 pm

Well, CK's out and from a glimpse of some caves I have to say, there are sometimes lots of holes in the meshes/ they don't cover places where the AI should be able to go, like over rocks in ForsakenCave01 in the room after the beginning.. so many places without navmeshes. Guess that's why the AI often goes long ways instead of more direct ones.
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm


Return to V - Skyrim