Luckily, I won one of the Leapmotion devices. When I got it, one of the first things that came to my mind was wouldn't it be cool to control an aircraft with. Anyway, I've had a little bit of Unreal Engine experience and thought it would be interesting to incorporate custom hardware into a game. The custom hardware took the form of a power glove. Thinking back now, it probably would have been better to integrate a fan or something.
Anyway the game is a free download: http://funkinessfactor.itch.io/bombardier
The power glove has a vibration motor that connects to a L298N motor driver that connects to a TivaC launchpad that ultimately integrates to the PC using USB. Using USB was surprisingly quite easy as Texas Instruments provide heaps of example code.
The integration into Unreal Engine 4 is also quite straight forward. You provide a DLL, but you don't statically link to it, you need to dynamically invoke it functions.
The source code covers both of these (but not the actual game). Rather than trying to explain it blow by blow, it is probably easier just to read it.
The interface to the L298N is 5V, but the TivaC operates at 3.3V, so really the only piece of hardware was to use a Mosfet to step up the signal. The capacitor is not really necessary, just a bit worried about the surge current on turning the motor off and on.
Not that Hackster is about writing games, but just a brief explanation about how the code was written. The terrain was randomly created using Perlin noise. It always creates the same terrain as the game always starts off with the same seed. The "hexagon voxels" are all instance meshes due to their great performance. A* Search was used to control the ships. They kind of move randomly but purposefully towards your island. The aircraft is controlled using a simple proportional controller.
I'm in the process of providing a more detailed blog of this on TI's site and I'll link it as soon as it becomes available.
This project has been Greenlit of steam: http://steamcommunity.com/sharedfiles/filedetails/?id=538421433
Comments
Please log in or sign up to comment.