View Single Post
  #11  
Old 09-07-2010, 04:02 PM
Brewhaus
Sarnak
 
Join Date: Aug 2010
Posts: 38
Default

Just kinda talking to myself now...

Thinking a little more about how it works, it seems that in the perfect world in order for mobs to always take the shortest route possible you would want a node at every external corner. What I mean by external is that if you are at a corner and you are on the side with > 180 degrees, you need a node. This would allow mobs to path from one corner to the next perfectly. The amount of connections would be pretty ridiculous though. I'm assuming that at some point you would hurt performance or the algorithm for finding best path would fail or something. But take the following two rooms for example:

Code:
O                                          O
 ------------------------------------------
 |                                        |
 |  O  O                                  |
 |   XX                                   |
 |   XX                                   |
 |  O  O        O                         |
 |               -------------------------|
 |               |                         O
 |     O  O      |                         
 |      XX       |    O                    O
 |      XX       |     |------------------|
 |     O  O      |     |                  |
 |               |     |            O O   |
 |               |     |      O  O   |    |
 |               |     |       XX    |    |
 |               |     |       XX    |    |
 |       O       |     |      O  O   |    |
 -------- --------     |             |    |
O        O        O    |	     -----|
O                   O  |            O     |
 ------------------- --|		  |
 |                  O   O                 |
 |                              O         |
 |    O  O                       ---------|
 |     XX                       O         |
 |     XX                                 |
 |    O  O                                |
 |                                        |
 ------------------------------------------
O                                          O
And my original example would be:
Code:
__________________________________________
|                                        |
|  O  O   O  O    O  O    O  O    O  O   |
|   XX     XX      XX      XX      XX    |
|   XX     XX      XX      XX      XX    |
|  O  O   O  O    O  O    O  O    O  O   |
|                                        |
|  O  O   O  O    O  O    O  O    O  O   |
|   XX     XX      XX      XX      XX    |
|   XX     XX      XX      XX      XX    |
|  O  O   O  O    O  A    O  O    O  O   |
|                                        |
|  O  O   O  O    O  O    O  O    O  O   |
|   XX     XX      XX      XX      XX    |
|   XX     XX      XX      XX      XX    |
|  O  O   O  O    O  O    O  O    O  O   |
|                                        |
------------------------------------------
You wouldn't need any nodes along the walls because whenever the mob got to the last corner they would have LOS on you. The node I labeled A would have 10 connections; I guess that isn't that bad.
Reply With Quote