For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Replication

To find and remove the bugs we needed every bug known in current 226. You can still review them here.
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Replication

Post by BOZO »

There is a bunch of talk about replication in the buglist. I wanted to post some information I have posted elsewhere and clear up some confusion. This is from a more high level view and is not looking at a specific instance or issue. I will try to answer any questions that arise.
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Re: Replication

Post by BOZO »

I recommend reading the latest version of the ReplicationDeObfuscation document that is floating around the net. It can definately help you to understand network support. Heck, I have been programming for Unreal for years now and I still get confused every once and awhile.

With that said I will try to clear up a couple of things here:

The reliable and unreliable statements set up conditions for when something is to be replicated. These are used to transfer both variables and function calls to the other end.

IMPORTANT: Even if a variable is listed under an unreliable statement - it will be RELIABLY replicated.

ANOTHER IMPORTANT THING: Replication occurs at the end of each tick cycle - thus you could do something like this:

function DoSomething()
{
f++;
f--;
}

where f was a replicated variable. At first glance you would think that f would be replicated twice - but that is not so. Since the value at the end of the tick is the same as it was at the beginning of the tick, no replication occurs.


Variables are updated according to its NetPriority and NetUpdateFrequency settings.

The NetUpdateFrequency sets how often to attempt to update the variables.

The NetPriority sets the relative importantance of updating the variables for that particular class.

Variables are replicated in order of priority. Each tick the classes for which enough time has passed by (their NetUpdateFrequency) to warrant replication to occur will be added to a list of all variables to be updated. These are then replicated in order of priority (classwise not per variable and is set by NetPriority) If insufficient bandwidth is available, the replication is delayed until next tick. (If I recall right)


If reliable is set for a function call, it will be reliably called - every time it is called. If it is set as unreliable then it will only be called if there is bandwidth available at that particular instance. If no bandwidth is available the function call transfer is skipped.
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Re: Replication

Post by BOZO »

You are correct in that bNetDirty acts like a flag to help notify when replication is needed.


Another thing about Simulated functions and replication to keep in mind:

Simulated functions can only be called from other simulated functions and still be executed on the client. Thus if you are in a regular function and make a call to a simulated function it will not work (on the client that is - it always works on the server) UNLESS that particular function is also specified in the replication block.

Simulated function calls CAN be initiated by event calls where the event is also simulated. Examples of event calls are:

PreBeginPlay()

PostBeginPlay()

Tick()

and

Timer()

The whole list of events can be found in the Actor class.
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Re: Replication

Post by BOZO »

You have to keep in mind that the server and client typically run a seperate execution stream - how seperate depends on the RemoteRole setting.

For RemoteRole=ROLE_None only the side on which that particular class is created (the Role=ROLE_Authority side) will run an execution stream. There is no Remote execution stream operating here.
99% of the time this would be a server only operation. Every once and awhile you get a client only operation. There is no network overhead in this case (obviously).

For RemoteRole=ROLE_AutonomousProxy both the Client and Server will run an execution stream. They will run completely seperate of each other and again no network overhead in this case. I think that both sides become ROLE_Authority in this case if I recall correctly once the class is initiated...

For RemoteRole=ROLE_SimulatedProxy both the Client and Server will run an execution stream. This is where the replication settings and simulation comes into effect.

A regular function on the Role=ROLE_Authority side can call both simulated and regular functions at will and they will be executed. Normally this will be on the Server side. All functions that get called on the Role=ROLE_Authority side will be executed regardless of the simulated setting. If a function is called that is in the replication block then that function will be called on the Remote side.

The execution stream on the RemoteRole=ROLE_SimulatedProxy side is operating concurrently with that of the Role=ROLE_AutonomousProxy side. Both sides basically run seperately from each other EXCEPT when they replicate a call. Simulated function calls are not called from the other side UNLESS they are a replicated function. Most of the time the simulated function calls are initiated by either a simulated exec call or a simulated event call on the RemoteRole=ROLE_SimulatedProxy side. Alternatively you can initiate with a simulated replicated function call from the server (but remember there is a delay in this method) Thus on the Remote side the execution stream must be initiated by a simulated function or the stream will not run at all...

For RemoteRole=ROLE_DumbProxy then there is no simulation on the Remote side occuring if I recall correctly...

Recall that on clients most of the time you just want to be doing stuff that has to do with FX and display things. Thus typically only functions dealing with this kinda stuff are made simulated functions. Thus event calls can be very useful to initiate these calls since they typically occur at particular times (usually following a special event).

A good example of a non-simulated replicated function would be a call from a simulated exec function that you have linked to a keybind. What you really want is for all functionality behind that keypress to be executed on the server but it gets called on the client first (since that is where you are pressing a button to initiate it) and the client must replicate the call but keep any functionality from occuring on the client. Thus you make the function replicated but not simulated.
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Re: Replication

Post by BOZO »

This is something I was writing up at one time but never finalized. This should be mostly correct but I never had a true vetting of the document by others to fix any problems that might have crept in. Hopefully someone can check this for me here to confirm it is all correct. It should help clear up some questions in any case.



The following is based off the Replication DeObsfucation document following a large-scale rewriting of the replication rules in a more concise format:


THINGS TO KEEP IN MIND:

On a server, every function is executed, unless it is a (client-server) replicated function. If it meets the replicated function checks then it too will be executed. Thus you can be assured that every function will be called on the serrver unless you specifically tell them not to.

On a client, every function has to originate from a 'Source'. A source can be a (server-client) replicated function, and exec function, or an event. Each of these must themselves be simulated in order to act as a source for clientside function calls.




Replicated Function - Check for execution locally:

Local Execution (Control End) Remote Execution (Replicated End)

1) Static Function - EXECUTE. 1) No Replication Occurs.
2) Standalone Server (Instant Action) - EXECUTE. 2) No Replication occurs.
3) Listen/Dedicated Server and no parent PlayerPawn to this actor (at any point in the parent hierarchy). - EXECUTE. 3) No Replication occurs.
4) Listen Server and player does not have a connection - ie: Playing on the server - EXECUTE. 4) No Replication occurs.
5) Replication Statement Check. (Skip to appropriate outcome below) 5) Depends on outcome of check.

---------------------------------------------------------------------------------------------------------------------------------------------------------

Replicated Function - Replication statement INVALID:

Local Execution (Control End) Remote Execution (Replicated End)

6) If Server - EXECUTE. 6) No Replication occurs.
7) If Client and AutonomousProxy - EXECUTE. 7) No Replication occurs.
8) If Client and DumbProxy or Simulated Proxy and Simulated function - EXECUTE. 8) No Replication occurs.
9) NO EXECUTION OCCURS. 9) No Replication occurs.

---------------------------------------------------------------------------------------------------------------------------------------------------------

Replicated Function - Replication statement VALID:

Local Execution (Control End) Remote Execution (Replicated End)

6a) If Unreliable function and Connection is Saturated. NO EXECUTION. 6a) No Replication occurs.
6b) If Unreliable function and Connection is not Saturated. NO EXECUTION. 6b) Replicated.
6c) If Reliable function. NO EXECUTION. 6c) Replicated.

---------------------------------------------------------------------------------------------------------------------------------------------------------

Replicated Function - Replication OCCURS. (NOTE: This is the same check done for normal function calls also)

Remote Execution (Replicated End)

7) If Server - EXECUTE.
8) If Client and Static Function - EXECUTE.
8) If Client and AutonomousProxy - EXECUTE.
9) If Client and DumbProxy or Simulated Proxy and Simulated Function - EXECUTE.

---------------------------------------------------------------------------------------------------------------------------------------------------------
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
BOZO
OldUnreal Member
Posts: 199
Joined: Sat Nov 30, 2002 4:08 am

Re: Replication

Post by BOZO »

bNetTemporary:

When this is true then the actor is replicated to the client ONCE when it is spawned and then there is NEVER any further function or variable replications that occur for the remainder of its lifetime.


Role=ROLE_AutonomousProxy does not work correctly for version 224.
Darn Floppy Feet!!
{KDS}BOZO/BOZO/LordBozo
User avatar
Shambler
OldUnreal Member
Posts: 310
Joined: Thu Jun 27, 2002 1:57 pm

Re: Replication

Post by Shambler »

Well the problem at the moment is not understanding how the replication works in UScript but understanding how it is implemented in C++.
There are three distinctly different versions of the replication system between 224, 226 and the UTPG version....The differences are hardly noticable at ALL when you see the system in UScript but when your working inside the engine they are very obvious.

The UTPG version (which is the best, most bufixed and secure version) is incompatable with Unreal1 netcode...thus I want to try going through the (apparently nightmarish) task of converting its replication system so it's compatable with Unreal1. (this is even more problematic as we can't yet make the UTPG version work with itself as client/server :))

If possible I want to also be able to 'merge' the two replication systems, the UT1 compatable system and the Unreal1 compatable system...So that 227 clients on a 227 server can take advantage of enhanced netcode and so 224-226 clients can still play with the older netcode.


However what you've written is a very good bit of information about replication :) Would be an idea to write it up on the Unreal wiki..
Last edited by Shambler on Wed Oct 19, 2005 8:47 pm, edited 1 time in total.
User avatar
TCP_Wolf
Administrator
Posts: 1078
Joined: Sun Mar 03, 2002 12:04 pm

Re: Replication

Post by TCP_Wolf »

There already is a write-up on wiki about all that. The main problem is you have to keep the topics "replication" and "simulation" seperate when trying to understand them. Of course they do interact when client/server interoperation comes to bear, but first you have to talk about them separately. Many approaches use both at once and get them either mixed up or sloppy on the details.

For example, functions CAN be CALLED anywhere from anywhere... the only question is if they get EXECUTED! Because if a function can not be CALLED you will get a compiler error asap! If a function can not be EXECUTED simply nothing happens at runtime... If you call a replicated function that returns a value, you ALWAYS get "zero" or an equivalent thereof (false, blank string... etc) as result, regardless if the function is actually executed or not. These small details are only examples of issues people don't know or easily oversee.
-=]HONESTY PAYS[=-

Return to “Report Bugs in Unreal 226 versions”