[LiveTuner] Routes Panel

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,699
Location
Near Portsmouth, UK
Version 2 of my "LiveTuner - Tech and Policies Panel" now includes the Routes Panel

Routes Panel: Highlights a route between any two cities. Cities may be choosen from any player and/or City State and highlighted in a selction of colours. Multiple routes may be highlighted one after another. Routes over land, by road, by rail, through coastal waters, over the ocean, or by submarine (ie including ice-locked tiles) are supported.









The code for route finding is in its own .lua file and may be included and distributed with your own mod.

After the mod has downloaded you will need to copy the five .ltp files to your C:\Program Files\Steam\SteamApps\common\sid meier's civilization v\Debug directory

These panels require the mod to be installed and active (the code is provided in the mod, not the panels themselves)

These mods can be found on the ModHub under Other
 
Great, I must test that, I think your route finding code will be very, very useful, thanks ! :goodjob:
 
I've updated the route finding code such that the next plot considered is now the one closest to the target plot and not just the next one around the compass.

Compare and contrast the coastal routes between the two cities states between the "compass based" and "proximity based" algorithms

Version 1 - Compass based


Same start and target plots - Version 2 - Proximity based


Same two cities but start and target reversed

Version 1 - Compass based


Same start and target plots - Version 2 - Proximity based


I have a few other changes I want to include before releasing this, but if anyone really wants the code, PM me
 
Version 3 now on the ModHub - includes new route finding code using proximity based decision making. LiveTuner Routes panel now shows both grid and hex co-ords of the selected cities, the distance between the cities (as the crow flies) and the length of the route found
 
Version 4 now on the ModHub - includes shortest path route finding (see http://forums.civfanatics.com/showthread.php?p=10584066#post10584066)

I've also removed the built-in tests to determine if a tile is blockaded and changed the main methods to take a call-back function instead. Depending on usage, you may or may not care if a unit is exerting a Zone of Control on the tile or if the tile is in "hostile" territory - for example, a trade caravan may be able to enter foreign lands without open border agreements, but not if you are at war, or a spy may just ignore everything except hostile units in a tile - now you decide.
 
This is quite interesting, I just had to do something similar for my mod.

If I understand correctly it takes into account terrain cost, so it finds the path which is shortest in terms of #turns, not #hexes, right? Could you give some specifics on what algorithm you used for this?

Also, I couldn't find it on Mod Hub. :eek:
 
No, the algorithm finds the shortest route in terms of tiles, ignoring terrain (it was written mainly to determine if a route exists between any two tiles, as opposed to a city and the capital).

The panel /code is included in the "LiveTuner - Tech and Policies Panel" mod. Code is fully commented, so you should be able to work out how it works :)
 
Top Bottom