Map SDK for game engines SDK is ArcGIS Maps SDK for Unity and ArcGIS Maps SDK for Unreal Engine, respectively, were released in June and July by the US company Esri.Development of the SDK began in 2019, with a pre-release in 2021 and then the official release.We have introduced the SDK in previous blog posts, but with the official release, this blog post will once again introduce the main features of the SDK and its integration with ArcGIS.Previous articles introducing the SDK:Handling the Earth inside Unreal Engine and Unity!?Handling PLATEAU's 3D city models also in Unreal Engine and Unity!? ~ Introduction to map SDKs for game engines ~
Please note that ArcGIS Map SDK for Unity/Unreal Engine is currently not supported by ESRI Japan. The Esri product support services and developer support services provided by ESRI Japan are not available for this product, so please be aware of this in advance.Base maps / Elevation dataArcGIS Online publishes global satellite imagery and elevation data, which can be used through the SDK
in Unity/Unreal Engine as well. There is no need to write code to use these map data. Simply set the URL of the web service for map data in the editor settings to easily represent real-world context and terrain within the game engine.Since the official release, it has become mandatory to set an API key when using base maps or elevation data provided on ArcGIS Online by Esri (USA) (an Esri developer account is required to obtain an API key). Usage beyond the free tier (for base maps, 2,000,000 tiles per month) requires registration for a pay-as-you-go plan, but for evaluation and development purposes, usage within the free tier should be sufficient.
SDK, you can easily display custom data and layers shared on ArcGIS by specifying a URL or path (Unity/Unreal Engine).
3D Mesh Scene Layer3D Mesh Scene Layers combine both images taken by drones and surface models to integrate many structures such as buildings, roads, trees, rivers at a city level into one continuous surface. It is an ideal layer for representing entire city structures in 3D. By using 3D Mesh Scene Layers created and shared on ArcGIS, you can express more realistic cities.'Arakawa Digital Twin online - Arakawa 3D River Basin Map' publishes a 3D Mesh Scene Layer displayed in game engines.3D Object Scene Layer3D Object Scene Layers manage individual structures such as buildings and trees separately and include complex 3D representations including textures as well as attribute information linked to each structure. Attribute information can also be used to determine how to display that object in real-time. The figure below shows a 3D Object Scene Layer published and shared on ArcGIS Online using PLATEAU's maintained 3D city model data. The left image displays data including textures, while the right image shows buildings in commercial areas (referencing values from the 'zoning district' attribute field) displayed in blue.In addition to these, 2D image tile data can also be displayed. These data/layers can be used both online and offline.Global mode and Local mode
There are two types of map display modes: "Global" mode and "Local" mode (Unity/Unreal Engine). Global mode can be used to display data spanning the entire world and allows zooming out to see the Earth as a sphere. Local mode allows displaying data over smaller areas with clipping of display range into circular or rectangular shapes.
Mesh Collider, layers/data from ArcGIS added via the SDK can enable mesh colliders (Unity/Unreal Engine). This is necessary for visibility determination, movement destination checks, object identification via click operations, etc. The figure below shows lines of sight between two objects. Green lines indicate visibility between objects; red lines indicate that objects cannot see each other due to obstructions like buildings.
Integration with Game Objects / ActorsAs introduced in previous blog posts, you can add an ArcGIS Location Component (Unity/Unreal Engine) to game objects/actors to display them at specified coordinate positions on the map. Display positions can be updated in real-time using APIs etc. This sample uses GameAnime's Simple Drone asset.Below is an example of integration between game objects/actors and ArcGIS map functions.Route SearchArcGIS provides global road data allowing route searches between specified points. Below shows route search results displayed on game objects/actors within the game engine using ArcGIS Location Component via REST API.Visualization of 2D DataArcGIS has a feature called Feature Layer for managing its own location-based 2D data. Similar to route search mechanism, coordinates of objects can be obtained from this Feature Layer via REST API, allowing creation of game objects/actors configured with ArcGIS Location Component. The figure below stores coordinates and airport names of airports in Japan in a Feature Layer; these objects are retrieved via REST API and displayed on the game engine by setting ArcGIS Location Component on assets.
This sample uses Alstra Infinite's Planes & Choppers – PolyPack asset.Implementation methods for each introduced feature can be referenced from samples included in the SDK or samples published on GitHub (Unity/Unreal Engine).API キーの取得には開発者アカウントが必要です)。無償利用枠(ベースマップの場合は、2,000,000 タイル/月)を超えての利用は従量制プランの登録が必要ですが、評価・開発目的であれば、無償枠内で十分利用していただけると思います。
ArcGIS のデータ/レイヤーとの連携
ベースマップや標高データ以外にも SDK を使用すると、ArcGIS で共有される独自のデータやレイヤーを、URL やパスを指定するだけで簡単に表示できます(Unity/Unreal Engine)。
3D メッシュ シーン レイヤー
3D メッシュ シーン レイヤーは、ドローン等で撮影した画像とサーフェス モデルの両方を組み合わせ、都市レベルでの建物、道路、樹木、河川等の多くの構造物を1つの連続したサーフェスに統合します。都市全体の構造物を 3D で表現する際に最適なレイヤーです。この ArcGIS で作成・共有された 3D メッシュ シーン レイヤーを利用することで、よりリアリティのある都市を表現できます。
「Arakawa Digital Twin online - 荒川 3D 河川管内図」で公開されている3D メッシュ シーン レイヤーをゲームエンジンで表示
3D オブジェクト シーン レイヤー
3D オブジェクト シーン レイヤーは建物や樹木等の個々の構造物を個別に管理し、テクスチャを含む複雑な 3D 表現と、個々の構造物に紐づく属性情報を含んでいます。属性情報は、そのオブジェクトをリアルタイムにどのように表示するかを決めるためにも使用できます。下図では、PLATEAU で整備されている 3D 都市モデルのデータを ArcGIS Online で公開・共有した 3D オブジェクト シーン レイヤーを表示しています。左図ではテクスチャを含むデータを表示しており、右図では商業地域(「地域地区」の属性フィールドの値を参照)にある建物を青色で表示しています。
これらの他にも 2D の画像タイルのデータも表示できます。また、これらのデータ/レイヤーはオンライン/オフラインの両方で使用できます。
グローバルモードとローカルモード
地図の表示方法は、「グローバル」モードと、「ローカル」モードの 2 種類があります(Unity/Unreal Engine)。グローバルでは、世界全体にまたがるデータを表示するのに使用でき、ズームアウトして地球の球体を見ることができます。ローカルでは、より小さな範囲でデータを表示することができ、円形または四角形の任意の範囲で表示範囲をクリップできます。
メッシュ コライダー
SDK で追加する ArcGIS のデータ/レイヤーはメッシュ コライダー(Unity/Unreal Engine)を有効化できます。可視領域の判定、移動先の判定、クリック操作によるオブジェクトの識別等にそれが必要となる場合があります。下図では2つのオブジェクト間の見通し線を表示しています。緑色の線分はオブジェクト同士が見通せることを示し、赤色の線分は建物等の遮蔽物によりオブジェクト同士が見通せないことを示しています。
ゲームオブジェクト/アクタとの連携
過去のブログ記事でも紹介しましたが、ゲームオブジェクト/アクタに ArcGIS Location Component(Unity/Unreal Engine)を追加して地図上の指定した座標位置に表示できます。表示位置は API 等を使用して、リアルタイムに更新できます。
このサンプルでは、GameAnime の Simple Drone アセットを使用しています。
下記では、ゲームオブジェクト/アクタと ArcGIS の地図機能の連携例を紹介します。
ルート検索
ArcGIS ではグローバルな道路データを提供しており、指定した地点のルート検索が行えます。下記では、REST API でルート検索した結果の情報を ArcGIS Location Component を使用してゲームオブジェクト/アクタとして、ゲームエンジン上に表示しています。
2D データの可視化
ArcGIS には自身の持つ 2D の位置情報付きのデータを管理するためにフィーチャ レイヤーという機能があります。ルート検索と同じ仕組みですが、このフィーチャ レイヤーから REST API を介してオブジェクトの座標を取得し、ArcGIS Location Component を設定したゲームオブジェクト/アクタを作成できます。下図では、日本の空港の座標と空港名の属性データをフィーチャ レイヤーに格納し、REST API を介してそのオブジェクトを取得し、アセットにArcGIS Location Component を設定してゲームエンジン上で表示しています。
このサンプルでは、Alstra Infinite の Planes & Choppers – PolyPack アセットを使用しています。
紹介した各機能の実装方法は SDK に含まれるサンプルや GitHub に公開されているサンプル(Unity/Unreal Engine)を参考にできます。
SDKのダウンロード
正式版の SDK は ArcGIS Developers サイトからダウンロード(Unity/Unreal Engine)できます。SDK のダウンロード、開発、評価は無償で行えます。無償の ArcGIS 開発者アカウントまたは ArcGIS Online アカウントを使用して、ArcGIS Developers サイトにサインインして SDK をダウンロードしてください。SDK の使い方は、ドキュメント(Unity/Unreal Engine)をご覧ください。
また、Esri Community サイトで、SDK に関する質問を投稿したり他の開発者の質問やその回答を確認したりできます。ベータ版の時にお使いいただいていたベータ サイトは近くに使用できなくなるため、今後は上記の Esri Community をご利用ください。
さいごに
正式リリースされましたが、これからのバージョンアップでは、ベクター タイル レイヤー、点群シーン レイヤー、フィーチャ レイヤー、ジオコーディング、ルーティング、その他の分析ツールなど、豊富な機能が追加されていく予定です。ご期待ください。
既にゲームエンジンを利用されている方もこれからはじめる方も、ぜひ ArcGIS をご活用ください。
関連リンク