nlhans / ets2-map

Map of ETS2
MIT License
13 stars 5 forks source link

Due to personal time & energy constraints, I'm unable to maintain this repository for the community. Please refer to dariowouters' implementation for a version that features expanded functionality & bug fixes for reading ETS2 and ATS maps.

Euro Truck Simulator 2 Map

This repository is middle-ware for software developers to integrate ETS2 maps into their widgets. It will also help with building a route advisor.

At the current state this library is ALPHA, meaning that it can read the ETS2 map but with some quirks and limitations. There is work required to make it easy to use, fast to load or adaptable to mods.

Please see the ticket system to review any known issues or work that is left open.

The demo application can be used to check if exported files from ETS2 are set up correctly, and how the map can be rendered onto a widget.

Assets

ETS2 maps are built basically by 2 main assets:

All other objects in the game are auxiliary to navigation maps, and not necessarily needed for generating maps. However, the following objects may be of interest:

Setting up

In order to set-up for a demo, you need to manually extract the following:

During initialisation you need to point to these 3 directories. In the demo this is done at Ets2MapDemo.cs. Relocate the project map to where you will be using this GIT repository.

The LUT files are shipped in this repository. These files are translation tables to convert the game ID's to prefab names.

The loading of SCS Europe map (without Scandinavia DLC) requires some time. The mapper loads all sectors at once and keeps objects in memory. The map parser also uses a fail-safe method of searching for items which is rather CPU intensive. Therefor the loading process is paralleled to all threads your machine has, and will keep them busy at 100% for a brief time. On a Intel i5 3570 machine it takes 10 seconds to load up the map in Debug mode, and about 7 seconds in Release mode.