Potential bug with sending floats as command results

Options
Wizzard
Wizzard
edited September 2015 in Photon Bolt
I've come across an annoying bug(?) with floats not replicating from server to client when they're command results.
I'll outline how to replicate the issue in the current bolt_sample of Bolt v0.4.3.5.

First, add the following to the PlayerCommand asset and compile the assembly.


Now open the PlayerController script for the bolt_sample and add the following to the variables at the top.


We'd like to be able to edit this variable in the server at any given time, so add the following to the Update function.


Finally, we'll modify the ExecuteCommand method to contain code for replicating the field.


Upon testing and checking the log thoroughly, you'll notice that the client never receives updates on the float.
I am attempting to do something similar in my project to replicate the current movement speed of the player.
Am I doing something wrong? Is this not a valid thing to do? Is this a bug?
Please let me know so I may move forward!

Comments

  • I'm not able to see any of your images
  • Wizzard
    Wizzard
    edited September 2015
    Options
    I can't see them in Internet Explorer, but I can in Chrome. Also, the forum looks different in IE.
    Let me try again - and this time without using long Dropbox links.

    ----------

    First, add the following to the PlayerCommand asset and compile the assembly.


    Now open the PlayerController script for the bolt_sample and add the following to the variables at the top.


    We'd like to be able to edit this variable in the server at any given time, so add the following to Update.


    Finally, we'll modify the ExecuteCommand method to contain code for replicating the field.


    Upon testing and checking the log thoroughly, you'll notice that the client never receives updates on the float.
    I am attempting to do something similar in my project to replicate the current movement speed of the player.
    Am I doing something wrong? Is this not a valid thing to do? Is this a bug?
    Please let me know so I may move forward!

  • ddd
    Options
    Try

    cmd.Result.TestFloat = cmd.Input.TestFloat
  • Wizzard
    Options
    There is no corresponding input for the result (similar to isGrounded)
  • ddd
    Options
    Actually second look at your code. It's all wrong for what your trying to do. First, You only pollkeys on the entity controller. If you want the controller to send TestFloat you need to make an Input. Sounds like what you want to do is create state property TestFloat and have server logic assign it. ex: state.TestFloat = 15f;
  • Wizzard
    Wizzard
    edited September 2015
    Options
    I'm polling keys there to be able to change the value of TestFloat on the client or server. It is not a realistic scenario. You're exactly right on how I can avoid the issue i.e. by using a state. However, "TestFloat" in my project will affect movement and I feel that it should be sent as a part of corrections on prediction (since it is predicted in my project).