TSRigidbody2d and TrueSyncManager script

Hello,
We are using your True Sync sdk for multiplayer game.

1. Any plan to include,Some features and functions like Freeze Positions,Rigidbody2D.Sleep,IsSleeping,etc like Unity's Rigidbody2D.
2. In TSRigidbody2d,Mass and drag values are different based on unity's Rigidbdy2d.(Add force also different)
3. For basic object animations like moving/rotation performed by iTween and other plugin,please give me any suggestion for this types of animation performed in True Sync Sdk.
4. In my game,Two players game and each have different team with 8 players so,I remove initBehaviors method and add new method for add 2 team prefabs spawns and assigned behaviours properly and work perfect in first game,but my problem is how to reset all players prefabs data in TrueSyncManager script after game complete.

Thank you

Comments

  • Hello @UnityGames,

    1. Yes we plan to do so, our idea is to have a similar (when possible) API as Unity.
    2. Thanks, we will check this.
    3. In TrueSync you can access some properties like moving and rotate by the TSTransform component (for 3D objects). Do you have some specific action that TrueSync doesn't perform or you don't know how to do it in TS?
    4. Nice, can you talk more about which data you are having trouble to reset?
  • UnityGames
    edited December 2016
    Hello @JeffersonHenrique

    Basic Idea about my game:
    1. Two players game(each have 8 spawn object team wise).
    2. First player(Which have turn),select own multiple spawn objects.
    3. Puck passed to selected spawn objects and at last object hit the puck.(for eg: player choose 4th,3rd,2nd,5th spawn objects,so,puck passed first 4th -> 3rd -> 2nd -> 5th and at last hit the puck using force.)

    -> Before True sync,i am using iTween for passing puck to selected spawn objects and add force to hit the puck

    For 3rd point,
    How to manage passing puck one object to another object and display in both the players(mirror effect and moving object).

    For 4th point,
    Different types of team available in game so,each game i have to spawn multiple objects of both the players and assigned behaviours.
    At this time,TrueSyncManager spawn before the game start and destroy after game complete for manage lockstep,schedular and other properties.if any method available which reset all lockstep,schedular and player properties and etc. so,directly assigned new players and start the game without spawn and destroy TrueSyncManager.

    Also please give me more detailed about how to manage sync window,rollback window and panic window because some time game running smoothly and some time jerky.

    Thank you




  • Hello @JeffersonHenrique

    Please give me some feedback above points..
    Thank you
  • Hello @UnityGames,

    For 3rd point,
    You can pass the order information as an input and then you can start some animation by iTween and count the proper time in your TrueSyncBehaviour, so when you reach the animation total time you can position the puck at the last object and apply some force. You can also lerp the position of the puck on OnSyncedUpdate, passing through each object.

    For 4th point,
    You can place each team before TrueSyncManager start and to pre-assign their players you change the "ownerIndex" property of TrueSyncBehaviour component. If you want an object to be owned by the first player you put the value "0" and if you want it to be owned by the second player you put value "1". Did it work for you?

    Clarifications,
    Sync Window works as an input delay as you probably noticed, it gives a protection against lag. But to avoid a lot of lag you can use a rollback window, to allow an extra protection buffer, which gives also an overhead because when you have rollbacks enabled more than one frame can be simulated each tick. And panic window means how many frames the game engine will wait for a player's input before drop him. If your game is more strategic you can reduce the number of rollbacks (or even set to 0) and increase the sync window.
  • Hello @JeffersonHenrique ,
    For 3rd point give me some snippet code for movement.i am trying to pass input info and pass object but no luck.object not move in opponent device.
  • Hi,

    You can access the puck's TSRigidBody component and set a new position like "tsRigidBody.position = newPosition" and this for this new position you can use "TSVector.Lerp".
  • Hi there ,

    1) We have checked this but this solution wont be helpful for me , if i will use TSVector.lerp it will be possible at player side , but i am not able to mirror this effect at opposite side ,(opponent side )

    2) we have issues with truesync manager , when game is finished , what i need to do is delete all the properties and create new one , is there any way i can reset all the properties , can you update the API , this is the one of the most crucial thing right now for my game , and it will really help us to increase the performance ,

    3) Some time Object moving different in both players (Mirror Effect or actual effect) , whenever i apply force or any other physics to objects , it has different effects to both the players , playing and opposite ,

    This are the most important features we would like to have with photon , in order to finish my game , your help in fixing this and adding this new feature will be highly appreciated , and i am expecting quick response as well , also can you tell me your availability as well so i can message you in that time duration for more quicker chats, :)

    Kind Regards
  • Hello,

    1) It should be fine update position and it be equals in both sides, maybe we can take a look at your code to figure out what is happening.

    2) We have a task for the next release (1.0.8) to include some clean up procedure.

    3) This means the game is not perfect in-sync, it can be due to some unknown bug in TrueSync or some mistake on your side about deterministic code.

    You could send a direct message to me or @erickpassos, if you could share some part of the project would help us to understand those issues you mentioned.