TransformView setting suggestions for VR game

Options
Hi there,
I'm transferring my VR game from Unet to Photon and would love to get some suggestions on how to best setup the transformView component and PhotonView on 2 objects in my game.

The game is about building a base out of blocks and throwing snowballs:
https://www.youtube.com/watch?v=Wr0ZOl_KuHM

Blocks:
There are around 30-50 blocks per game (20ish per player). Blocks can be moved and stacked together to assemble a base, most of the time players will be moving 1-2 blocks at a time (one in each hand). Blocks have rigidbodies with gravity and colliders. It's important that the block positions and rotations are accurate as players often meticulously build their bases. I've noticed with the default transformView settings that sometimes blocks will move around on their own on the remote client even though they are completely still on the local player who owns the blocks. Each player is the owner of their blocks' photonView.

Snowballs:
These are spawned and throw by players, they can throw 2 at a time (one in each hand). The snowballs can bounce off of objects so I think they need to be synced instead of just fired like a bullet as their exact movement can change if they bounce off an object (block) that is not yet synced to the correct position. In the single player game, the snowballs will damage blocks and can also move blocks with physics if they have enough force.

-JJ

Comments

  • jeanfabre
    Options
    Hi,

    block drifting seems odd. I would say it's very likely a setup, can you explain your view setup?

    I would instead go for a manager of blocks, and use rpc to dispatch users block positioning, I don't think you are interested in the fiddling of moving blocks, but actually the final position of blocks when released from editing by the player, so for this, go for simple RPC, it will save a lot of bandwidth instead of havce each block networked.


    Bye,

    Jean
  • capitalj
    Options
    I am just using the default transformview settings, but have also tried "synchronize values" on position and also tried adding a rigidbodyview, but the movement is always either jerky or the blocks just jump around and move by themselves. Even if someone is holding a block at their head height, the remote view of the block will show it bouncing around near the ground. It's as if the rigidbody/gravity of the remote block is fighting against the position updates coming over the network.

    We do want to show the building process, we want the players to be able to see the other player building their fort because not only does that happen at the start but also throughout the match, players can continuously rebuild and fix up their fort, or hold up a block to use as a shield to protect themselves.

    Maybe we could start with some suggestions on how you would setup the transform view and rigidbody view if you were doing it? I couldn't find any explanation of the various syncing modes so any advice you could offer that could give us a good starting point based on your experience with these components would be greatly appreciated.
  • capitalj
    Options
    Anyone have any suggestions how to setup the transform view? It would be great to have a starting point.
  • Spaggi
    Options
    Hi capitalj,

    not sure if you have been able to find a solution already, but I'll try anyway.

    First, I'm a Hobby VR developer myself using PUN to sync objects which can be thrown around in my game. I've been able to setup a kind-of-working solution using PhotonTransformView. I'm of course very eager to exchange knowledge / findings on this Topic, so if you're interested we can also get together on Skype anytime.

    You haven't specified a lot of details, so I'll just share my 2 cents:

    1) Jumping blocks: I could imagine this is due to gravity with the local rigidbody. What I did is that on release of a throwable object of whatever kind, I disable gravity and make the object kinematic. So handling of the transform is fully done on the Owner side, just transfering the position to the other player

    2) Player forts and Balls hitting them: How to do this depends really on one question: Is there any physical Impact on the block or not apart from it being destroyed?

    Just destroying the block (or removing "health") could easily be done via an RPC

    What is more complex, and an issue I still struggle with in my game is what happens if the block should be physically moved due to the ball Impact. The issue here is that the block is owned by the other client, which means the ownership has to be transferred at some point in order to allow the Unity physics calculations. I've been experimenting with different approaches but have not been able to find a vialable solution.
  • capitalj
    Options
    Awesome, thank you for the help and advice. I'll add you on Skype, I'd love to ask some quick questions if you already have experience with this. I'll be working on this stuff again in a few days.
  • dyawitz
    Options
    Hi capitalj - would you mind sharing how you ended up solving this issue? I am trying to do something similar for a multiplayer game that involves throwing and destroying objects. I'm struggling with these same questions of which objects should be networked or not, how to manage projectiles and destructibles with PhotonViews or local instances, etc. Any details about your final solution would be helpful. Thanks.