Multiplayer

GreedyVox

Active member
Currently in the process of creating a authoritative server multi-player version for our game YAARRGH! I have a couple of questions with the current version of Ultimate Character Controller 2.0 and the multi-player version currently under development.

I am creating network packets to be sent to the server from a client and these packets will contain user commands, mask int for user button and some floats for the mouse axis.

Is there any feature of the Ultimate Character Controller 2.0 such as a interface, property or event to sync commands too?
Or if not, will there be something like this in the multi-player version?
 
After we release version 2.0 and the agility pack we'll be starting on the multiplayer addon. The goal is to develop an abstract networking layer so it's fairly easy to add any networking implementation. You can actually see the start of this if you search for NETWORKING within the codebase.
 
@GreedyVox, we integrated UCC with our existing authoritative multi player server, which uses Snapshots, Client Prediction, etc, etc. It would have been easier if UCC used the concept of input/user commands (like the KCC does, for instance). To solve the issue of feeding user commands to UCC Characters, we replaced UCC's PlayerInput with a custom PlayerInput Component, that uses the user commands sent from the clients to control the UCC Characters on the server. It's not pretty but it worked out fairly well.
 
@GreedyVox, we integrated UCC with our existing authoritative multi player server, which uses Snapshots, Client Prediction, etc, etc. It would have been easier if UCC used the concept of input/user commands (like the KCC does, for instance). To solve the issue of feeding user commands to UCC Characters, we replaced UCC's PlayerInput with a custom PlayerInput Component, that uses the user commands sent from the clients to control the UCC Characters on the server. It's not pretty but it worked out fairly well.

Thank you sir, good idea in extending the PlayerInput class until Justin releases the multi-player add-on, just had a look around at the code, I could use the RawLookVector for mouse axis, but will have to dig deeper to workout a solution for input keys, I have some time to play around cause implementing ECS with network code and its all experimental, but its working pretty good though!
 
Thank you sir, good idea in extending the PlayerInput class until Justin releases the multi-player add-on, just had a look around at the code, I could use the RawLookVector for mouse axis, but will have to dig deeper to workout a solution for input keys,

Our UserCommand has a bool for each of the main commands (each one takes 1 bit when serialized):
C#:
public bool Fire1;
public bool Fire2;
public bool Jump;
public bool Sprint;

private const string jumpInputName = "Jump";
private const string sprintInputName = "Change Speeds";
private const string primaryFireInputName = "Fire1";
private const string secondaryFireInputName = "Fire2";

And then we have something like this:
C#:
if (name == UserCommand.jumpInputName)
{
   return this.Jump;
}
else if (name == UserCommand.sprintInputName)
{
   return this.Sprint;
}
else if (name == UserCommand.primaryFireInputName)
{
   return this.Fire1;
}
else if (name == UserCommand.secondaryFireInputName)
{
   return this.Fire2;
}

Basically UCC doesn't know that the input is driven from a UserCommand sent from a remote client. All UCC's abilities still use the PlayerInput.. so it's transparent.
 
Our UserCommand has a bool for each of the main commands (each one takes 1 bit when serialized):
C#:
public bool Fire1;
public bool Fire2;
public bool Jump;
public bool Sprint;

private const string jumpInputName = "Jump";
private const string sprintInputName = "Change Speeds";
private const string primaryFireInputName = "Fire1";
private const string secondaryFireInputName = "Fire2";

And then we have something like this:
C#:
if (name == UserCommand.jumpInputName)
{
   return this.Jump;
}
else if (name == UserCommand.sprintInputName)
{
   return this.Sprint;
}
else if (name == UserCommand.primaryFireInputName)
{
   return this.Fire1;
}
else if (name == UserCommand.secondaryFireInputName)
{
   return this.Fire2;
}

Basically UCC doesn't know that the input is driven from a UserCommand sent from a remote client. All UCC's abilities still use the PlayerInput.. so it's transparent.

Thank you again sir, that looks like a perfect solution to what I was looking for, I am able to fit all user command button inputs, packed into a int, think I have even a bit spare for something else in the future, this snippet of code saving me time and time passing by fast, trying hard to get YAARRGH! Released this year some time!

Really appreciate your help!
 
Top