LavishNav:Avoidance Comments

From Lavish Software Wiki
Jump to navigation Jump to search

Under construction

This article is kind of a stub, I'm working on filling it in. There's some bullet points for an overview of what will be described. The information here will NOT be application (e.g. game) specific, but may use examples based on a particular game.

This is a free-form collection of data, gathered from various conversations and posts, on creating regions, connections, and particularly, how avoidance works (or doesn't work).

Tenshi asked the following question:

"I know that currently LavishNav configuration designates all areas as Walkable.
Is there a way to inverse this, so that you only define areas you can't walk?"

Lax Replied:

While I agree that "defining 4" is easier than "defining 11", the simple fact of the matter is that pathing works by defining a route from point A to point B. This same question has been asked probably 14 times on these forums, and all have received the same answer.
Here's 2 i found by searching for both the keywords "obstacles" and "pathing" (this thread subsequently makes 3)
In a nutshell, all you have by getting "non-walkable parts" is collision detection, which is not the same as pathfinding (these are two separate but related AI issues), and is already available in real time in ISXWoW. (note: WoWBot does not take advantage of this feature because it was made in 1942 and hasn't been maintained. I highly recommend replacing WoWBot entirely, with a completely new design that can take advantage of newer features of LavishScript and ISXWoW. /me beats a dead horse)
From a design perspective, you should not need to manually designate 11 areas at all. It should be done automatically for you. I went over this in IRC with someone recently.
Collision information can indeed be used to generate pathfinding data. The best idea I can give you is to use ISXWoW's collision information, and generate small box regions around your character where there are no obstacles, and make it dynamically sized, centered on your player. Connect nearby regions automatically when you create a region, as well as when you successfully walk from region A to its neighbor region B. Remove connections when you discover an obstacle between region A and region B when trying to follow that connection.
Alternatively, if you are able to produce a complete collision map of an area offline (note that WoW only loads collision information so far away from you) -- e.g. a list of triangles -- this can be used to generate pathing data that would presumably be perfectly accurate, assuming no dynamic collidable objects. In the meantime, generating it in real time around your player is efficient enough.
Real navigation.jpg

Source: Lax from

One of the problems with ByteBot's pathing is that it's assuming that there are no barriers until it hits them, and ByteLock, like you, would want to just "add a wall". However, that type of thing would horribly complicate navigation, and make it inefficient.
To get from point A to point B, you simply want to know where you CAN go, you dont want to know where you CANT go (note that the math to figure out if you're crossing a wall -- collision detection -- is pretty complex, and it's going to slow you down a lot to have to loop through every nearby region to see if one is a wall, figure out if you'll be crossing it, etc). For one thing, navigation maps are incomplete. It's better to have a short list of places you can go, and have plenty missing, than it is to have a short list of places you cant go, and have plenty missing. One of these will successfully get you from point A to point B no matter what, and I will tell you it's not the short list of places you cant go.
The "best" way to do it is actually to set up regions (rectangles and circles/radii) that are obstacle-free. This means ZERO obstacles, you can walk from any point to any point in that region without hitting a fence or a log big enough that you cant walk over it, or a wall, etc. This type of area presents major benefits. It adds a huge degree of realism to navigation, because points and connections can be generated at random within the region. LavishNav allows regions to be marked as such, and calls it "All Points Valid", just another way of saying obstacle-free. Connect separate obstacle-free regions together with a series of connections, and you've got yourself a good, realistic navigational mesh.
So in response to the quoted request, the answer needs to be no. In fact, ByteBot should not be automatically connecting points that are not within obstacle-free regions at all.

See Also