Travel time formula[]
- Moved from Talk:Common Ship Questions. -- Ifaigios 05:13, April 26, 2010
An anonymous user pointed out that the formula isn't quite correct:
Following Formula is incorrect. Consider 22:28 and 31:27
- 20 + (sqrt[(31-22)+(27-28)] * 20)
- 20 + (sqrt[(9)+(1)] * 20)
- 20 + (sqrt[10] * 20)
- 20 + (63.24)
:83.24 minutes
Real Time: 240.917
Does anyone know the correct formula?
Note[]
Small error in formula, this is correct and tested for distances below 5x5.
Consider 27:28 and 31:27
- 20 + (sqrt[(31-27)^2+(27-28)^2] * 20)
- 20 + (sqrt[(16)+(1)] * 20)
- 20 + (sqrt[17] * 20)
- 20 + (82.46)
:102.46 minutes
Real Time: 1H 42M 28S correct.
- Consider updating the Formulas Page also? Rihl 21:05, 12 March 2008 (UTC)
Updated it - Avaren 23:36, 17 March 2008 (UTC)
Patch 0.3.0[]
The formula for the cargo ship now seems to be:
- max(10,20*distance)
I don't believe the algorithm (currently) for time spent travelling distance is an accurate, effective, or useful formula for the following reasons:
It appears as the original author raised the differences of the x coordinates and y coordinates to the 2nd power in order to make them positive, and then found the square root to remove the 2nd power. However, they are also added together before the square root is taken, which fubars it. Also, there is no reason for x2 - x1 when x1 - x2 has the same outcome - just an annoying and pointless aspect. Regardless, I have included the example with that format.
Consider: x1 = 65; x2 = 75; y1 = 64; y2 = 62;
thus:
That's as far as it will go. Theoretically the only problem with it is that to obtain the absolute value of the differences of the respective coordinates you would merely need to separate them into two square roots and add the results of the square roots, but that is a waste of effort.
This is totally unnecessary when the absolute value of each difference could be used, then combined.
Also, while this algorithm (as the previous one, if corrected) determines the Distance, it does not take into account the fact that there is a diagonal displacement, nor account for the actual units used to determine how speed effects the time.
For instance, [54:65] to [54:66] is a difference of 1 island, and 2 Distance (due to the fact that moving on the originating island adds 1 to Distance), and is equivalent to 2distance*20base_minutes=40time
However, going from [54:65] to [55:66], using the normal algorithm, would determine it was a total of 3 Distance, when any Trading Post would say it had Distance of 2 - and in fact the time wouldn't be 60, but rather 48minutes and 18 seconds.
If it is not strictly a change of one axis, the time pattern differs. It seems they are using square-radius.
Here is what I propose:
| 4.0 | 3.1 | 3.0 | 3.1 | 4.0 |
| 3.1 | 2.1 | 2.0 | 2.1 | 3.1 |
| 3.0 | 2.0 | 1.0 | 2.0 | 3.0 |
| 3.1 | 2.1 | 2.0 | 2.1 | 3.1 |
| 4.0 | 3.1 | 3.0 | 3.1 | 4.0 |
A coordinate difference of 2, and therefor a Distance of 3 (while it says 2), should be 60 minutes - yet is 48 and 18seconds. This is 2.1 A coodinate difference of 3, and therefor a Distance of 4(while it says 3), should be 1h 20m - yet is 1h 4m 44s. This is 3.1 Difference of 4, and therefor Distance of 5(while it says 4), should be 1h 40m - yet is 1h 23m 15s. Etc etc.
Eliria 06:35, 8 March 2008 (UTC)
Correction to the above comment[]
Eliria, you have some more work to do, or less depending on how you look at it. You made a very simple mistake. You assume that the distances are for island hopping. It is not. All travel is done in a straight line. To from from [1:1] to [2:2], you do not go through [1:2] or [2:1], but straight across the corner, making the time much less.
The formula that you are deriding is simply the Pythagorean Theorem, or Cartesian distance metric. (x²+y²=z²)
is the square root of the sum of the squares of the two axis distances. This is basic algebra. The only difference in the game from this is to add 1 to the distance, and then multiplying the distance by 20 to get the total time, both of which you got right.
You said to consider the following problem
x1 = 65; x2 = 75; y1 = 64; y2 = 62; thus: To continue 3 hours 46 minutes 57.6s Check it to see if it is right.
You also give the example of going from [65:75] to [64:62] and saying that it should be a distance of 3, but that is not accurate.
<quote>It was [54:65] to [55:66], and I said that the difference of the coordinates was 2, and plus the distance inherent in the starting island made it 3. However the trading post said it was a distance of 2, and instead of 60min (from a distance of 3, which I said it was not), it was ~48min. I said the same thing you say below. It's one island diagonally, but if you look at the coordinate difference it is two difference.</quote>
The formula boils down to (The distance on graph paper is 1.414) (Game distance is 2.414) 48.28 minutes = 48m18s
Two islands in a straight line is a distance of 2, plus one for getting off the island, gives 3*20 = 60 minutes, which matches the game.
A knight's move (two up and one over) is = = 20*(2.236+1) = 20*3.236 = 64.72 minutes (1h 4m 44s).
Do the math yourself and check it in the game. It does work. Just as most of Gameforge's games, the best tool you could have is a calculator.
Cosumel 13:34, 13 March 2008 (UTC)
Reanalyzing[]
Eliria, you have some more work to do, or less depending on how you look at it. You made a very simple mistake. You assume that the distances are for island hopping. It is not. All travel is done in a straight line. To from from [1:1] to [2:2], you do not go through [1:2] or [2:1], but straight across the corner, making the time much less.
From the above statement it sounds as if you thought I was under the impression that the idea was to go to each coordinate difference, rather than using a diagonal means. This is not true, though I may have phrased it incorrectly. I was stating that it "should" IF it was island hopping, be 60min, but instead it was not and was actually going diagonally and was rather ~48min. I understood the fact it was using a straight line, but I was looking at it from a different perspective.
You also give the example of going from [65:75] to [64:62] and saying that it should be a distance of 3, but that is not accurate.
It was [54:65] to [55:66], and I said that the difference of the coordinates was 2, and plus the distance inherent in the starting island made it 3. However the trading post said it was a distance of 2, and instead of 60min (from a distance of 3, which I said it was not), it was ~48min. I said the same thing you say below (where your comment came from). It's one island diagonally, but if you look at the coordinate difference it is two difference, plus one.
Do the math yourself and check it in the game. It does work. Just as most of Gameforge's games, the best tool you could have is a calculator.
The problem was that I *Did* use a calculator. It doesn't reduce roots to decimals, so I was mistaken in thinking the forumla wouldn't come out. In essence because I input the formula as a whole, it gave me and I took its word. I recognize the a^2+b^2=c^2 formula more readily.
This formula does hold true and it was my mistake for not completely going through it by decimal, mainly because of the fact my college algebra instructor always made us work with the square roots if they didn't come out evenly and I didn't think of reducing it to decimal. (would have been better to have done it out on paper)
Unfortunately I'm very forgetful... abnormally so. You were right about the formula working, and I was wrong about it not following up. --Eliria 23:04, 13 March 2008 (UTC)
Calculations[]
This calculation at first glance looks wrong, but be careful where you put the +1
(Taking a fleet ship at speed 20):
For two islands near each other 15:4 and 15:5, Ikariam reports 40 minutes for this journey! (400/20)*(SQRT((15-15)^2+(4-5)^2+1)) = 28.28
For two island a little distance apart 15:5, and 21:10, Ikarium reports 2h 56m 13s for the journey! (400/20)*(SQRT((15-21)^2+(5-10)^2+1)) = 157.48 (2h 37m)
What you should use is: (400/20)*(SQRT((X1-X2)^2+(Y1-Y2)^2)+1)
Scaremonger 15:15, 19 April 2008 (UTC)
New considerations[]
In any case, the ships are supposed to have different speeds, however, are they not? I was under the impression that 20 (the speed of the transport) was meant to be time=distance/speed, and thus the distance would be distance=time*speed, meaning 400 units per 1 distance. Thus time=dist*400/20. However I found a slope, first starting with +166 units. Thus going to a diagonal island would be 966 while a perpendicular distance followed the dist*400/20. Then the second diagonal island was +332.6_ However it may be that speed refers to the time it takes to travel a single distance. In which case the revised formula would be I only gather this because, perplexingly, the more expensive ships with a lower speed value actually cost less overall (leading me to believe they cut the travel time and thus the overhead of a blockade). Though the estimated travel time does not seem to change, regardless of which ship you choose to send to a blockade. I have not documented actual travel time difference.
Eliria 23:04, 13 March 2008 (UTC)
Travel Time Formula[]
This works for cargo ships (speed 60). (doesn't work when calculating time between two towns on the same island) I havent tested it with other units.
(time in seconds)
BagBag 15:28, 19 February 2009 (UTC)
Actually, the correct formula (for all boats) is:
(time in seconds)
Speed of Spy[]
Do you know the speed of the spy? I found that if you compare the time taken by a spy to travel to a city with the time taken by a cargo ship to travel to the same city. The time of the spy is 4 times less long. So the spy has a speed of 240. But the time taken to travel on the sameisland is 5 minutes. Could you check this and insert in the article? -- The preceding unsigned comment was added by 79.0.104.153 (talk • contribs)
Please sign your posts with 4 tilde's! ( ~~~~ )
Accuracy[]
The current formula, for Ikariam v0.4.5, is only accurate to +/- 1 second which might be enough for many, but I had a case where I needed it to spot on.
If you want a truly accurate calculation then you need to use the game formula. Jeahra 23:15, March 14, 2012 (UTC)
Which formula is the " Game formula "? It helps to post it or have a link to it so it can be used wherever it is appropriate! -- M o r p h i a s (C | T/D/W | E) 110,976 contributions and counting 20:51, March 15, 2012 (UTC)
Game formula:
Triton can be [0,1,2,3] for [+0%,+100%,+200%,+300%].
Poseidon% can be[0.0,0.10,0.30,0.50,0.70,0.100] for level [0,1,2,3,4,5].
The government form Oligarchy bonus (+10%) to Cargo Ships can simulated accurately (at least to my findings) by changing "UnitBaseSpeed" to this . Replacing 60 (UnitBaseSpeed) with 66 will give the same result.
This can be modified further by altering the Cargo amount per merchant ship [100,200,300,400,500] to give [66.4%,49.8%,33.2%,16.6%,0%] bonus.
I was able to locate this information from analyzing the Trading Port. Jeahra 12:11, March 24, 2012 (UTC)
- Observation
- Where the "Poseidon%" is 0.100, I am thinking that you meant to say 1.0, meaning 100% ! Because, in math 0.1 = 0.10 = 0.100 = 0.1000 and so on.
- I will, later, incorporate the game formula, when I get a chance to, or you can if you wish. M o r p h i a s (C | T/D/W | E) 110,976 contributions and counting 12:48, March 24, 2012 (UTC)
- You are correct. Level 5 is 100% and should thus be "1.0".
- I forgot to state that the result is in seconds, not minutes as the "Basic" formula does. I will correct the newly "Advanced" section accordingly. Jeahra 22:42, March 24, 2012 (UTC)
Adding correct formula[]
Formula on this article is wrong. We explained formula in detail here:
Xmas contest 2013 - Answer to day 4
Cheers
Sampisa (talk) 22:49, December 22, 2013 (UTC)
Draft, Poseidon and Government type can change speed of ships.
s=seconds to travel between islands d=distance between islands; T=Triton (0=no triton; 1=100%, 2=200%, 3=300%) D=Draft (as 1, 1.167, 1.333, 1.5, 1.667) G=1.1 if govt=Oligarchy, 1 in other cases; P=Poseidon level (0, 0.1, 0.3, 0.5, 0.7, 1)
So:
The formula: d/(D*G*(1+P+T))