Giter Site home page Giter Site logo

truckermudgeon / maps Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 2.64 MB

Web-based maps for ATS and ETS2

License: GNU General Public License v2.0

JavaScript 0.18% Shell 0.02% HTML 1.05% TypeScript 92.78% CSS 0.04% Python 0.10% C++ 5.30% C 0.53%
american-truck-simulator ats ets2 euro-truck-simulator-2

maps's Introduction

TruckSim Maps

TruckSim Maps is a collection of tools and components for building web-based maps for American Truck Simulator and Euro Truck Simulator 2.

The long-term goal of the project is to build a Route Advisor for ATS that can run on a phone or tablet.

A demo app built with these tools and components can be found at https://truckermudgeon.github.io/.

Getting Started

Prerequisites

Installation

# clone the repo into a local directory
mdkir maps
cd maps
git clone [email protected]:truckermudgeon/maps.git .

# install maps projects
npm install

# build native addon
npm run build -w packages/clis/parser

Projects

The TruckSim Maps repo contains the following projects:

parser

parser is a CLI tool that parses map data in ATS/ETS2 files and outputs JSON and PNG files.

npx parser -i pathToGameDirectory -o dirToWriteFilesTo

Parsing can take a couple of minutes, depending on the machine and the installed map DLCs.

Note

  • All released map DLCs are supported.
  • Third-party map mods are not supported.

generator

generator is a CLI tool that generates GeoJSON, PMTiles and MapLibre spritesheet files from parser output.

# generate ATS pmtiles file
npx generator map -m usa -i dirWithParserOutput -o dirToWriteFilesTo

# generate ETS2 pmtiles file
npx generator map -m europe -i dirWithParserOutput -o dirToWriteFilesTo

# generate combined ATS and ETS2 cities.geojson file
npx generator cities -m usa -m europe -i dirWithParserOutput -o dirToWriteFilesTo

# generate combined ATS and ETS2 footprints.geojson file
npx generator footprints -m usa -m europe -i dirWithParserOutput -o dirToWriteFilesTo

# generate spritesheet files
npx generator spritesheet -i dirWithParserOutput -o dirToWriteFilesTo

Important

PMTiles output requires tippecanoe to be installed.

The generated GeoJSON for roads and prefabs is far from perfect; many intersections look incorrect. Improvements to how they're generated are slowly being made.

demo-app

demo-app is a React app that renders ATS/ETS2 maps.

demo-screenshot

# from the project root:
# run the `generator` commands listed above, specifying
#
#   packages/apps/demo/public
#
# as the output directory.
#
# Then run the following to start the web server:
npm start --workspace=packages/apps/demo

prefabs-app

prefabs-app is a React app that helps visualize and debug how PrefabDescriptions are converted into LineStrings and Polygons.

prefabs-screenshot

# from the project root:
#
# 1. run the `parser` command listed above to generate
#      usa-prefabDescriptions.json
#
# 2. copy usa-prefabDescriptions.json to
#      packages/apps/prefabs/public
#
# Then run the following to start the web server:
npm start --workspace=packages/apps/prefabs

License

TruckSim Maps is licensed under GPL v2.

Credits

Parts of the parser and generator projects are based on:

The generator project makes use of data from Natural Earth.

maps's People

Contributors

nautofon avatar truckermudgeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nautofon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.