Get started with VTS Landscape Streaming Plugin for Unity

August 21, 2020

Did you ever think about developing a game that is taking place in a real-world environment? In an environment that isn’t limited by the borders of a town, nor a county, not even a country, but the whole globe? Are you a Unity developer or willing to consider Unity as the engine for your game? If your answers to these questions are positive, VTS Landscape Streaming Plugin for Unity might be the technology you need. A free and powerful streaming engine that together with vts-backend, an open-source library gives you the power to bring any geospatial datasets, from local to a global level, into your Unity application. The plugin natively supports Windows, Linux, iOS, macOS and UWP. However, the open-source nature of all VTS technologies enables you to build for basically any platform. Want to learn more? Just continue reading.

Disclaimer: This tutorial was done using the latest Unity version: 2020.1.0f1 Personal

HOW TO CREATE A VTS PROJECT IN UNITY

step by step

  1. Create a new project in Unity Hub, select 3D template.
  2. Go to Window – Asset store.
  3. Find ‘VTS Landscape Streaming Plugin’ and click ‘Add to my assets’.
  4. Go to Window – Package Manager.
  5. In the top left corner dropdown menu, select ‘Packages: My Assets’, where you should see all your added assets.
  6. Pick ‘VTS Landscape Streaming Plugin’, click ‘Import’ in the bottom right corner.
  7. A pop-up window will prompt you to select what components of the plugin you want to install. Leave everything to default values and click ‘Import’ in the bottom right corner of the pop-up window (called Import Unity Package).
  8. Save the project. All done.

BASIC USAGE OF VTS PLUGIN

The VTS directory can now be found in Project Window. It is composed of:

  • Demos: contains sample scenes / applications
  • Documentation: contains basic documentation
  • Plugins: contains precompiled binaries for supported platforms
  • Resources: holds definitions of basic objects such as Materials, Meshes, Shaders, etc.
  • Scripts: holds, surprisingly, scripts

The best way to get started with the VTS plugin is to explore some of the sample scenes in the Demos directory. These demonstrate some of the important concepts that the plugin employs and show the general approach of how the applications are built. Basic VTS Scene Hierarchy is composed of three main Objects – CanvasCamera and MapMap Object is where you specify a map configuration file. The link to this configuration goes to the Config Url parameter within Vts Map script, and it has to be URL pointing to a valid VTS ‘map-config’. Map config is a JSON file that defines the map as a whole, including reference frame, all the data layers being used or map view presets. It is generated dynamically by a vts-backend instance. Explanation of how to run vts-backend and create a valid map-config goes way beyond the scope of this article. However, you can refer to these tutorials, that will guide you through the way to set everything up and running.

MORE INSPIRATION

If you’ve gone through the basic demos and are still engaged and looking for further inspiration, you can look at the sample games for which you can find the source code on Melowntech’s GitHub. Firstly, there is a Fighter Jet simulator that lets the player explore the world from a pilot’s perspective. Secondly, a Driving game where you can drive a race car through the streets of the 3D reconstructed Danish town of Hillerød. The game also supports multiplayer. Finally, a zombie game VTSmaggedon, where you can attempt to save a city from a massive zombie invasion by crushing them under the wheels of your army recon vehicle.

Share with us apps, games, art or anything else you’ll create with us. We will be happy to test it! If you get stuck, reach out to us on GitHub, we’ll be glad to help.