[Twitch] Networking, and Game Jam Theme Announce! - Nov 13, 2014 @ 2PM ET

Hi Elvince,

My answer was more suited for filtering replication through property updates to a certain connection. If you wanted to do this, you could:

Register a property that holds all the state that you wanted to be per connection like this:

DOREPLIFETIME_CONDITION( APlayerController, PerConnectionState, COND_OwnerOnly );

Then, if you wanted to change the state for a particular connection, I would find the connection that had that player controller, and change the state of PerConnectionState on that player controller. This change would only get sent to the connection that owned that player controller.

This is definitely not the most ideal way, but it’s the best thing I can come up with at the moment that wouldn’t require a lot of changes.

Even simpler of course, is to just send an RPC on that player controller, and definitely works if the state you want to send is more event driven rather than “send this if the data changed”.

Hope this helps!

@,

thanks for the additional explanation. I think I need to dig into the code to find how the connection are managed.

In fact, my goal was simple: I wanted to share the health value of all your teammates but not your ennemy.
Where the goal was simple, it’s implementation is not easy.

For the moment, I set the health attribute to replicate to all, but I feel that some people will hack this data to show it in their UI and then seeing ennemy life :frowning:

Hi Elvince,

Good point! Hacking is always a worry.

For this, you won’t really need to worry about it at the connection level. You can use the method I described above, but just worry about stuffing the health into the PerConnectionState for the player controllers that are on the correct team (this can be named PerPlayerControllerState really).

So if you set up the property as above, your code could look like this:
if ( PlayerController->Team == CorrectTeam )
{
PlayerController->PerConnectionState->Health = Health;
}

For this, you can definitely also just use an RPC to periodically update the health to the appropriate player controllers if it doesn’t change often, but I can see the need to update health often, so maybe this doesn’t apply.

@,

Ok I think I understand the way you suggest to implement this.
In fact the PerConnectionState will hold the data that I want to send to a connection in particular.

On my case, it will hold the Pawn Ref and its health. So on the client, if I want to show the health I won’t look on my Pawn class, but I will get this information from the PlayerController. Or when the PerconnectionState is replicated, I can update the data on the client.

I think this will work for my case. Thanks for the suggestion.

Ps: As you said, RPC is not ok for Health as it will change a lot and RPC will cost much more thant the regular Replication process.

You can definitely store this on the player controller directly, but you can also store it on the pawn. As long as the pawn is possessed by the controller, it’s sill “owned” by that connection, and any properties replicated with the COND_OnlyOwner will work as you need. You can then store these values on the pawn if you like.

I may put it on the pawn but for me it s weird to set the other teammates health on a pawn that already manage its own health. I would better use playerstate or controller just to avoid confusion when reading the code.

You can store this on the player state as well, they are owned by the correct connection, so COND_OnlyOwner applies there as well.

will the sample shown on twitch be out ? i am still waiting for it ? please share the download link

[Question]
What is the simplest way to network a Physics-Controlled Pawn via Multiplayer? Should I be using Physics Forces, or manipulating Velocity & Angular Velocity directly? Is replicating the object’s movement enough, or will I need client-side prediction too?

[Question]
What sort of objects should and should not be networked, e.g, camera’s, spring arms, etc.

[Question]
How long until we can expect to see some start-to-finish networking tutorials, such as for a simple game or actor component that we want to replicate?

Thanks!

I am also curious as to when the sample will be released. I understand the new OSS nodes and have gotten those working correctly though I am more interested in the Game Instance class and how that is set up in the demo. I’ve tried to replicate as much as I could but some things just don’t show on the client. I am no good at C++ so trying to figure out how Shooter Game does it hasn’t given me much help either. Any information would be greatly appreciated by myself and many others stuck in the same boat.