• Hello, Guest!
    Are you passionate about Tribal Wars 2 and like to help your fellow players?
    We currently have open positions for Forum Moderators!

    >> Join the Tribal Wars 2 Team now! <<
    We would love to hear from you!

Travel speed

DeletedUser

Guest
I'm trying to calculate the time between points. I can calculate the distance easily enough using Pythagoras theorem and using the unit speed I can calculate the expected arrival time using these numbers. However when I look at the information page between my city and another city the arrival time is 12.5% faster (87.5% of expected time). Does anyone know what causes this or is it just an unlisted modification by the developers to speed up travel time?
 

DeletedUser486

Guest
Troops are no longer slower moving diagonally, like they were in tribal wars.
 

DeletedUser

Guest
Hmm have you got a method to calculate the time that you could share with me then?
 

DeletedUser486

Guest
Sorry, nope, I just know that they now travel "as the crow flies", from what I read about it. So I'm guessing the unit speed actually measures across the length of the line of sight now.
 

DeletedUser

Guest
It's definitely using something different I'm just not sure how it's different yet. Immediately next to you via a face of the hex the distance is as expected, however next to you via a point eg. down it's not the standard distance. Eg. via spear next to you is 14min, down it's 24min 14sec. I guess down is not directly connected, anyway if anyone has formulas please post.
 

DeletedUser299

Guest
The tiles in TW2 are hexagons and a hexagon always has a diameter to width ratio of 1.155. So the diameter of a hexagon is always 1.155 x its width.

So since the width of TW2 hexagon tile is 1, proven by looking at the travelling speeds between adjacent tiles which are connected face to face (the width),
then the diameter must be 1.155 x 1 = 1.155.

The radius then, which would be the centre of the tile to the point edge, would be 0.5775. This is the same dimension as the face length.

The vertical arrangement of tiles is such that the centre to centre distance of tiles in a line vertically is three times the radius or approximately 1.73 tiles.



You can see that this ratio is correct by taking any unit and dividing the vertical time to nearest tile by the travel time per tile and you get 1.73... as the multiplier.

So using your spears example, 14 minutes per tile x 1.73 = 24.22 minutes.
 

DeletedUser

Guest
And now we should all write our high-school math teachers and thank them for helping us apply math in a fun way :D
 

DeletedUser

Guest
Thanks for your input dangerousdan. I see now that it's the distance that is the issue. I did some searching for calculating distance and it seems like it's quite difficult for hexs. http://www.redblobgames.com/grids/hexagons/ is the best reference I could find but as for changing these formulas into something useable in either a spreadsheet or a webpage I think I'll have to wait until someone else can do it.
 

DeletedUser

Guest
dangerousdan;n9375 said:
The tiles in TW2 are hexagons and a hexagon always has a diameter to width ratio of 1.155. So the diameter of a hexagon is always 1.155 x its width.

So since the width of TW2 hexagon tile is 1, proven by looking at the travelling speeds between adjacent tiles which are connected face to face (the width),
then the diameter must be 1.155 x 1 = 1.155.

The radius then, which would be the centre of the tile to the point edge, would be 0.5775. This is the same dimension as the face length.

The vertical arrangement of tiles is such that the centre to centre distance of tiles in a line vertically is three times the radius or approximately 1.73 tiles.



You can see that this ratio is correct by taking any unit and dividing the vertical time to nearest tile by the travel time per tile and you get 1.73... as the multiplier.

So using your spears example, 14 minutes per tile x 1.73 = 24.22 minutes.


Was never that well in math haha
 

DeletedUser

Guest
If Two village`s coordinates are (x1 | y1), (x2 | y2) respectively,

x1' = x1 - 0.5 if y1 is even

= x1 if y1 is odd

x2' = x2 - 0.5 if y2 is even

= x2 if y2 is odd

and distance is
sqrt((x1' - x2')^2 + 0.75 * (y1 - y2)^2)

where sqrt means square root function.
 

DeletedUser

Guest
This using Pythagoras Theorem. The x axis in tribal wars 2 is set back half a hex on the odd line but the y axis is set forward half a hex in the y axis on all odd numbers.

I have used this formula also and I've used cosine trigonometry to work out the distances also. Neither way gives an accurate travel time as the distance calculator posted earlier in this thread does. I don't know where I am going wrong with it or what other parametre I am to add to make my distance calculator accurate.

Will keep trying and will keep you posted if I find the true formula

=if(isodd(y1),z1+0.5,z1-0.5)
=if(isodd(y2),z2+0.5,z2-0.5)
=sqrt((z1-z2)^2+((3/4)*(y1-y2)^2))

It's working now. Needed to minus -0.5 if y was even to equal a full hex width difference.
 
Last edited by a staff member:

DeletedUser

Guest
For those whom wonder why this doesn't work (on latest servers at least) since this is the top google response for "tw2 distance calculator" :
  • z1 = isodd(y1) ? x1 + 0.5 : x1 - 0.5
  • z2 = isodd(y2) ? x2 + 0.5 : x2 - 0.5
  • d1 = sqrt((z1 - z2)^2 + 0.75 * (y1 - y2)^2)
  • d2 = sqrt((x1 - x2)^2 + 0.75 * (y1 - y2)^2)
  • d = (d1 + d2) / 2
I'm sure there is a way to simplify the process but I can't find it :D
 
Top