The following warnings occurred:
Warning [2] Undefined variable $awaitingusers - Line: 33 - File: global.php(779) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(779) : eval()'d code 33 errorHandler->error
/global.php 779 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 837 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 837 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 4950 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 4950 errorHandler->error
/global.php 837 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1394 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1394 errorHandler->error
/inc/functions.php 1349 fetch_forum_permissions
/printthread.php 83 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 174 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 174 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 179 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 179 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 174 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 174 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 179 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 179 errorHandler->error



High Frontier Forums
Pathfinding in a wrap-around world - Printable Version

+- High Frontier Forums (http://highfrontier.com/forum)
+-- Forum: General (http://highfrontier.com/forum/forumdisplay.php?fid=1)
+--- Forum: Dev Log (http://highfrontier.com/forum/forumdisplay.php?fid=15)
+--- Thread: Pathfinding in a wrap-around world (/showthread.php?tid=141)



Pathfinding in a wrap-around world - JoeStrout - 03-12-2016

We've knocked out a lot of new features and fixes for 0.22, and a few days ago, all that was left was this little issue, where sometimes we see a resident walking off across the lake (or otherwise going where nobody should be).

And wow, that turns out to be one deep rabbit hole!

The problem is that path-finding and navigation in a cylindrical coordinate system (which applies to torus and sphere habs in High Frontier, as well as cylinders of course) is a whole lot more complicated than normal path-finding.  Every point has an infinite number of equivalent coordinates.  For example, if your cylinder is 100 units around, then a point at X=10 is the same as X=110, X=-90, X=210, and so on.

We were normalizing all coordinates (basically using modular arithmetic) to get all the coordinates into a standard range, but that doesn't work correctly in some cases.  A little path from X=90 to X=110 ends up looking like a big path from X=90 to X=10, and then we find a ton of intersections with that and other paths which are halfway around the cylinder.  Bad mojo.

We've just about got our heads wrapped around it now; it's all solvable, but tricky.  There's been surprisingly little written about this situation, so we will be doing at least a blog post, if not a tech report, once we have it all sorted out!

- Joe


RE: Pathfinding in a wrap-around world - JoeStrout - 03-17-2016

Whew! That was a lot harder than it seemed even a week ago. But I think we have all the edge cases working now.

This was the last item on our to-do list for v0.22, so that blog post is going to have to wait... we need to get the next build out the door!