Jump to content

  • Log In with Google      Sign In   
  • Create Account

Network input handling


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
124 replies to this topic

#121 hplus0603   Moderators   -  Reputation: 5342

Like
1Likes
Like

Posted 24 January 2013 - 11:57 AM

How can the client predict this locally?

You can simulate the arrow entirely locally, if it's the kind that goes away after it's done firing (a k a "bullet arrow.")
The trick is to show the results (hitpoints, particle systems, points, whatever) only after the server tells you what's happening.

how do you match up that entity with the one the server will create when it processes the player's "fire" command?

Send your temporary ID to the server. The server then includes a "creator id and creator-specific temporary id" field with the entity create command. Other players don't need this data, but if you are the creator, you match it up.
enum Bool { True, False, FileNotFound };

Sponsor:

#122 Telanor   Members   -  Reputation: 1338

Like
0Likes
Like

Posted 25 January 2013 - 02:29 AM

I think we're actually going to keep the arrows around for a while, perhaps even allowing players to pick up the arrows after they're shot as well, so it's not really a bullet arrow.

I suppose I see now how the client can send its temporary ID to the server, but it would require a bit of a rework of the current system. Right now, the high level commands (primary action, secondary action, walk forward, etc) are sent automatically to the server by the input system. There isn't a command for "fire arrow" because it depends on what your currently equipped weapon is. The system doesn't know it'll be firing an arrow until it gets further along with the input processing. I'd have to change it so that each individual system is responsible for sending out the commands after having processed the input. Which would also mean the server would have an entirely different code path for input handling. Is there a way around having to do this?

Why is it unacceptable? You either have an authoritative server on arrow-firing, or you don't.

Well I figured waiting the full round trip time + the 100ms from the dejitter buffer would be a very obvious delay on a combat-related action, which should appear to happen quickly.

Edited by Telanor, 25 January 2013 - 02:29 AM.


#123 Inferiarum   Members   -  Reputation: 733

Like
0Likes
Like

Posted 25 January 2013 - 03:24 AM

which should appear to happen quickly.

 

If you play the animation instantly it will appear to happen quickly. If you wait for the server to confirm new entities the arrow will appear mid-air which might not even be noticeable.



#124 Telanor   Members   -  Reputation: 1338

Like
1Likes
Like

Posted 25 January 2013 - 03:48 AM

If you play the animation instantly it will appear to happen quickly. If you wait for the server to confirm new entities the arrow will appear mid-air which might not even be noticeable.

Hmm, I suppose that is true. I'll give it a try and see how it works out.

#125 hplus0603   Moderators   -  Reputation: 5342

Like
1Likes
Like

Posted 25 January 2013 - 12:13 PM

Is there a way around having to do this?

Yes. You can add the new capability for subsystems to create objects, without removing the old input capability. "Created an object" is a new kind of "input" generated by the subsystems.
Then, you only use the "fired my weapon" trigger from the user input to run animations, and you use the "created an object" message from the subsystem as the thing that actually creates the object.

Another option is to go 100% deterministic, RTS-style, but if I remember correctly, the third-party engine you're using does not fully support that.
enum Bool { True, False, FileNotFound };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS