Thursday, April 16, 2015

Unreal Engine4 Plugin - hello world linux


Get my fork of Unreal Engine https://github.com/rusthon/UnrealEngine this fixes some c++11 issues and makes it compatible with my new project Rusthon, see this example plugin that links in a dynamic library and prints hello world. You can compile the plugin by running:

git clone https://github.com/rusthon/Rusthon.git
cd Rusthon
./rusthon.py ./examples/unreal_plugin.md --run=install-plugin.py --output-dir=~/Documents/Unreal\ Projects/MyProject

Unreal has an build system based on C# scripts, and a naming convention that requires you to keep your folders, files and class names in sync. You also need to setup your includes to pull in from a single header, the so called "PCH" (pre-precompiled-header). The other problem in getting started with a simple plugin are most of the Unreal docs focus on Windows and OSX, and not command line usage from Linux. It took me awhile to figure out that Unreal was caching the build files, and how to properly clear them in the install script. See the install script at the top of unreal_plugin.md

import TestPluginPrivatePCH.h
import ITestPlugin.h

@extern
def hello_rusthon() -> int:
 pass

class FTestPlugin( ITestPlugin ):
 @virtualoverride
 def StartupModule():
  print 'HELLO MYPLUGIN XXXXX'
  a = hello_rusthon()
  print a  ## should print 99
  print 'GOING TO QUIT UNREAL NOW'
  raise std::exception()

 @virtualoverride
 def ShutdownModule():
  print 'MYPLUGIN EXIT'

macro("IMPLEMENT_MODULE( FTestPlugin, TestPlugin )")

Monday, April 13, 2015

4D Navigation


This weekend I teamed up with Steve Favis on a nearly nonstop 30 hour hackathon for NASA SpaceApps 2015. We developed a navigation system that takes into account the physics of possible future events and jumping to reach its target goal. Checkout Steve's twitter for more info: @stevefavis