Lua Openstreetmap Pathfinding Script

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
ckfinite
Posts: 208
Joined: Fri Jul 19, 2013 10:33 pm

Lua Openstreetmap Pathfinding Script

Post by ckfinite »

This is still rather experimental (for reasons that will become clear), but here's a demo of a Openstreetmap pathfinding implementation in Lua. In the demo scene, you are a Serbian man named Miroslav, who is trying to get home after all of his road maps blew out the window - but luckily, he had the presence of mind to buy a (very inexpensive) GPS whose code looks suspiciously like it was written over three days, mostly very late at night...

Current limitations include:

* The system is rather shoddy at finding the closest part of a road to the current position.
* Thanks to towns and their road networks being removed (for filesize reasons - this is already nearly 400kB of road map embedded in Lua already, for a fairly small area), many parts of the road network that should be connected, in fact, aren't.
* One way roads are not taken into account (including sides of highways)
* Speed limits are ignored completely.

The box of RPs is (veeery) approximately the bounds of where I've collected data for, and to actually do pathfinding, set up Miroslav and his house where you want, then run the "Recalculate route" (not the exact title) special action, which will either find a route or show a popup/message that it can't find a route.

Future work includes:

* Publishing the C# program that reprocesses the openstreetmap XML into a Lua program
* Fixing the various issues listed above
* Automatically generating Openstreetmap derived overlays
* Compressing the data format further
* Trying the program on bigger road maps

If anyone has feedback, I'd be very grateful.

Data © OpenStreetMap contributors, released under BY-CC-SA.
Attachments
Pathfinding Fun.zip
(179.18 KiB) Downloaded 29 times
Post Reply

Return to “Mods and Scenarios”