City Coordinates

DeletedUser

Guest
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).
 

DeletedUser21425

Guest
900 seconds, world speed 1 >> 300 seconds, world speed 3 (Chi). That's the 5 minutes I mentioned.
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?
 

DeletedUser

Guest
900 seconds, world speed 1 >> 300 seconds, world speed 3 (Chi). That's the 5 minutes I mentioned.
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.
 

DeletedUser21425

Guest
I only have the calcs for same-island attack ready.

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
 

DeletedUser

Guest
...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
 

DeletedUser

Guest
Start of the Travel Time Formula

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:

DeletedUser21425

Guest
ok, thanx. So that covers the (rounding in) intra island time.
Now for the inter island seconds. :)
 

DeletedUser21425

Guest
Shouldn't that be

Distance = Distance * 10
Distance = Math.Floor(Distance)
Distance = Distance / 10
Distance = Math.Floor(Distance)
?
 

DeletedUser21425

Guest
ok. maybe it works different in Excel.
I cannot figure out the inter island factor. :(
 
Top