Question about SetEndCams() and replication

Discussions about Coding and Scripting
User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Question about SetEndCams() and replication

Post by PrinceOfFunky » Wed Oct 25, 2017 11:41 pm

I was wondering something about this function which can be found inside GameInfo.uc:

Code: Select all

function bool SetEndCams(string Reason)
{
	local pawn aPawn;

	for ( aPawn=Level.PawnList; aPawn!=None; aPawn=aPawn.NextPawn )
		if ( aPawn.bIsPlayer )
		{
			aPawn.GotoState('GameEnded');
			aPawn.ClientGameEnded();
		}	

	return true;
}
I know that, according to this page when describing ROLE_None, GameInfo cannot be replicated cause of RemoteRole=ROLE_None (even if I don't see it in the class), that would explain why it references to GameReplicationInfo.
Since EndCams is used to set the visual of the players, why isn't it simulated?
I know that ClientGameEnded() isn't simulated and so it wouldn't be called if SetEndCams was simulated, but ClientGameEnded() does exactly what the instruction above its call says: "GotoState('GameEnded')", so shouldn't the call to ClientGameEnded() be removed and make SetEndCams() simulated?
(of course the "for" would be removed since we would easily get the local player)
"Your stuff is known to be buggy and unfinished/not properly tested"

nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Question about SetEndCams() and replication

Post by nogardilaref » Wed Oct 25, 2017 11:54 pm

It's because of this block:

Code: Select all

    // Functions the server calls on the client side.
    reliable if( RemoteRole==ROLE_AutonomousProxy ) 
        ClientDying, ClientReStart, ClientGameEnded, ClientSetRotation, ClientSetLocation, ClientPutDown;
ClientGameEnded is called in the server, but the call itself is an RPC so it doesn't actually execute in the server, it executes in the client.
From there, states work completely independently between the server and client, so if the state changes in the server, unless something also explicitly changes the state in the client, the client will remain in the same state.
Weapons for instance take advantage of this by being able to have a client-only state in the client (ClientAltFiring for example) and a server-side only one in the server (AltFiring for example).

Also, simulated functions are not exactly "call on client", it's more like "this function is allowed to be executed when the local role is SimulatedProxy or higher", which is why they do not run on a DumbProxy, from there whether it's actually called or not depends on the whole chain of functions called in that role (if you call a non-simulated in a non-Authority role, and that one calls a simulated, the simulated is never executed because the non-simulated is never executed either in that context).
It just so happens that since the server has everything as Authority, then any actor on the client which originated from the Authority has a lower role locally.

However, clients can and also have actors as Authority: these are actors which do not exist in the server at all, and they were spawned only by the client alone, thus every function, simulated or not, runs without a problem locally in the client.

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Thu Oct 26, 2017 12:51 am

Oh oki, I got it, thank you!
nogardilaref wrote:However, clients can and also have actors as Authority: these are actors which do not exist in the server at all, and they were spawned only by the client alone, thus every function, simulated or not, runs without a problem locally in the client.
I guess something like body parts fall in this case then.

EDIT: One mistery still remains(at least for me) where is RemoteRole set to ROLE_None for GameInfo? Cause I just noticed it's the same for the PlayerPawn, there's no specification which says its RemoteRole must be ROLE_AutonomousProxy.
"Your stuff is known to be buggy and unfinished/not properly tested"

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Question about SetEndCams() and replication

Post by sektor2111 » Thu Oct 26, 2017 6:18 am

Level.Game is resident in Server... End of Story.
Player is replicated in client because server is getting some data (keys pressed) and decides Player's faith toward what happens in Game. Some people were doing simulated stuff for player movement which is not client job and that's why sometimes player is crashing in infinite recursions, image dropping might be a relevant factor in figuring why some "teleporterfix" still can crash client if moves to slow at teleporter and yes, that's just BAD STUFF, in order to work more properly it has to be removed from ServerPackages because is an authoritative thing not for mooing in client, otherwise client might crash trying to teleport due to un-existent predicted velocity trying this walk-through in infinity.

Aside BOTH pawns from server and client goes to state "GameEnded" if you take a look at that. SetEndCams doesn't need to be simulated because it will be USELESS, it works as it is - like I said, some excessive simulated stuff can crash client. Probably GameInfo has a default ROLE_DumbProxy after all... that's why simulated will not have other effects,
[attachment=0]ROLE_None_Jokes.PNG[/attachment]
and looking at some projectiles with ROLE_DumbProxy and still non-simulated in parts, they are noticeable in clients as borked as they look - no smoke and all that -WARLORD ROCKET as direct trash sample quoted by me 100+ times. :loool: .

For stability of brain, PlayerPawn has remoteRole ROLE_SimulatedProxy and that's why can run SELF EXPLANATORY named "simulated functions" which at moments due to predictability features can go messy, otherwise with another role some crap will happen with no net game, SERVER IS THE MAN not client.

Another direct sample about something which is not working nice in client is LiftCenter (it's useless for clients after all) - That one has the RemoteRole ROLE_None and it is stuck like a rock in client but it works nice in server, that's why Bots are working ON-Line because "SERVER IS THE MAN" said another X+ times.

Like I said, learning these means making small mutators, even custom projectiles, weapons, else your net stuff will be only a bugged guessing based job like mutators for controlling stuff since you need to figure how do works such things as the first goal.

Did I speak about logging ? I think yes. Logging is helpful for figuring what happens and where.

To summarize:
SetEndCams doesn't have to be simulated (it's your fantasy) as the GameInfo doesn't have a default RemoteRole ROLE_None, and the authority demanding functions resides in Server.
You do not have the required permissions to view the files attached to this post.

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Thu Oct 26, 2017 6:07 pm

sektor2111 wrote:GameInfo doesn't have a default RemoteRole ROLE_None, and the authority demanding functions resides in Server.
GameInfo inherits RemoteRole from Actor class(ROLE_DumbProxy), since no any specific default RemoteRole is set in the class, I understood that GameInfo is not replicated and so its Role is probably, outside of GameInfo.uc, set to ROLE_None, since here it says:
ROLE_None
[...] Examples for this kind of actors are the GameInfo [...]
I was only wondering where is GameInfo set with ROLE_None in the code?
"Your stuff is known to be buggy and unfinished/not properly tested"

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Question about SetEndCams() and replication

Post by sektor2111 » Thu Oct 26, 2017 6:19 pm

PrinceOfFunky wrote:I was only wondering where is GameInfo set with ROLE_None in the code?
I'm gonna be the stupid one, a stupid cannot figure things but can write logs or... making mutators for logging.
A mutator which I'll do (since others are only talking doing nothing :| ) will wait 3 seconds (or 4 seconds) and then will look for a class called GameInfo or a child of it, and it will log RemoteRole and then we can clarify how works an actor when PARENT has a property. If it goes changed, this means Engine does the change VIA natives, if not, you can blow up that phrase and server hosting garbage information based on dreams not based on tests.
Wait 15 minutes, please...
Edit:
Thanks for waiting.
I used this code...

Code: Select all

class RoleLogger expands Mutator;

event PostBeginPlay()
{
	SetTimer(4, False);
}

event timer()
{
	ScanActorTarget();
}

function ScanActorTarget()
{
	local Actor A;

	Foreach AllActors(class'Actor', A)
	{
		if ( A.IsA('GameInfo'))
		{
			log (A.Name$" has Role"$A.Role$" and RemoteRole "$A.RemoteRole);
		}
	}
}
and I've defined it as a ServerActor. GameInfo doesn't really spawn because game is DeathMatchplus which is a GameInfo in end "IsA" on purpose.
Look at log:
Server.log wrote: XC_Engine: Set XC_ServerActor DM-(DoCdOoM)-HappY-XMaS][.XC_ServerActor0 as AdminLoginHook
ScriptLog: DeathMatchPlus0 has Role4 and RemoteRole 1
Personal consideration: any of my works are based on logs and not that much on stories. In a DeathMatchPlus there is no class loaded called "GameInfo" but the child class has what parent has and NOTHING does not change the rule. It stays as in default - crapped info busted...
Okay, now let me punch myself, I'm gonna check a LiftCenter.
Edit2: Checked - the stupid doesn't need to punch itself
Server.log wrote: ScriptLog: LiftCenter0 has Role 4 and RemoteRole 0
ScriptLog: LiftCenter1 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot0 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot1 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot2 has Role 4 and RemoteRole 0
ScriptLog: LiftCenter2 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot3 has Role 4 and RemoteRole 0
ScriptLog: PainPath0 has Role 4 and RemoteRole 0
ScriptLog: LiftCenter3 has Role 4 and RemoteRole 0
ScriptLog: TranslocDest0 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot4 has Role 4 and RemoteRole 0
ScriptLog: PainPath1 has Role 4 and RemoteRole 0
ScriptLog: JumpSpot5 has Role 4 and RemoteRole 0
ScriptLog: DeathMatchPlus0 has Role 4 and RemoteRole 1
Wheew, nice and simple to find what things are doing, right ? Right...

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Thu Oct 26, 2017 8:24 pm

sektor2111 wrote:ScriptLog: DeathMatchPlus0 has Role 4 and RemoteRole 1
And so this:
ROLE_None
[...] Examples for this kind of actors are the GameInfo [...]
is wrong?
"RemoteRole 1" means ROLE_DumbProxy, so not even native changes it into ROLE_None during the game.
"Your stuff is known to be buggy and unfinished/not properly tested"

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Question about SetEndCams() and replication

Post by sektor2111 » Fri Oct 27, 2017 6:16 am

Want me to show you other screwed info there ? Okay let's go - no offense for nobody.
I had an old friend PlayerCanSeeMe crash. Now is gone. While it was bugging me I started searching for such issues. I found 451 servers on Windows being in love with this thing, I found Wiki saying about it as being an A.I. function. It's FALSE, it's an actor related function. SpawnPoint uses it, decoration, carcass, I did not even see in Pawns that much except... dead pawns (not moving actors?). So what A.I. are we talking about ?
Beside this, it was hilarious in such simple explanations describing NOTHING harmful. And It is harmful enough, beside this is bugged, it can see behind player, don't take in account collision cylinder size, and range is limited at 1600. So.... gimme a break with those incomplete things. majority of info from there is described in Scripts - UScript, which is easy readable, natives are not that well explained and tests were not many...
Where is a basic explanation in "AutoPathsBuild" command ? What exactly does ClearPaths() ? - NOT presuming, it removes RouteCache making them None, that's what it does - ME_WikiWhenEncroach :ironic: . I don't know why this task should be done, like I said, explanations are very poor in some points. And game INFO without RemoteRole probably would never trigger things needed by player - there is some data which player should know and has no source for getting that without RemoteRole, it would be 0 Net game. Engine's logs are not lying checkout yourself.

Some day I'll drop some info from old docs and not only from there as a cleaner and valid info with all risks, because I don't see anyone explaining things properly.

There are added a lot of "//fixme" everywhere, but I'm curious WHO is in charge to deal with them without resources and without to suffer some penalty - it's just hilarious, these are haunting me for years. What if a sudden update will come up from nowhere, just for leaving people alone to play normally without tweaks and well documented as for 21th century ? Eh ?

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Fri Oct 27, 2017 7:36 am

sektor2111 wrote:There are added a lot of "//fixme" everywhere, but I'm curious WHO is in charge to deal with them without resources and without to suffer some penalty - it's just hilarious, these are haunting me for years. What if a sudden update will come up from nowhere, just for leaving people alone to play normally without tweaks and well documented as for 21th century ? Eh ?
It would probably be faster to recreate the entire UT99 with new engine, but there would be a huge etichal discussion about this, we don't rly know the line that would separate UT99 made on UE1 from UT99 made on whatever other new engine.
"Your stuff is known to be buggy and unfinished/not properly tested"

nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Question about SetEndCams() and replication

Post by nogardilaref » Fri Oct 27, 2017 1:10 pm

PrinceOfFunky wrote: It would probably be faster to recreate the entire UT99 with new engine, but there would be a huge etichal discussion about this, we don't rly know the line that would separate UT99 made on UE1 from UT99 made on whatever other new engine.
Ethical? Forget the ethical part, that would be downright illegal, and Epic would probably chase you down.
Unless you're from a country where copyrights and intellectual property aren't a thing, and which Epic cannot do anything about, at which case "ethical" is indeed the only thing you would have to worry about, and it wouldn't be able to be distributed worldwide.

The only chance of "recreating" UT99 in any way in a more modern engine, would be to use UE4 and UT4 itself as its base, and "UT99" could simply be a mod, and there was an artist recreating UT99 weapons exactly for that.
But UT4 is stopped and the community cannot really do a thing about it. For the time being, recreating UT99 in any way is a waste of time.

Unless, you do it using Unreal 227 instead, which might or might not be a good time investment, but I think has no legal problems attached, provided that everything gets recreated rather than just transferring the assets to Unreal, as a mod, which in the end could simply be called "Unreal" Tournament 227.

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Question about SetEndCams() and replication

Post by sektor2111 » Fri Oct 27, 2017 4:43 pm

I think a rewritten version without adds will have more benefits, simply all crashes and dumb caping to be expanded accordingly - sample, 1000 Paths this limit is really stupid, seriously, 500 Paths for an inventory - just crap. because these are not well documented people were messing up with huge Levels useless in OFF-Line. If CPU has power INIT should compute how much is doable and calibrating values as VARIABLES not hard-coding values. If server has power let's use it, all the need is fixing these not doing new incompatible stuff is the answer.

User avatar
papercoffee
Godlike
Posts: 9869
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.

Re: Question about SetEndCams() and replication

Post by papercoffee » Fri Oct 27, 2017 5:33 pm

nogardilaref wrote: "Unreal" Tournament 227.
I like the sound of this. :mrgreen:

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Fri Oct 27, 2017 5:58 pm

nogardilaref wrote:that would be downright illegal, and Epic would probably chase you down.
Nono, cause I was exactly talking about Epic doing it.
nogardilaref wrote:which might or might not be a good time investment
Let's be honest, no offense to ut community but would recreating the entire UT99 ever be a good time investment? I would understand if it takes little time, but it surely doesn't.
I think till humans will be the ones programming, UT99 won't be re-programmed from scratch, unless there's something in exchange that makes it worth spending months/years in it.
"Your stuff is known to be buggy and unfinished/not properly tested"

nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Question about SetEndCams() and replication

Post by nogardilaref » Fri Oct 27, 2017 7:43 pm

True, right now it isn't, and that's for the simple fact that it's an old game lacking both players and developers, and even if magically someone just pulled an UT99 remake out of their ass tomorrow, the first community question would be "what about the existing mods and maps", to which the answer would be "they don't work, sorry", which would be a killer right now.

The current game needs a lot of things to be done as it is before remaking it even becomes an option, in my opinion at least, not only for potentially new or returning players, but even for ourselves as still existing players and developers, and those things aren't easy to pull off either, and require a similar level of work to be done, but are far more doable and would empower more mods and maps rather than killing them through a clean reset with a remake.

User avatar
PrinceOfFunky
Godlike
Posts: 1160
Joined: Mon Aug 31, 2015 10:31 pm

Re: Question about SetEndCams() and replication

Post by PrinceOfFunky » Fri Oct 27, 2017 11:14 pm

nogardilaref wrote:are far more doable and would empower more mods and maps rather than killing them through a clean reset with a remake.
Exactly, at this point it's more worth to make/wait for a far faster way to program than the actual one.

Since I guess we are going a bit OT, what's the moral about what Sektor said? Is the RemoteRole of GameInfo never set in game, staying ROLE_DumbProxy all the time? Is the Wiki wrong about GameInfo having RemoteRole set to ROLE_None?
"Your stuff is known to be buggy and unfinished/not properly tested"