playMaker

Author Topic: Questions: Unet Behaviour Proxy  (Read 3292 times)

Pivetta

  • Playmaker Newbie
  • *
  • Posts: 16
Questions: Unet Behaviour Proxy
« on: November 08, 2016, 03:26:59 PM »
Hi,
I know I have actually not to use this stuff, but I'm trying to. I managed to get the most done, but now I came to the commands and rpc events part.
As I putted the actions in nothing happened, then I noticed I had to connect that behavior.
I have a really complex hierarchy running, but the events are shot from the root object.

I don't get the script, how is it supposed to work?
What have I to put in the FSM field?
(I can only put assets, so I pushed in my player asset)
On the network channel I put channel 0 as it is the one for events and communications, channel 1 (was default) uses to be for transforms as I read in the documentation (at least from the standard network manager settings).
I write cause I have an issue and I assume it's a bug, when I use the script as described I don't even get the IsLocalPlayer action to work, so the player spawns but not for my host (neither for other clients).

May I ask you a brief and short documentation on what the workflow or workflow concept is, how have I to use the script properly? I have a programmer helping me on networking, if It's not impossible and doesn't gets in the core of PM he may also help me run the machine!

Best regards,
Pivetta

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Questions: Unet Behaviour Proxy
« Reply #1 on: November 09, 2016, 02:27:23 AM »
Hi,

 The meteoroid demo is almost there, so you'll be able to have a sample to study soon.

I think you have two distinct problems, spawning and sending events


Spawning:

-- usually I strongly recommand when you begin to let the lobbyManager spawn your player instances

-- if you want to spawn manually, it can only be done on the server. I think you are trying to spawn from client and that will never work.

Events:

Commands go from client to server
RPC goes from server to client,

So your client sends a command to the Server, that in turns sends rpc back to client if required. it's a two step procedure unlike Photon for example.

 your biggest hurdle here is to get acquainted with the network structure, it's centralized with a server that could be a client as well, if you are testing locally with a published app, while normally you should run a dedicated server on the cloud, where server and clients don't get mixed up within the same running application.

 So before trying to work with Unity Networking, I strongly suggest you absord the documentation for it, which is very difficult. I have to say that I have myself still some issues with fully understanding the various procedures and requirements for everything to work properly even with the actual demo working and the scripts available...

 If you are new to networking, I strongly suggest using Photon instead, it's has a much easier learning curve and behaves more naturally towards how we think and want to interact with the various networked players.

So, while I am finishing off the Playmaker demo, please read the Unity doc so that when the demo will be there we'll be able to go in details about the various design patterns and technics to be used with Unity networking.

also, you should start with a simple project, it's going to be very frustrating for you if you start with a complex existing project and try to turn it in a network game, I don't recommend this.

 Bye,

 Jean




Pivetta

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Questions: Unet Behaviour Proxy
« Reply #2 on: November 09, 2016, 04:52:09 AM »
Thank you jean, I actually understood pretty much of the unet logic and followed the basic tutorial with the scripts too, I just didn't get where the "just behavior proxy" from  your package has to fit in, but ok, I will wait the demo. (The game is really complex but the network part shares something like 5 objects, It should be a good break even).
Thanks!
Pivetta

Pivetta

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Questions: Unet Behaviour Proxy
« Reply #3 on: November 09, 2016, 05:48:14 AM »
Btw, you have plans on when you are releasing the demo? (1 week, 2 weeks, 1 month?) I have to do production management
Thanks
Pivetta

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Questions: Unet Behaviour Proxy
« Reply #4 on: November 11, 2016, 01:36:00 AM »
Hi,

 I don't have an ETA for the Demo release, sorry :)

 however, you can check out the github rep it's all publicly available for cloning

https://github.com/jeanfabre/PlayMaker--UnityLearn--Network-Game-Lobby-beta-uNet_U5_3

Let me know if you need help cloning, it's using submodules, and it's not usual for regular github reps.


Bye,

 Jean

Pivetta

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Questions: Unet Behaviour Proxy
« Reply #5 on: November 11, 2016, 03:21:08 PM »
This is awesome, I managed to clone the git. The Lobby interface is great, I am going to hide it and reference the buttons, that is the shortest way around for me and is still a good debug weapon!

Btw, I get a few errors, minor stuff (NetworkBehaviourProxy gives errors on the Camera settings when placing the interface, I am using google cardboard vr, that may be the reason).
Another error I commented out and everything was working fine then was on row 333 of LobbyManager.cs regarding _lobbyhook, didn't understood your black magic there...

Network Behaviour Proxy Is telling me in the debug that the events are being sent, but the fsm doesn't update to it (both objects have the proxy on them, Observing themselves), I really hope to get it to run!

Thanks a lot!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Questions: Unet Behaviour Proxy
« Reply #6 on: November 14, 2016, 12:50:25 AM »
Hi,

 yeah, go with very careful step by step here, if you mic too much stuff in one project, you'll have trouble finding where it goes wrong ( vr +unet + PlayMaker)

proxy: likely you are getting mixed up with the network context ( server, client, authoritative, and Command vs RPC events..)

a command is send from a client to the server
a Rpc is sent from server to client


Bye,

 Jean