Replication: from theory to practice

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
I'm trying to get to grips with replication & write some tutorials on the wiki at the same time...

I understand the theory of replication -- At least I think I do!!
I know about replicated variables, and simulated functions, and so on. I've read this page many times.

It seems there's a gap between the theory and the practice.
The problem I seem to be having the most often isn't so much with replication as finding an actor on the client to use to make stuff happen.

The first problem I'm looking at is the example on this page about LocalMessage classes.
The very first example that uses BroadcastLocalizedMessage doesn't work in netplay.
So... how can I go about changing the code so it does?
 

BSands

New Member
Oct 1, 2004
12
0
0
You don't really have to worry about replication with BroadcastLocalizedMessage, as long as the server calls it. Check your message class or for other typos. Some message classes need the PRIs or Object, or else they will return null strings. Class 'CTFHUDMessage' will work with no params (for 2K4). I even tried it to be sure.
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
BSands said:
You don't really have to worry about replication with BroadcastLocalizedMessage, as long as the server calls it. Check your message class or for other typos. Some message classes need the PRIs or Object, or else they will return null strings. Class 'CTFHUDMessage' will work with no params (for 2K4). I even tried it to be sure.

Gah.
Just tried it again, and CTFHUDMessage worked perfectly.
My custom class didn't.
I forgot to add my package to the ServerPackages list. DOH!

SolidSnake -- yup, saw your page.
It's interesting.
But where did you put you TakeDamage() function for example?

Also -- could I move the page to go with Wormbo's Replication Examples page?
 

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
Yes, if you want to.

Its not so much important where its called from (i.e the class) but rather on what machine iit is called from. Obviously, you don't want certain functions called from client machines such as functions which handle damage results or verifying variables, you only want that done on the server. Also clients can't call functions which directly affect other clients, because clients technically don't know anything about other clients. The clients ask the server about the other clients...

So, with replication there also needs to be respect for server/client as well owners. I'm sure there are other factors involved too.
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
[SAS]Solid Snake said:
Its not so much important where its called from (i.e the class) but rather on what machine iit is called from.

True... but you need to find a place to actually do it.
I guess my problem is that I don't know enough about all the actors that are involved in a game.
Eg -- currently scratching my head trying to work out how to get hold of the controllers in a game from a mutator.