Tunnel Vision on HoloLens

I’ve been asked to show some of the app I’ve been working on.

Well, I’ve been dabbling with a few things. I’ve already shown the Visualizer so I won’t show that today. I’ve been working on something with similar technology to HoloTours but I won’t show that today either.

Instead, I have a video of a game I originally wrote in XNA back in 2007 when I wrote the book XNA Unleashed. I actually updated that version in 2009 with XNA Game Studio 3.0 and then just updated the code again a last month to use MonoGame.

 

What I’m demoing here though was actually written using Unity. Last year, I did some free webinars on game development. One of the webinars I did was showing How to create a Unity 3D Game in 90 minutes. People seemed to have like the webinar. If you are interested, you can watch a replay over at devgame101.com.

The game is called Tunnel Vision and it is a simple first person perspective game where you are defending your tunnel from invaders. The invaders don’t shoot, they just come straight for you.

I’ve taken the version of Tunnel Vision and made a couple of modifications to get it to run on the HoloLens. I tried it both with the poor excuse for a skybox I had as well as with a completely black background (which becomes transparent to the HoloLens). While the voice command works well, it takes it too long to understand and execute the appropriate code. Still, I’m happy with progress so far. I didn’t have to spend much time to get it into this state. As I continue to play around with different demos and try different things out, I’ll create some information about best practices and/or tips when developing for the HoloLens. The HoloLens is a mobile device and it needs to be treated like one.

I’m not at all happy with how my HoloTours-like demo is working. It is only getting about 5 fps instead of 60 fps like it should be. I’m going to try a few things but hopefully I’ll be able to show that before too long…

I’ve gotten a request to show some Young Conker. If you have a request of something you want to see leave me a comment and let me know. 

Watch the video below:

HoloLens HoloTour: A Deeper Look

image

I was working on showing a little work in progress demo of something similar to the HoloTour app, but I accidently deleted the wrong folder. I got most of my files back, but there were a couple that were corrupted. So I had to switch gears and I looked at a recent comment on one of my YouTube videos from Chitore 2009. The request was simple:

show holotour more

So that is what I’m doing. I also had a little too much fun editing the video I believe. If you are itching to see some more HoloTour, then watch the video below. 

Next week I should actually have a demo available. Make sure you subscribe to my YouTube channel if you are interested in seeing some demos as I’m creating them for the HoloLens.

Using the HoloLens Outside

I wanted to see how the HoloLens performed outside. Would I be able to see the holograms clearly or would they be washed out? Would the sunlight keep me from watching a movie outside? Could I actually play Fragments outside and would the Spatial Mapping work correctly?

Check it out in my video:

I was pleased that everything worked as I would expect. I think I’ll be watching the next conference streamed on Channel 9 from the comfort of my front porch swing.

The video being played on my front porch can be found on Channel 9 at:

https://channel9.msdn.com/Blogs/k4wdev/Media-Capture-Frames-API-and-Kinect-in-the-Windows-10-Anniversary-Update

If you are interested in game development make sure you visit devgame101.com where I discuss game development using Unity. If XNA and MonoGame are more your style, then you might like the code I updated from my XNA Game Studio 3.0 Unleashed book last month. Stay tuned to see upcoming material teaching how to develop for the HoloLens!

Received Feedback on my HoloLens Videos and Posts

So I received some feedback on the HoloLens. Watch the video to get all the juicy details. If you don’t have time to watch, that’s cool. It boils down to a little rant around the field of view bit I keep getting asked about followed by me talking about how Andy, from the HoloLens team, emailed me to ask for the source code of the little music visualizer app I created and deployed to the HoloLens.

It seems my video showing how to deploy an Unity app to the HoloLens was passed around the team with the title of

“Any guesses about why this deployed app is the worst thing ever?”

When I first saw that, I was taken back a little but that feeling quickly faded when I read the next sentence:

“Basically, that app should run great and we want to know why it isn’t.

There is a huge amount of speculation going on in the thread, and basically we just want to see the source. Can you bundle it up and mail it to me?”

Of course, I bundled up the app to the whopping 600KB it weighed in as (minus the mp3s) and sent it to Andy. I felt bad that engineers at Microsoft was taking time to look at my little demo app that I threw together sometime last year. I was happy to see them reaching out to developers though to make sure that they are able to get their apps to run on the platform.

Shortly after sending the code I received a couple of tips. The first tip was that I should change any places I used “FixedUpdate” to simply “Update”.  I updated the code to take that into account. So far, that is the only update I made to the code and you can see a dramatic difference as the blocks are actually in sync with the music now.

I’m not sure why I was using FixedUpdate in the first place but it totally makes sense why that would be a problem. FixedUpdate can be beneficial when you want to make sure this code gets called a specific number of times a second – or every X milliseconds. This can be beneficial for handling physics.

However, most of the time you want your code to call Update, which gets called every frame. Receiving input, moving non-physics objects (like my visualizer cubes), AI and many other bits can all be updated this way inside of the Update method.

Update isn’t called on a regular time interval. If one call takes longer than another then the time between update calls be different. FixedUpdate, on the other hand, is called at a fixed time. The time between update calls are consistent. So if the fixed timestep is 0.02 it means that Unity is going to try real hard to make sure each FixedUpdate call happens 50 times per second regardless what the render frame rate is. If the game or app is running slower and the frame rate drops to say 25 fps, then it will try to run FixedUpdate twice to catch up – which will just drive the frame rate lower. At some point this cycle of badness just bottoms out. This was why my little app was not running correctly on the HoloLens.

I expect I’ll have more performance tips that comes from my adventures with the HoloLens. To stay informed you could subscribe to my YouTube channel. I have other ways to stay connected in the near future.

As always, feedback is welcome. 🙂 Leave me comment and let me know what you would like to see next with the HoloLens.