Announcement

Collapse
No announcement yet.

The right way to network input events?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    The right way to network input events?

    So, with a little reading, and some trial and error - I have come up with this:

    Click image for larger version

Name:	netevent.png
Views:	1
Size:	128.7 KB
ID:	1223977

    pre network, it was just the input action "use" connected to "dismount"

    post network:

    on button press:
    -if server, do action and broadcast
    -if client request action

    on request:
    (server only) do action and broadcast

    on broadcast:
    do action

    This seems correct, and works, but it feels like it could be improved on, is there a way perhaps to network replicate events "behind the scenes" or a smarter way of going about things?
    See my PortalsBP on the marketplace
    Currently working on Wheelz2 and Zario

    #2
    I usually set up a lot of my server-client relationships like this:
    Click image for larger version

Name:	Sit1.JPG
Views:	1
Size:	279.7 KB
ID:	1129813Click image for larger version

Name:	Sit2.JPG
Views:	1
Size:	228.2 KB
ID:	1129814

    I do this because it helps a lot with client-side gameplay if you set yourself locally before asking the server to multicast what you've set. If you do not do so, you'll have to wait for the round-trip of going to the server and back before you finally set the state on your local machine. I've created several gameplay mechanics that all did not do this at first, and the result was jitter, lag, teleporting issues, irreponsiveness, etc. This made a phenomenal improvement on my client-side gameplay for a multiplayer game.

    A good way to test your client-side performance is to run the editor as a client with 'net pktlag=150' or so, to simulate a fairly laggy client connection. If you don't do it like this, you'll definitely feel it.

    Comment


      #3
      Originally posted by Alex Chozabu P-B View Post
      So, with a little reading, and some trial and error - I have come up with this:

      [ATTACH=CONFIG]145227[/ATTACH]

      pre network, it was just the input action "use" connected to "dismount"

      post network:

      on button press:
      -if server, do action and broadcast
      -if client request action

      on request:
      (server only) do action and broadcast

      on broadcast:
      do action

      This seems correct, and works, but it feels like it could be improved on, is there a way perhaps to network replicate events "behind the scenes" or a smarter way of going about things?
      I think it's the right way, man. I like this

      Comment

      Working...
      X