Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

11. January 2016

 

Out of the box Unreal Engine 4 has support for C++ and Blueprints.  This leaves a bit of a gap for people that want more of a scripting experience but don’t want to work in a visual language like Blueprints.  Of course we have full source code access and Unreal Engine has solid plugin support so it was only natural for a few third party languages to pop up.  What follows is the list of external programming language options for developing in Unreal Engine.

 

JavaScript

Probably the best supported language alternative, there are two major implementations of JavaScript for UE4:

 

Unreal.JS

Released by NCSoft, the folks behind the popular Guild Wars RPG series, this plugin adds JavaScript support via the V8 engine.  Impressive in it’s scope, it includes CommonJS module support, .d.ts files for Intellisense support, a Jade like templating engine, live reload as well as access to the entire Unreal SDK.

 

Flathead

Another implementation of JavaScript via the V8 engine.  Older, small in scope and less supported, so probably best to go with Unreal.JS.

 

C#/.NET

This one is a bit tricky.  There was an early leader in an implementation by Xamarin, until licensing differences killed that project.  The only other alternative is currently Windows only.

 

Mono for Unreal Engine

Sadly no longer under development because of licensing issues, this version is outdated, requiring Unreal Engine 4.4 and a Xamarin license to deploy.

 

Klawr

Currently the best bet for C# development using the Unreal Engine but sadly confined to Windows only.  In the authors own words “This project is still highly experimental, and not very useful (though it's getting there)”.  It’s open source and hosted on Github if you wanted to contribute.

 

Haxe

There is one project looking to add Haxe language support to Unreal Engine.  Fortunately it’s pretty far along.

 

Unreal.hx

Fully supporting subclassing UActor and Blueprints, the Haxe code compiles directly to C++ code leaving minimal overhead.  This implemetnation gives access to the entire Unreal Engine API.

 

Other

 

Rust

Slightly different than the other languages on the list, this project implements a simple plugin enables you to link a 3rd party Rust library to C++ in Unreal Engine.

 

SkookumScript

A custom scripting language for Unreal Engine (and other game engine) development, SkookumScript is in their own words “SkookumScript is a text-based programming language for creating performance-critical, real-time gameplay. It is now available as a free turn-key plugin for Unreal Engine 4 (UE4)”.  SkookumScript was used to create the game Sleeping Dogs.

 

 

No doubt there are languages I’ve missed, so if you know of one at is in at least a runnable state, please leave a comment below and I will add it.  I am somewhat shocked that I couldn’t find a Lua plugin at this point! 

Programming , ,

4. January 2016

 

I covered this briefly in another tutorial but I’ve noticed enough people searching for it, I decided it deserved a post of it’s own.  The GearVR software has a special developer mode that enables you to run GearVR applications without being inserted in a GearVR headset.  This tutorial shows the process of enabling developer mode.  Obviously you need a late model Galaxy S6/Note phone to follow along.

 

It is also available as an HD video.

 

Enabling Developer Mode

  • Swipe down and select Settings gear icon
  • Tap Applications
  • Tap Application Manager
  • Locate Gear VR Service, tap
  • Tap Manage Storage
  • Tap VR Service Version Several times
  • Swipe Developer Mode on.  Now you can run without the Rift (great way to record video by the way…)

 

If successful it should look like this:

Screenshot_2016-01-04-15-32-54 [347917]

 

Use the Developer Mode toggle to turn devmode on and off.  Be aware that while developer mode is enabled your phone is going to flicker like mad as it alternates between each eye.

 

Video Version

Programming

4. January 2016

 

I was recently working with a tool that exported it’s level data as a directory full of obj files, literally hundreds of them.  You can import them into Blender using File->Import->Obj, unfortunately there is no way to do a select all.  Apparently in Blender 2.4x if you held SHIFT while selecting OBJ import, it would import an entire directory, but this doesn’t appear to work in modern Blender.  You can also SHIFT+Click multiple files to do multiple selection, but this gets tedious when you have hundreds of them.  Unfortunately CTRL + A doesn’t work…

 

Thankfully Blender is extremely scriptable, so let’s turn to Python for a solution.  The following script will import a directory full of OBJ files into the current scene.

import bpy
import os

def fileList(path): 
    for dirpath, dirnames, filenames in os.walk(path):
        for filename in filenames:
            yield os.path.join(dirpath, filename)

for f in fileList("C:\\file\\path\\here\\"):
    if f.lower().endswith(".obj"):
        bpy.ops.import_scene.obj(f)


Be sure to change the path to your directory and if on Mac OS or Linux, to change the path format /to/this/style. Otherwise this script will chug away importing the OBJ files for you. Hopefully at some point Blender gives you the ability to select all while importing and the need for this script goes away completely.

Art, Programming , ,

4. January 2016

 

We recently covered getting started in GearVR development using Samsung’s GearVRf library and the Unity Engine.  Today we are going to finish it off with coverage of getting started using the Unreal Engine.  As with the Unity tutorial, although this is focused on the GearVR, most of the instruction should be equally valid for all Oculus Rift devices.  Of all the game engines, the Unreal was actually the easiest engine to get up and running with the GearVR.

 

There are a few pre-requisites before getting started:

There is a video based version of this tutorial available here and embedded below.

 

Configuring Unreal Engine

In order to be able to run code on your phone we need to add the Oculus Signature file to the application.  With Unreal Engine, this is configured at the engine level which is handy as you only have to configure it once for and it will work with all future projects.  If you haven’t already, sign up for an Oculus developer account, then get your key.  This will generate a file that we need to copy now.

The directory you want is [Unreal Install Dir][Version]\Engine\Build\Android\Java\assets.  In my install it was:

image

 

Creating a Project

You can use just about any settings, but these ones work well.

image

This will mostly just set presets that are mobile friendly.  Click Create Project when ready.

 

Configuring Your Project

If not done already, load your project in Unreal Engine, then select Edit->Plugins:

image

 

Now verify (or turn on) the GearVR and Oculus rift libraries and plugins, like so:

image

 

Now select Edit->Project Settings:

image

 

Locate Android SDK on the left hand side then on the right configure the location of your Android SDK install.

image

 

Now go to Android, set the Android minimum level then click the Configure Now button:

image

 

While in the Android settings, be sure to enable GearVR support!

image

 

Build Your App

 

Now build and package for Android, in the File Menu, select Package Project->Android->Android (ETC2):

image

Pick a location for the generated APK then Ok.

image

For the record, Unreal Engine Android builds are really really really slow.

 

When complete this will generate the APK file to run on your phone, as well as a pair of BAT files to quickly deploy to your device.  The noOBB batch file doesn’t copy data, only the updated executable.  Keep in min,d, you need to have your device either tethered or running wirelessly over adb to deploy.  This means removing it from the GearVR, which is an annoying process.  If you don’t need to fully test VR functionality, it might be faster to work in developer mode. [Link soon]

 

Video

Programming , ,

3. January 2016

 

Earlier we look at getting started doing Gear VR development using Samsung’s GearVRf library.  In that tutorial I mentioned a few times that it is a great deal easier to get started doing Gear VR development using the Unity game engine.  Today we are going to look at the process of getting a game up and running using the Unity game engine.  This tutorial is GearVR specific, however it should be just as applicable for the Oculus Rift.

 

Truth of the matter is getting started with Unity is exceptionally easy, but…

 

The information out there is all out of date and makes the learning curve much harder than it used to be.  First off, Samsung make a set of utilities available and you need to make sure you get the newest version.  However, Unity now has VR built in out of the box, so you don’t need to do anything at all.  This renders almost all of the existing getting started type tutorials completely wrong.

There is a video version of this tutorial available here.

Getting Started

 

First off, create a project like normal, no need to do anything special.

image

 

Now select Build Settings in the File menu

image

 

Select Android, then Player Settings…

image

 

Now select Virtual Reality Supported.  Also be sure to set your bundle identifer and optionally the Minimum API Level (the lowest possible level is a Galaxy Note running 4.4):

image

 

If you run it now you will get the following error:

image

 

This is because the GearVR wont allow your app to run without the Oculus key.  To get this you need a (free) developer account from Oculus and register your device using this form.  That will generate a file that needs to be copied into your project.

Inside your Unity project, locate the Assets directory and create the following directories Plugins\Android\Assets and copy the signing key in, here is mine:

image

 

Your game should now run just fine on your device.

 

Oculus Utilities for Unity 5

 

The “old” way of supporting GearVR and Oculus Rift in Unity involved importing a set of utilities called the Oculus Utility of Unity 5.  Since these were released however Oculus and Unity have worked to make the integration in Unity more complete.  That said, the transition isn’t complete as of writing.  You still don’t have access to the universal menu or overlays using Unity so you still may have to use the Oculus Utilities.  Fortunately they can still be imported and exist side by side with a default Unity install.

 

In addition to the Oculus Utilities of Unity there is also a set of example projects that you can import.  There is also a guide to Unity 5 integration available on Oculus, although be aware that parts of it are now obsolete.

 

Unity VR Samples

 

There is also a pretty significant set of samples illustrating using VR in Unity available on the Unity Store.  Simply create an empty project and import in the example.  These VR Samples illustrate a number of different concepts required for working with VR in Unity.

 

 

In time, more and more functionality should be built into Unity, making this process even easier.

 

Video Version

Programming ,

Month List

Popular Comments