Have you ever wondered what would happen if you took software used for business processing and somehow combined it with software used for 3D games? Something like this:
Well wonder no longer. This article describes how to fit a 3D game front-end on top of the SHINE (SAP HANA Interactive Education) demo content available in your SAP HANA system. The 3D game client runs on your Mac or PC and connects to your HANA server. The client reads Purchase Order (PO) information from the HANA system and creates PO "creatures" in the game that you can then hunt, analyse and shoot to approve or reject them in the HANA system. There is also a reporting element, where 3D bar charts can be climbed on to give you a different perspective on your data - OLTP (of sorts) and OLAP in a single 3D world.
Have you ever wanted to actually shoot your data? Well now you can :smile: . Details on how to install and run the client yourself, along with its source code are given later.
This video gives you a better idea of how it plays out. This shows a Rev72 system having POs approved and rejected and some bar charts analysed, occasionally showing the SHINE Web interface for comparison:
The cardboard boxes are the POs, with images of their contents from the Rev72 system. Here are some screenshots:
A PO is Rejected
A PO is Approved
A Bar Chart
As you can see, if you reject a PO in the game it explodes, whilst approved POs zoom upwards to their (religion-neutral) "PO Heaven". These changes are reflected in HANA before the graphical effects happen in the game. If you stand on the switches near the bar charts you control what the charts display, and these are showing the same data as you see in the SHINE web reports.
You may well ask "why on earth would I want to connect a 3D front-end to HANA?" That is a very valid question, and one I've asked myself more than once. Think of it as a Proof of Concept showing what sort of things are possible with a 3D interface over HANA. It is arguably a form of "gamification", and this article is the "Making of" companion to another article posted over on the SCN gamification area which looks more at the gameplay aspects (such as they are) and how the PoC could be developed further. It is interesting to see that a company that make 3D Virtual Reality goggles, called Oculus Rift. were recently bought by Facebook, so 3D may be becoming more mainstream in future.
You can install the client on your PC or Mac and connect to any HANA server that has the SHINE content installed (it is there by default now if you are on a recent revision). There is no backend install required on the HANA system, you just need the local client. A big thanks to s0000716522 for his input to this work, helping with testing and providing valuable feedback and ideas. To try out the 3D Game Client for yourself follow the next section:
If you don't have access to one already, you can get your own HANA system. The following versions are supported: Rev 60 / SP6, Rev 70 / SP7 and Rev 72. SP8 is not tested yet, but will work if the SHINE content is similar.
IMPORTANT: for Rev 72 you must make sure that your user id has a default Session Client set. If this is not in place the 3D game client will not detect your HANA version correctly and charts won't work (the setting is needed for the SHINE currency conversion). To make the setting, in HANA Studio, Systems tab -> Security -> Users, make sure your user has its Session Client set to 001, like this:
To check that you've got the SHINE content installed, you can check that you can see data in the PO Worklist application using these links:
SHINE PO Worklist Entry Points
Version | URL to PO Worklist |
---|---|
Rev 60 / SP6 | <server ip address>:80<instance>/sap/hana/democontent/epm/ui/poworklist/WebContent/poWorklist.html |
Rev 70 / SP7 | <server ip address>:80<instance>/sap/hana/democontent/epm/ui/poworklist/poWorklist.html |
Rev 72 | <server ip address>:80<instance>/sap/hana/democontent/epmNext/ui/poworklist/poWorklist.html |
The above links take you to the web front-end for the SHINE PO Worklist. There you can check data, and see POs changing their status to Rejected and Approved.
There are some front-end prerequisites. You need one of: Windows XP with SP2 or later; Windows 7 with SP1 or later; Windows 8; Mac OS X Snow Leopard 10.6 or later. Windows Vista is not supported. You also need a graphics card with DirectX 9 level (shader model 2.0) capabilities. Any card made since 2004 should work. The front-end does not work on the CAL remote desktop PC on AWS, it does need to be run locally.
Windows
To download the client go here: https://www.dropbox.com/s/wda5ae2h5dfbeeq/Epm3d_Windows_x86.zip
To install, just unzip it into any folder, there is no actual installer.
Windows 64 bit
To download the client go here: https://www.dropbox.com/s/x6iut2p65itk7ti/Epm3d_Windows_64.zip
To install, just unzip it into any folder, there is no actual installer.
MacOS
To download the client go here: https://www.dropbox.com/s/4jzm9snfawi6ox3/Epm3d_MacOS.app.zip
To install the client see Aron's document, you have to skip past a couple of screens during start-up.
So with all that out of the way, finally we can get to the "How to" part. The game client was built using a product called Unity. Unity was designed originally for developing 3D games, but is also used for 3D visualisation like walk-throughs of buildings. There is a free edition which has a few advanced features removed, but all the heavy lifting of 3D development is done for you. Lighting, physics, input, cross-platform builds and much more are either done for you entirely or at least are well supported by the Unity engine. All you need to do is some C# or JS scripting to control the behaviours of objects and glue stuff together. I chose to use C# as most tutorials tend to use that, although you can mix scripting languages if you wish across different objects.
The communication between the client and HANA is all done using oData and XSJS services, the same services that are used by the standard SHINE web frontend. To find these I used the web frontend (see the links in section "SHINE PO Worklist Entry Points" above) with Fiddler running, and that way I could see all the oData and XSJS calls that were being made. With that, it was easy to generate the necessary URLs.
Trivia: SP6 used UPPERCASE for field names, so oData service calls are eg "PURCHASEORDERID". SP7 changed this and used TitleCase for fields, so oData service calls became eg "PurchaseOrderId". Then Rev72 went back and used UPPERCASE again, so URLs are back to saying "PURCHASEORDERID". What will SP8 bring, back to TitleCase perhaps?
The source code and assets are all available in GitHub. Unity is easy to use, but not so intuitive that you can dive in immediately and follow it all. At least do the intro videos tutorials provided the Unity team to learn the interface or you'll quickly get pretty lost (at least I did).
To help orientate yourself if your looking through the Unity project files, the various objects in Unity link together like this:
The boxes in the above diagram are mostly C# scripts in the Unity project. Most of the communication between objects is event driven (you'll see lots of On* event handlers in the scripts, for example when collisions happen, or when an oData query returns). There are also per-frame calls made by the Unity engine, so every 1/50th of a second (or thereabouts) the Update() method is called, which is used to handle drawing things and collecting user input.
I hope this article proves interesting, the source code is there to pull apart and reuse, any feedback is welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 |