Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Hologram Sharing (Holograms 240 tutorial) inconsistent/2 player functionality/limitations?

I have a two part question-
1. I followed the Holograms 240 tutorial precisely through chapter three as I wanted to get hologram sharing working in order to build a 2 player Hololens game. In order to get the energy hub to be placed and have the animation start upon the first player's air tap, I had to edit code in Gaze Manager script from:

focusedObject.SendMessageUpwards("OnSelect");

to

focusedObject.GetComponentInParent().SendMessage("OnSelect");

upon recognizing an air tap, because I realized that the "focusedObject" was coming up as the "base" or "leg" or some other component of the EnergyHub. The Hologram Placement script, which includes the OnSelect() method that is attempting to be called above, is attached the EnergyHub game object and not its children, such as the base, and leg. Therefore the original line wasn't working because the base had no Hologram Placement script, so the OnSelect method had no receiver, so nothing happened upon air tapping when attempting to place the hub. I am curious why I had to edit this code in order for it to work- it makes me thing there is something wrong with how I set up my program, but I followed the tutorial's instructions.

After I changed the code, I was able to successfully place the energy hub, but when I opened the app on my second hololens, even after successfully connecting to the server on the correct port (I could see both IP addresses added on the Sharing Service window), the hub was not always located in the same spot as where I placed it on the first hololens. It works occasionally, but most of the time they seem to be a few feet apart and some of the time the hub actually moves even after it's initially set. Why is this? Is there any way to fix this issue? It's very inconsistent.

  1. I understand that using the hologram sharing, 2 users are supposed to be able to see the same hologram in the same location but I'm curious if they can view an entire game happening, locked into world space, in live time. For example, is the animation on the energy hub synced and happening at the exact same time for both users when it is shared? Or are the animations playing individually, and just the location of the hub is what is shared. If the later is true, is there anyway to have a game occur and have both users see what is going on in live time?

Best Answer

  • ahillierahillier mod
    edited September 2016 Answer ✓

    @SashaFC,
    We run this class regularly, and have never had to modify the GazeManager to get it to work. By calling SendMessageUpwards, we notify the focused gameObject and all of its ancestors (which includes the parent EnergyHub that you assigned the 'HologramPlacement' script to) that the air tap gesture was detected. Anything along this child->parent chain which has an 'OnSelect' method, will respond to the event. In Chapter 3, the only object with an 'OnSelect' method is the EnergyHub, so it will respond on behalf of all of its children (no matter which one has focus).

    When you first deploy Chapter 3, there will be a period of time where you are not allowed to place the EnergyHub. This is while the anchor is first being established and uploaded to the service. It can take ~30-60 seconds before the app will respond to your air tap and allow you to place the EnergyHub. This might be what led you to think that the GazeManager's code was not working. As long as you don't reset the service between deploys, you will not have to re-establish the anchor again, so you should only hit this once during the course.

    In order for two or more devices to see the EnergyHub at the same location, they need to have a similar understanding of the environment. We recommend scanning as much of the room as possible with each device before placing the EnergyHub, and then designating one device as the primary, which will be the first device used for setting the anchor and positioning the EnergyHub in the world. After the EnergyHub is placed, the other devices may join the session (they should not join until after the first device is done establishing an anchor or else there is a chance that they'll create their own anchor and be in a separate session). If all devices are in the same session together, but the EnergyHub still does not appear to be in the same location, then you should walk around with the secondary devices and make sure that they can see the room from the same perspective as the primary device. Again, this is so that all devices have a similar understanding of the room, because we are not sharing the spatial mapping data between devices. You should see the EnergyHub jump to the correct location. If walking around does not help, then you need to exit the application on the errant device and rejoin the session, as that HoloLens was probably using its own anchor. Once all devices are in-sync, you'll want to leave the sharing service running so that you don't have to go through this process again with the subsequent deploys. Getting all HoloLens devices to agree on where the anchor and EnergyHub are located, is the most difficult part of this course.

    To keep animations, etc. in-sync, we send CustomMessages between all HoloLens devices. If one user spawns a projectile, then we alert all other players in the session that a projectile was spawned, and tell each device where to spawn the projectile in reference to the shared anchor. Each device is rendering its own set of gameObjects, but because they receive the custom message at approximately the same time, it appears as if everyone is viewing the same set of holograms. We do something similar during the final chapter to explode the EnergyHub. As soon as one person triggers the explosion, all HoloLens devices are told to explode their version of the EnergyHub so that the Underworld will appear at the same time for everyone. While we don't bother keeping the Underworld drones in-sync for each user, you could do this by adding new CustomMessages to keep drones spawning, moving, and exploding at the same time.

    I hope this helps,
    ~Angela

Answers

  • ahillierahillier mod
    edited September 2016 Answer ✓

    @SashaFC,
    We run this class regularly, and have never had to modify the GazeManager to get it to work. By calling SendMessageUpwards, we notify the focused gameObject and all of its ancestors (which includes the parent EnergyHub that you assigned the 'HologramPlacement' script to) that the air tap gesture was detected. Anything along this child->parent chain which has an 'OnSelect' method, will respond to the event. In Chapter 3, the only object with an 'OnSelect' method is the EnergyHub, so it will respond on behalf of all of its children (no matter which one has focus).

    When you first deploy Chapter 3, there will be a period of time where you are not allowed to place the EnergyHub. This is while the anchor is first being established and uploaded to the service. It can take ~30-60 seconds before the app will respond to your air tap and allow you to place the EnergyHub. This might be what led you to think that the GazeManager's code was not working. As long as you don't reset the service between deploys, you will not have to re-establish the anchor again, so you should only hit this once during the course.

    In order for two or more devices to see the EnergyHub at the same location, they need to have a similar understanding of the environment. We recommend scanning as much of the room as possible with each device before placing the EnergyHub, and then designating one device as the primary, which will be the first device used for setting the anchor and positioning the EnergyHub in the world. After the EnergyHub is placed, the other devices may join the session (they should not join until after the first device is done establishing an anchor or else there is a chance that they'll create their own anchor and be in a separate session). If all devices are in the same session together, but the EnergyHub still does not appear to be in the same location, then you should walk around with the secondary devices and make sure that they can see the room from the same perspective as the primary device. Again, this is so that all devices have a similar understanding of the room, because we are not sharing the spatial mapping data between devices. You should see the EnergyHub jump to the correct location. If walking around does not help, then you need to exit the application on the errant device and rejoin the session, as that HoloLens was probably using its own anchor. Once all devices are in-sync, you'll want to leave the sharing service running so that you don't have to go through this process again with the subsequent deploys. Getting all HoloLens devices to agree on where the anchor and EnergyHub are located, is the most difficult part of this course.

    To keep animations, etc. in-sync, we send CustomMessages between all HoloLens devices. If one user spawns a projectile, then we alert all other players in the session that a projectile was spawned, and tell each device where to spawn the projectile in reference to the shared anchor. Each device is rendering its own set of gameObjects, but because they receive the custom message at approximately the same time, it appears as if everyone is viewing the same set of holograms. We do something similar during the final chapter to explode the EnergyHub. As soon as one person triggers the explosion, all HoloLens devices are told to explode their version of the EnergyHub so that the Underworld will appear at the same time for everyone. While we don't bother keeping the Underworld drones in-sync for each user, you could do this by adding new CustomMessages to keep drones spawning, moving, and exploding at the same time.

    I hope this helps,
    ~Angela

  • Thanks for your detailed and helpful response!

  • @ahillier
    This is a fantastic explanation. I suggest to copy this brilliant practical instruction to Chapter 3 of Hologram 240. Otherwise at least provide a link from Hologram 240/Chapter 3 to this section.

  • @ahillier said:
    @SashaFC,
    We run this class regularly, and have never had to modify the GazeManager to get it to work. By calling SendMessageUpwards, we notify the focused gameObject and all of its ancestors (which includes the parent EnergyHub that you assigned the 'HologramPlacement' script to) that the air tap gesture was detected...

    I really don't understand this. Where is it you are calling SendMessageUpwards()? I cannot seem to find that method call even when searching the entire Holograms 240 project.

  • ahillierahillier mod
    edited November 2016

    Hello @AHaahr,
    Sorry for the confusion! We actually call SendMessage() in Holograms 240 in the GestureManager.cs script when a tap gesture is detected. However, in AppStateManager.cs, we override the focused gameObject, so that no matter what the user is looking at, the EnergyHub will respond to tap events when we want it to:

    GestureManager.Instance.OverrideFocusedObject = HologramPlacement.Instance.gameObject;

    At the beginning of chapter 3, the EnergyHub (which is the gameObject with the 'HologramPlacement' script attached) will be treated as the focused object until it is placed, and then it will no longer respond to tap events until we use the 'Reset Target' keyword to pick it up again in a later chapter (which changes our App state and overrides the focused object to be the EnergyHub again).

    In Holograms 101, we moved the entire OrigamiCollection by using SendMessageUpdwards() in the GazeGestureManager script when the notepad was tapped. We could have used a similar approach in Holograms 240, but decided to control which object would have focus during various app states. There are numerous ways to go about this, and we have used several throughout our Academy courses!

  • Hi,

    I was able to run Chapter 3 - Shared Coordinates from Holograms240 on Hologram emulator, but It was impossible on the real device. I didn't event get info on the SharingServer that I was connected with it. Could You please tell me, what is wrong?

  • If you manage to set up the sharing, but the positions are out of sync try this:
    Problems can arise when the room scans of the Hololenses aren't "the same", so make sure to scan the room well on both. Dev Portal -> 3D View -> click "update" under "Surface reconstruction" to see the room scan.
    Or these steps if it's still not in sync:
    1) Settings -> system -> spaces -> Shamelessly deleted all Spaces. 2) Settings -> System -> Utilities -> Calibration. 3) Settings -> System -> Utilities -> Tune Sensors. 4) Run app 5) Profit 6) ???

  • Does anyone tried to have two EnergyHub objects under the HologramCollection?

Sign In or Register to comment.