Adding GameObject rotation Update workflow

Options
2»

Comments

  • Boris
    Options
    update on this: the new version does not have a virtual Item.OnMove, OnSpawn and OnPropertiesSet anymore.
  • ktweedy1
    Options
    Where does this Move function go, which class?

    public void Move(Vector newPosition, Vector rotation, Reliability reliability)
    {
    // call base move method
    this.Move(newPosition, reliability);
    this.Rotation = rotation;
    // send event
    var eventInstance = new ItemMoved
    {
    ItemId = this.Id, ItemType = this.Type, OldPosition = this.Position, Position = newPosition, Rotation = rotation
    };
    EventData data = eventInstance.GetEventData( (byte)EventCode.ItemMoved, reliability, Settings.ItemEventChannel);
    var message = new ItemEventMessage(this, data);
    this.EventChannel.Publish(message);
    }
  • Boris
    Options
    class MmoItem
  • ktweedy1
    Options
    Maybe something is different in this new version. I get the following errors.

    this.Move(newPosition, reliability); No overload for method 'Move' takes '2' items arguments. I looks at the Item based class and it takes the ICoorrdinate parameter. Also, can we say this.Move, wouldn't that make a recursive call to the Move in the same class?

    Also,

    OldPosition = this.Position,
    Position = newPosition,
    Rotation = rotation

    these say they can't convert to type float.

    Thanks for the help, i just starting wtih Photon today and really am liking it.
  • Boris
    Options
    Yes, it's different now. You need to add the additional ICoordinate to the method.
    Also, the OnMove method that the guide wants you to remove does not exist anymore.
  • Boris
    Options
    ktweedy1 wrote:
    these say they can't convert to type float.
    the changes are that now the ICoordinate is exchanged between the clients, not the Vector class.

    So this would be better:

    OldPosition = (Coordinate)this.Coordinate,
    Position = newCoordinate,

    and.. use Coordinate for rotation instead of Vector.
  • Boris
    Options
    ktweedy1 wrote:
    i just starting wtih Photon today and really am liking it.
    That's what we like to hear :)
    Thanks.
  • ktweedy1
    Options
    I decided to change the Position to include transform.postion, transform.rotation and transform.scale and and such now passes 10 floats between the client and server each Move message. And then modified the Coordinate classes to support getting Position, Rotation and Scale.

    So my question is, what is your thoughts on passing 10 floats all the time compared to passing the 2 or 3 floats before. Will it make that much of a different on Event/Sec throughput on the server?
  • Boris
    Options
    It depends on the client bandwidth.

    - each float is 4 bytes.
    - each operation parameter has an overhead of another 2 bytes (parameter key + type).
    - each network package has another ~50 byte overhead

    10 floats are at least 92 bytes per operation, probably more if you use different parameters.
    Assumed you use 5 parameters: 100 bytes total.

    Each player sends
    10 operations/sec * 100 bytes = 1kbyte /sec
    vs before 10 operations/sec * 56 bytes = 560 bytes / sec
    upstream.

    If there are 8 other players around each player receives
    8 player * 1kbytes / sec = 8 kbyte / sec = 64 kbit/s
    vs before 8 * 560 bytes = 4.5kbyte = 35 kbit/s
    downstream.

    So this could be too much for ISDN connections (64kbit), but it should be fine for DSL (>=128kbit).
  • Boris
    Options
    ktweedy1 wrote:
    Will it make that much of a different on Event/Sec throughput on the server?
    Probably not, I'm going to test it.
  • Hi guys,

    I have followed the instructions on here:
    http://webcache.googleusercontent.com/search?q=cache:mKNIPIuqsRoJ:www.deltauni.com/files/photon/PhotonSockerServer-Add_Rotation_Tutorial.doc+GetRotation+unity+photon&cd=1&hl=en&ct=clnk

    I still get the error in Unity:
    `Photon.MmoDemo.Client.Item' does not contain a definition for `Rotation'

    Do I need re-compile any scripts and re-create dll files?

    If so what program should i used? Visual C# 2008 express throws up loads of errors
  • dreamora
    Options
    you must own a VC# Standard at least to compile solutions for Photon, express can't compile the type of service dlls required in this case, express does not allow you to do that

    if you can't compile, changes you made naturally also will never have any impact and fail
  • Boris
    Options
    The tutorial refers to an older photon version, I think it needs to be updated.
  • Hi there! Hello Exitgames Team!

    May I ask some Questions? (Advisory: Absolute beginner related questions ... )

    But let me first tell you the status of my progress and what i try to achive:
    I came the way along from Unity 3D. I stumbled across this thread while exploring the "src\Photon.MmoDemo.Client.UnityIsland" in the "ExitGames-Photon-MMO-Demo_v2-0-5-1.zip". While messing with the C# files I recognized that the rotation isn't synchronized. In fact, no rotation information is sent to the server or back to the clients.

    While reading and learning from this and other threads more and more questions came up and I hope someone could answer these:
      1.) Is the Folder "src\Photon.MmoDemo.Server" in the "ExitGames-Photon-MMO-Demo_v2-0-5-1.zip" the source files for the photon server used for in the "src\Photon.MmoDemo.Client.UnityIsland" demo (if compiled)? 2.) If I compile the Solution for "src\Photon.MmoDemo.Server" with my IDE and copy the files in the new generated "bin" folder into "deploy\bin_Win64" of the "ExitGames-Photon-Server-SDK_v2-0-5-1.zip" and a restart of the Photon Application via Control Center, is that the rigth workflow? 3.) In Unity I have the folder "photon/libs" with 3x *.dll, where do those come from? Do i need them and if yes, how do I make or extend them? 4.) What are the other Folders in "ExitGames-Photon-MMO-Demo_v2-0-5-1.zip" src/ made for ? (for Example "src\Photon.MmoDemo.Client.DotNet", "src\Photon.MmoDemo.Client.Unity3D", "src\Photon.MmoDemo.Common" etc.) 5.) The PDF-Docu in "ExitGames-Photon-Server-SDK_v2-0-5-1.zip" for example "photon-blank-client-setup.pdf" or "photon-blank-server-setup.pdf", both relate on .NET. What do I have to know about .NET? Is it necessary for a Photon Server? (If I'm honest: I couldn't succeed in both of the Tutorials ... but that will be topic of another thread later. I'll give it another try first!) *** Edit: succeed in both:
    http://forum.exitgames.com/viewtopic.php?f=5&t=157, but still some questions left...

    6.) Since most of the code examples in this thread depend on older builds, how do I implement the rotation properties in MmoDemo 2.5.0.1? Would someone mind to explain the steps and name the files one by one and step by step?


    As I said, alot of questions ... most of them beginner related and english is'nt my foreign language ... I hope this doesn't bother someone.
    There will be more soon :)


    Thanks for reading, and more thanks for every helping answer!
  • Tobias
    Options
    I think in this case, you could have opened your own topic, but of course you get some answers:
    bloodthief wrote:
    1.) Is the Folder "src\Photon.MmoDemo.Server" in the "ExitGames-Photon-MMO-Demo_v2-0-5-1.zip" the source files for the photon server used for in the "src\Photon.MmoDemo.Client.UnityIsland" demo (if compiled)?
    Yep.
    bloodthief wrote:
    2.) If I compile the Solution for "src\Photon.MmoDemo.Server" with my IDE and copy the files in the new generated "bin" folder into "deploy\bin_Win64" of the "ExitGames-Photon-Server-SDK_v2-0-5-1.zip" and a restart of the Photon Application via Control Center, is that the rigth workflow?
    You need to copy the binary stuff into deploy/NetSync/bin/**. I think you quoted this also from the readme. The bin_* folders are for Photon Core binaries. The Lite and NetSync folder (as example) are for applications that run in Photon.
    bloodthief wrote:
    3.) In Unity I have the folder "photon/libs" with 3x *.dll, where do those come from? Do i need them and if yes, how do I make or extend them?
    These are the Photon Client libraries. They are used by the samples and provide the client side API. There is no source for them but you can extend the classes (LitePeer or PhotonPeer especially).
    bloodthief wrote:
    4.) What are the other Folders in "ExitGames-Photon-MMO-Demo_v2-0-5-1.zip" src/ made for ? (for Example "src\Photon.MmoDemo.Client.DotNet", "src\Photon.MmoDemo.Client.Unity3D", "src\Photon.MmoDemo.Common" etc.)
    Those are for the separate projects that are used for the server and client demos. The "src\Photon.MmoDemo.Client.DotNet" is a sample that uses "src\Photon.MmoDemo.Common". The folder "src\Photon.MmoDemo.Client.Unity3D" is a project folder for the Unity3D demo sources (it's easier to program in an IDE than in Unity's editor).
    bloodthief wrote:
    5.) The PDF-Docu in "ExitGames-Photon-Server-SDK_v2-0-5-1.zip" for example "photon-blank-client-setup.pdf" or "photon-blank-server-setup.pdf", both relate on .NET. What do I have to know about .NET? Is it necessary for a Photon Server? (If I'm honest: I couldn't succeed in both of the Tutorials ... but that will be topic of another thread later. I'll give it another try first!)
    *** Edit: succeed in both: http://forum.exitgames.com/viewtopic.php?f=5&t=157, but still some questions left...
    Feel free to ask :)
    bloodthief wrote:
    6.) Since most of the code examples in this thread depend on older builds, how do I implement the rotation properties in MmoDemo 2.5.0.1? Would someone mind to explain the steps and name the files one by one and step by step?
    We will update the MMO Demo (and server SDK) soon and release them with latest client code. But adding rotation won't be part of the next release. I assume you can derive how it's done when you follow the discussion in this thread.

    It should not be too difficult to add rotation. In the end, you will have to modify the code a lot more to fit your game. Photon is not (yet) a out-of-the-box solution for MMOs or RTSs. There are too many, too different requirements to fulfill for different games and we think it makes sense to provide a solid base on which you can go on and develop depending on your game's needs.
  • Hi Tobias!
    I think in this case, you could have opened your own topic, but of course you get some answers:
    I agree! Thought the same, but it was already published at that moment ... but feel free to move it, if u like!

    Thanks alot for answering 1-6! It's much clearer to me now! Thank you!

    Nice to read that an updated mmo.demo version comes soon :) what can we expect from it? any new features?
    Photon is not (yet) a out-of-the-box solution for MMOs or RTSs.

    True, that is what somebody could expect from reading "mmo", especially beginners like me. But that was clear to me fast and now I'm trying to understand the logic behind the photon server/client communication und it's api and I see I will have to study and learn alot more. I feel like a baby that tries to walk for the very first time :) at least some basics are clear to me know, but i guess thats 0.01% of the matter.
    It should not be too difficult to add rotation.
    I got confused at the point that positions got replaced by "Coordinates" ... will give it another try later.

    Yesterday, I made a step backward and tried to understand the Lite package and the Realtime-Demo, as it was stated as the best point to start for beginners. I tried to implement the rotation there, but ended up with some strange results between 220 and 360 degree rotation ... maybe i can show it in a webplayer soon, but atm I got stuck with crossdomain.xml policy crap *grr :)

    I think I'll start from scratch again and try to build something lika a chat window first. I guess that would be a good start, or? Connect to server and broadcast a message. Can i use Lite for that without having to build a extended solution?
  • Boris
    Options
    yes, Lite would be the fitting solution.