Page 1 of 1

Advanced - Port Distances

PostPosted: Wed Jul 03, 2013 3:00 pm
by Captain Jack
Since it has been requested, here is the full data to get port distance.
We use longtitude - latitude straight off the map you see, in straight lines affected by a global variable in order to control speed at anytime we want.

Longitude-Latitude (in array format to encourage scripted tools creation)
Code: Select all
$ports = array (
   "1" => array("name" => "Kanoni", "x_cd" => "47", "y_cd" => "202", "region" => "1"),
   "2" => array("name" => "Baramas", "x_cd" => "141", "y_cd" => "173", "region" => "1"),
   "3" => array("name" => "St.Martins", "x_cd" => "169", "y_cd" => "63", "region" => "1"),
   "4" => array("name" => "Pania", "x_cd" => "362", "y_cd" => "89", "region" => "2"),
   "5" => array("name" => "Regis", "x_cd" => "437", "y_cd" => "147", "region" => "2"),
   "6" => array("name" => "Goroum", "x_cd" => "524", "y_cd" => "100", "region" => "2"),
   "7" => array("name" => "New land", "x_cd" => "239", "y_cd" => "303", "region" => "4"),
   "8" => array("name" => "Hannes", "x_cd" => "674", "y_cd" => "87", "region" => "3"),
   "9" => array("name" => "Vaasburg", "x_cd" => "443", "y_cd" => "274", "region" => "5"),
   "10" => array("name" => "Seaglory", "x_cd" => "341", "y_cd" => "398", "region" => "5""),
   "11" => array("name" => "Tortuga", "x_cd" => "259", "y_cd" => "477", "region" => "4"),
   "12" => array("name" => "Tzogos", "x_cd" => "234", "y_cd" => "587", "region" => "4"),
   "13" => array("name" => "Aiora", "x_cd" => "453", "y_cd" => "577", "region" => "5"),
   "14" => array("name" => "Thorakas", "x_cd" => "590", "y_cd" => "393", "region" => "5"),
   "15" => array("name" => "Gasp", "x_cd" => "679", "y_cd" => "471", "region" => "6"),
   "16" => array("name" => "Neapolis", "x_cd" => "583", "y_cd" => "192", "region" => "2"),
   "17" => array("name" => "Caspian", "x_cd" => "678", "y_cd" => "253", "region" => "6"),
   "18" => array("name" => "Prote", "x_cd" => "761", "y_cd" => "168", "region" => "3"),
   "19" => array("name" => "Chalkos", "x_cd" => "902", "y_cd" => "116", "region" => "3"),
   "20" => array("name" => "Psaral", "x_cd" => "872", "y_cd" => "343", "region" => "6"),
   "21" => array("name" => "Akrotiri", "x_cd" => "888", "y_cd" => "587", "region" => "6")
);

(I left regions in the array in purpose as they will be used in some future version)

Functions used:
Code: Select all

$x = abs($x1 - $x2);
$y = abs($y1 - $y2);
$total = $x + $y;

$global_var =10;

$distance = round($total * $global_var  * 50);


If you use it with ship speed guide:
viewtopic.php?f=13&t=76

you can create your own calculating tools

Re: Advanced - Port Distances

PostPosted: Fri Jul 05, 2013 9:06 am
by Captain dungeness
I was surprised to read that travel times are based on distances because I originally tried to figure out travel times based on distance on the map but it didn't work out. Now that you posted this code I finally know why :)

I thought you would calculate the hypotenuse (see wikipedia page) and use it to calculate the distance but instead you are using (x1-x2)+(y1-y2). Therefor Pirates Glory's calculations for travel times ends up different than intuition would imply. Of course it's fine because you are the game designer and you can make it however you want- but the game is not really using the distance between points to calculate travel times.

Example 1: If you are in Akrotiri it looks like Caspian is closer to you than Chalkos (looking at the map Caspian is about 10% closer than Chalkos). But Pirates Glory calculates Caspian to be farther away than Chalkos by 16%!

Example 2: Pania-Aiora and Akrotiri-Neapolis are almost exactly the same distance apart when measuring the hypotenuse but Pirates Glory measures (x1-x2)+(y1-y2) which says Akrotiri-Neapolis is, in fact, 20% farther away.

In this way Pirates Glory makes diagonal routes take longer to travel than vertical or horizontal routes. Now I know why all the great trading routes seem to always be near-horizontal or near-vertical (Tortuga-Tzogos, Vaasburg-Regis, St Martins-Pania, Hannes-Pania, Chalkos-Akrotiri......)

I bet if Pirates Glory used the hypotenuse (sqrt(x^2+y^2)) to calculate travel times then Psaral, Gasp, and Vaasburg would be much more popular because their diagonal routes could be used to trade. I believe Vaasburg to Gasp would decrease from 2h:24m "average sail time" to about 1h:29m! That could make a great route out of 2 rather boring ports!

-Captain D

Re: Advanced - Port Distances

PostPosted: Fri Jul 05, 2013 9:21 am
by Captain Jack
Interesting analysis. The system we use isn't great but has it has a correct starting point which makes it easier to change/expand.

The best approach would be the creation of sea routes from one port to another. Then ships will always use these routes. This is a system that could be expanded on current one and would also allow us to develop a live map where players will be able to see where their fleets are.

However, it is extremely unlikely that we will be implementing any such system in this world (Eternal Glory) - perhaps we could develop the visual (for the live map) but... changing travel times will be avoided (current system will be retained).

Re: Advanced - Port Distances

PostPosted: Fri Nov 16, 2018 8:28 pm
by Infinite piracy
Is this still valid?

Re: Advanced - Port Distances

PostPosted: Fri Nov 16, 2018 8:29 pm
by DezNutz
Yes.

Re: Advanced - Port Distances

PostPosted: Fri Nov 16, 2018 9:28 pm
by Infinite piracy
thanks

Re: Advanced - Port Distances

PostPosted: Sat Nov 17, 2018 11:12 am
by Dejanira
CJ, while reading this topic I was wondering if Avonmora could be spherical. I mean: Chalkos-Kanoni could be shorter traveling to east.
That is: the island, or continent, where they are could be the same.
Image

Maybe Avonmora has been set as a part of a plane to look like the Caribbean Sea, but as time went by, Avonmora grew like a world herself... and so maybe the shape could be spherical.