Determining Distance Between Ports

I'm currently in the process of making a trading game (think tradewinds, caravaneer or other merchant type games where the players travels from place to place to sell goods at a profit). I planned to use a system where you utilize a map and click to travel between "ports", but I wanted to implement a food/water system for travel. Simply put, port 1 to port 2 takes say 3 days so 1 gallon of water per party member per 3 day journey is 3 gallons of water the player would need. My problem is, I can't think of a good way without a plugin to keep the port distance data without needing to do a LOT of variable calculations and conditional branches. Has anyone done something like this before?

So far I can easily determine the number of actors in party and assign a simple global variable for how much food/water it would take. My biggest hurdle seems to be determining distance from one port to another.

Or is this a weird mechanic that people don't think would be fun? The main game is inventory management (cargo) and selling for a profit and it seemed weird to just allow for free travel without any kind of cost from place to place/sense of time progression.
I think it might be an interesting mechanic for a management game. After all, management games are around...well...management. Conversely, a system that does NOT take that into account would be more boring (at least in my opinion).

How long it takes to implement it depends on how you want to implement it. To use less conditional branches you could save the coordinates of each port in a variable (using an array) and then make use of two variables: one for the starting port, one for the destination port.

All you have to do is to calculate distance using it in a simple script call command. No need for conditional branches at all, you could even do it in a common event if you call it after storing the starting port and destination port in a variable.
I made something similar with 3dstudio: I made the map, put down the cities and landmarks, drew some splines following the roads, and then used 3dstudio's tools to measure the splines.
from A to B = X units, knowing that X distance is Y days, I calculated every road to everywhere.
then I wrote a hash with all the distances and pulled them as needed.
something like:
:start => {:nearest => 1; :midway => 3; :farthest => 9}
so, get_me_the_distance( :start, :midway ) => 3.
like that, for every combination of a mesh of some 20 points, considering crosses and intersections, going from one end to the other of the whole map.
some entries would have only one return, and some would have the whole map, since many roads cross and bend through the landscape going everywhere.
and, the system accounts for there and back, and backwards, so distance( :A, :B ) is the same as distance( :B, :A)

Original thread: https://forums.rpgmakerweb.com/threads/determining-distance-between-ports.152341/