Game Secrets ~ What is Map.sql?

Posted on by Ameno

What is map.sql?

SQL stands for Structured Query Language and it’s a standard language for storing, manipulating and retrieving data in databases.

Map.sql is a file provided by Travian: Legends on a daily basis and used by various external tools and tool creators. The file contains detailed information about villages on the map and is updated always at midnight server time, every 24 hours.

Important note for tool-creators: The file is generated at midnight server time, however, it’s not recommended to set data extraction exactly at midnight (00:00:00). Due to various processes, the file might become available with 5-20 seconds delay.

What information does map.sql file contain?

Each map.sql file contains information about every village on a selected gameworld and its state by the time the file was created. It doesn’t matter at which time of the day you downloaded the file – it shows parameters that were saved at midnight server time.

When you open the file you will see the list of the entries that will look something like this:

INSERT INTO `x_world` VALUES (22028,173,146,5,31912,’Natars 173|146′,1,’Natars’,0,”,498,NULL,FALSE,NULL,NULL,NULL);

If you know what each parameter means, you can easily decipher it using the table below:

Regular Gameworld
Field IDXYTribeVillage IDVillage namePlayer IDPlayer nameAlliance IDAlliance TagPopulationRegionCapitalCityHarborVictory points
22028173146531912Natars 173|1461Natars0498NULLFALSENULLNULLNULL
Annual Special (random example)
Field IDXYTribeVillage IDVillage namePlayer IDPlayer nameAlliance IDAlliance TagPopulationRegionCapitalCityHarborVictory points
367728010929260LilaS1744ashko2UU #948VenedaeTRUEFALSEFALSE162

Important note: In the past the file was slightly different for Annual Special gameworlds compared to regular ones, as it included data about cities, capitals and Victory Points. By now it had been unified so that all files will have all data. However, in case the gameworld doesn’t support a specific feature, the data will be set to NULL. That’s why on a regular gameworld map.sql will contain NULL in the place for the region, city, harbor and Victory Points. This was done for the conveniency of the tool creators.

TRUE and FALSE are used to define the status of the village (for example, whether a certain village is a capital or not)

The tribes in map.sql file are shown as a digit.

  • 1 – Romans
  • 2 – Teutons
  • 3 – Gauls
  • 4 – Nature (this tribe is not shown in map.sql)
  • 5 –  Natars
  • 6 – Egyptians
  • 7 – Huns
  • 8 – Spartans
  • 9 – Vikings

How can I get map.sql file from a certain gameworld?

To get map.sql file you just need to add map.sql after your gameworld name as in an example:

Gameworld linkhttps://ts5.x1.europe.travian.com/
Map.sql linkhttps://ts5.x1.europe.travian.com/map.sql

The downloading starts automatically. You do not need to be a part of the gameworld to download map.sql file for it.

What for and how can I use this data?

Map.sql data can be used various ways. Alliance off-coordinators often use this file to plan operations, regular players and game analitics do that to monitor gameworld/players activity and such. If you’re new to programming, consider opening the file using a notepad (.txt format) and pasting it to excel or a similar tool with the comma as a column separator. That way you can use tool filters to search for the data you need.

And that is a wrap! Stay tuned and come back to Thursday guides to find out another secret about the game!

Similar Posts

  • Messages

    Messages InGame Messages (IGMs) To write an IGM, all you need to do is click on the write tab in the IGM overview; then, start by adding a recipient, subject and text. If you’re in an alliance (and have alliance message permissions) you can send Mass Messages or Ally Messages. This can be done in…

  • Game Secrets ~ Advanced Start

    Posted on January 10, 2024by Ameno Welcome back to the The Game Secrets series! The gameworlds with advanced start feature appear quite regularly and allow players to skip the “getting economy to a certain level” part and come to faster actions. And still we receive a lot of questions about it. Let’s look at the advanced start feature in more detailed…

  • Preventing Conquering

    Preventing Conquering Players often fail in defending their village because they do not know how to react, or they react too late. With a successful defence, a player can harm the attacker and even prevent the conquering. Precautions Spies Spies or scouts are often underestimated, but they are cheap and can reduce the possibility of…

  • Oasis

    Oasis At the beginning of the game, oases are occupied by wild animals and are initially without any resources. Oases resource production does not start until all the animals that initially spawned on the oasis are removed – either through combat or capture. During the initial game phase, the oases will spawn nature troops only…