May 12 2013

Print this Post

Move.me and Unity 3D

For the prototype for my innovation project Motion Control in Combination with Stereoscopic 3D, I decided to use Play Station Move. The reason for that was that Play Station Move allows to track acceleration, rotation and position of the controller. Additionally, the video stream of the Play Station Eye can be used for head-tracking, which was an important feature to be able to improve the S3D effect.

After I decided to use Play Station Move I needed to find out how I can use the Play Station Move. I had the option to use a Play Station 3 Dev-Kit together with the Phyre Engine and Move SDK to develop my prototype. However, the problem with this approach was that it is not possible to use the PS3 inside the HIVE. It is just not possible to connect the PS3 to the projectors of the HIVE. The result of this restriction is that I had to use a PC to develop my prototype. There are two ways to use the Play Station Move on a PC. The first option is to connect the PlayStation via Bluetooth to the PC and use the library MoveOnPC. First I tried this option. Unfortunately, it was not possible to get a working connection on the PC. Maybe my Bluetooth device had a problem with the Play Station Move or Windows 8 was the problem. I read that MoveOnPC works fine for Mac. But for my system it just didn’t work. Because I struggled to get the PlayStation Move connected to my PC I searched for an alternative and found out that Sony has published in the US PlayStation store an application called Move.me. It is a server software application for the PS3 to be able to use PlayStation Move on the PC. Luckily, my lecturers Gregor White and Grant Clarke were able to organise a PlayStation 3 with PlayStation Move and the application Move.me for me so that I could get started with development. Thank you for that.

After I had setup the PS3 with Move.me I only needed to find out how I can use Move.me inside Unity 3D. I decided to use Unity for development of my prototype because it is the perfect game engine for fast and flexible prototype development. To be able to integrate Move.me into Unity I just had to download the PS Move Wrapper Package for Unity. Since the 16th April 2013 there is also a newer version of the package PS Move Wrapper Package V2. For my project I used the first version. It was straight forward to use. The only problem I had was that Windows firewall blocks the UDP port. How the wrapper package is programmed it will always use a different UDP port. This is fine if you don’t use Windows firewall. But if Windows firewall is enabled you always have to unblock a different UDP port. In code it is possible to tell Move.me on which UDP port the communication should be done. With that it was possible to define a constant UDP port, which solved this problem.

With Move.me and PS Move Wrapper Package it is possible to get all the control stick, D-Pad and buttons data. Additionally, Move.me sends the position, rotation, acceleration, velocity of the PSMove handle and sphere. It is also possible to change the sphere colour and to handle the vibration input of the Move Controller. The data provided from Move.Me needs not to be interpreted and can directly be used inside the game. This is one big advantage PlayStation Move has. Programmers don’t need to interpret the sensor data and find out what it means. The PS3 outputs the data in a usable way.

One very important part to setup inside Unity when using Move.me is to set the fixed timestep to 0.008. With that input data of the PlayStation Move as well as physics will be updated 125 times per second. This setting is very important to get a smooth control input.

Following video shows my first prototype I was able to implement in one day in Unity. The prototype shows a one to one mapping of the controller movement in the scene. Additionally, you can see on the left corner which data is provided from the PS3.

Download: 360p | 720p | iPhone

Permanent link to this article: http://www.markusrapp.de/move-me-and-unity-3d/