#### DeletedUser

##### Guest

The constant is 900 seconds.... that is my hint

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

The constant is 900 seconds.... that is my hint

from the difference between the different ship types I get a constant of 0:05:00.

But I can't get the distance right.

You can only work out the distance form the travel time, each for a speed 1 all travel times have 900 seconds added on so you need to remove this from the value you have. You then have a 'real' travel time, at this point you can then set to working out the distance between them based on a unit, (remember to adjust for unit speed).

Am I right about the circles around the islands? Is the centre the average of the cities? And the radius that of the furthest city?

Am I right about the circles around the islands? Is the centre the average of the cities? And the radius that of the furthest city?

I have no idea and it is not relevant, above you have the positions of each city above (in the code stats I gave you), you have the constant time added on as well.

All you need now is a city with no speed upgrades then note down the travel time of say a swordsman to all the cities on your island at this point you should have enough data to work out a bases for the formula.

You will then need to adjust it to go between different islands as well, but first start on your own island.

SBUS setting basic unit speed 100

SWS setting world speed 1

SUS setting unit speed 2

sword speed = 100 / 2 = 50 >> 50 / 16 = 3,125 (1 click takes 3,125 secs)

distance = rounddown ( ... ; 3 )

time = rounddown ( distance x swordspeed ; 0 ) + ( 900 / SWS )

this works for ALL units on same island, so including ships.

there is something peculiar with the cats, because the times end with 0 and 5, so there is an additional factor in the equation.

So far I haven't been able to get the inter-island times right, but I'm sure we are on the right track for that too.

Oscar

...You will then need to adjust it to go between different islands as well, but first start on your own island.

Is there another variable/constant involved in inter-island travel? I am getting shorter than actual travel times using the same formula for intra-island travel

I am feeling nice... here is some code I have in VB 2012 that works out the travel time acorss the island ONLY (I took out the bit that does it between islands)

Code:

```
Shared Function Calculate(TargetTown As Data.Entity.TableItem.Town, HomeTown As Data.Entity.TableItem.Town, Speed As Integer, Lighthouse As Boolean, Cartography As Boolean, WorldSpeed As Double, UnitSpeed As Double) As TimeSpan
Speed = Speed * UnitSpeed
Dim CalcX As Integer = 0
Dim CalcY As Integer = 0
Dim Distance As Decimal = 0
Dim ReturnSeconds As Integer = 0
Dim Bonus As Decimal = 1
If Lighthouse = True Then
Bonus += 0.15
End If
If Cartography = True Then
Bonus += 0.1
End If
CalcX = (TargetTown.TownOffsetX) - (HomeTown.TownOffsetX)
CalcY = (TargetTown.TownOffsetY) - (HomeTown.TownOffsetY)
Distance = Math.Pow(CalcX, 2) + Math.Pow(CalcY, 2)
Distance = Math.Sqrt(Distance)
Distance = Distance * 10
Distance = Math.Round(Distance)
Distance = Distance / 10
Distance = Math.Floor(Distance)
ReturnSeconds = Math.Floor((Distance * 50) / (Speed * Bonus))
ReturnSeconds += (900 / WorldSpeed)
Dim ReturnTimeSpan As New TimeSpan(0, 0, ReturnSeconds)
Return ReturnTimeSpan
End Function
```

Last edited by a moderator:

ok, thanx. So that covers the (rounding in) intra island time.

Now for the inter island seconds.

Now for the inter island seconds.

Distance = Distance * 10

Distance = Math.Floor(Distance)

Distance = Distance / 10

Distance = Math.Floor(Distance)

?

ok. maybe it works different in Excel.

I cannot figure out the inter island factor.

I cannot figure out the inter island factor.

ok. maybe it works different in Excel.

I cannot figure out the inter island factor.

Nope, if you do it correctly, it will work the same in Excel as it does in Saska's code.

Share: