Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


31. March 2015

 

Today I suppose, the new tutorial series covering creating a 2D game in both Unreal and Unity officially kicked off.  I just finished publishing this videoUntitled 7 ( embedded below ) to YouTube.

 

In many ways the video covers the same topics as the earlier announcement post.  Additionally it also goes into a bit of the differences between Unity 5 and Unreal Engine 4, especially from a licensing perspective, and area where Unity and Unreal differ a great deal.

 

We also cover some of the similarities and differences between Unity and Unreal Engine, which are probably more alike than you realize.  We go into the languages and platforms supported by each engine.  Of course we also describe the goals of this entire series.  If you are already familiar with Unity and Unreal and read the last posts, there isn’t really anything new here.

 

Once again, your comments and feedback will shape how I continue, so the earlier you can get suggestions in to me, the more likely I am to be able to cover them! Next up I will be doing a learning resources post for each engine, then we will jump in to the technical details, so stay tuned!

 

Unity vs Unreal Engine Tutorial Series –The Series Introduction

 

This space left intentionally vague.

Programming

blog comments powered by Disqus

Month List

Popular Comments

OpenStreetMap Plugin For Unreal Engine Released
Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


2. January 2017

 

Mike Fricker, UE4 Technical Director at Epic Games, just released a new plugin for Unreal Engine that enables you to utilize OpenStreetMap data directly in Unreal Engine.  Keep in mind this is just a hobby project and isn’t directly supported by Epic.  OpenStreetMap.org is a crowd sourced (think Wikipedia) map of the world.  This plugin enables you to take data from OSM and use it directly in your game, quickly creating real world accurate cityscapes like the one shown to the right.OSM  Additionally all of the location information is retained upon import, so if you are creating an Alternate Reality based game like Pokemon Go, the data is available to you.  Keep in mind however that OpenStreetMap data is released under the Open Data Commons Open Database License (ODbL).  I am no lawyer, but I believe the license enables you to create closed source projects using the data so long as you give proper attribute, share any modifications you make to the database and make sure that the data itself (not your game code) remains available and open.

 

Details of the plugin from the Readme:

Street Map Assets

When you import an OSM file, the plugin will create a new Street Map asset to represent the map data in UE4. You can assign these to Street Map Components, or directly interact with the map data in C++ code.

Roads are imported with full connectivity data! This means you can design your own navigation algorithms pretty easily.

OpenStreetMap positional data is stored in geographic coordinates (latitude and longitude), but UE4 doesn't support that coordinate system natively. That is, we can't easily deal with spherical worlds in UE4 currently. So during the import process, we project all map coordinates to a flat 2D plane.

The OSM data is imported at double precision, but we truncate everything to single precision floating point before saving our UE4 street map asset. If you're planning to work with enormous map data sets at runtime, you'll need to modify this.

Street Map Components

An example implementation of a Street Map Component is included that generates a renderable mesh from loaded street and building data. This is a very simple component that you can use as a starting point.

The example implementation creates a custom primitive component mesh instead of a traditional static mesh. The reason for this was to allow for more flexible rendering behavior of city streets and buildings, or even dynamic aspects.

All mesh data is generated at load time from the cartographic data in the map asset, including colorized road strips and simple building meshes with triangulated roof polygons. No spline interpolation is performed on the roads.

The generated street map mesh has vertex colors and normals, and you can assign a custom material to it. If you want to use the built-in colors, make sure your material multiplies Vertex Color with Base Color. The mesh is setup to render very efficiently in a single draw call. Roads are represented as simple quad strips (no tesselation). Texture coordinates are not supported yet.

There are various "tweakable" variables to control how the renderable mesh is generated. You can find these at the top of the UStreetMapComponent::GenerateMesh() function body.

(Street Map Component also serves as a straightforward example of how to write your own primitive components in UE4.)

OSM Files

While importing OpenStreetMap XML files, we store all of the data that's interesting to us in an FOSMFile data structure in memory. This contains data that is very close to raw representation in the XML file. Coordinates are stored as geographic positions in double precision floating point.

After loading everything into FOSMFile, we digest the data and convert it to a format that can be serialized to disk and loaded efficiently at runtime (the UStreetMap class.)

Depending on your use case, you may want to heavily customize the UStreetMap class to store data that is more close to the raw representation of the map. For example, if you wanted to perform large-scale GPS navigation, you'd want higher precision data available at runtime.

 

The plugin and it’s source code is hosted on Github available here.  The plugin is released under the very liberal MIT open source license.

GameDev News

blog comments powered by Disqus

Month List

Popular Comments