[UT]TimeDilation

  • 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.

Kuhal

New Member
Jul 13, 2001
29
0
0
55
New Zealand
Visit site
I don't have a good grasp on what makes the game tick (hehe).

In a mutator, I allow the admin user to set
Code:
Level.Pauser="something";

Which happily pauses the game. Int he ShowScores screen you can see the countdown timer for the map has paused.

However when the admin unpauses the game i..e
Code:
Level.Pauser="";

Then the countdown timer resumes and rapidly counts down to the remaining time that would be left had the original pause not taken place. That is, if the pause was for 10 seconds, then the countdown timer counts down those 10 seconds very quickly (probably 0.2 real seconds per display second).

I've tried saving the Level.Game and GameReplicationInfo attributes before the pause and restoring these after the unpause to no avail. There is something basic I clearly do not understand about what governs the remaining time in a network game.

Any suggestions as to what I need to study would be appreciated.
 

Kuhal

New Member
Jul 13, 2001
29
0
0
55
New Zealand
Visit site
Just in case anyone wonders about the same thing and would appreciate a solution (well work around really).

I changed aspects of the mod so that there were no timers being relied on when the game is paused. I then set TimeDilation=0 until the admin unpauses at which time I restore the previous value.

This has the desired effect however I think it will be unsociable with other mods/mutators which rely on timers. I still don't know the correct way to get the same effect.

Cheers
 

Kuhal

New Member
Jul 13, 2001
29
0
0
55
New Zealand
Visit site
Code:
function bool SetPause( BOOL bPause, PlayerPawn P )
{
	if( bPauseable || P.bAdmin || Level.Netmode==NM_Standalone )
	{
		if( bPause )
			Level.Pauser=P.PlayerReplicationInfo.PlayerName;
		else
			Level.Pauser="";
		return True;
	}
	else return False;
}

You mean this function? hmmmm - looks like I already saw that and copy pasted to get my code ;) lol

The reason this works fine in standalone must be related to having no synchronisation issues. My version runs on the server so I thought I'd have no problems as well. But in writing this reply maybe a lightbulb as switched on - perhaps all my problems are replication issues but I can't see why. I'd understand if I paused a 2 minute game for 1 minute and found it ending with 1 minute in the countdown timer - but what actually happens is that it ends when the countdown is on 0 so it's my understanding that the remaining time is held at the server and should be getting replicated to the clients.

I have just assumed there is a higher level of time keeping than the vars in DeathMatchPlus and GameReplicationInfo and LevelInfo. I've just not been able to trace this back far enough...

Thanks for the reply though - got the thinking going again :)

Cheers
 

Kuhal

New Member
Jul 13, 2001
29
0
0
55
New Zealand
Visit site
Can you explain your cryptic statement? I appreciate your responding to me with a genuine desire to help, but I don't understand your comment. What is native? Where is SetPause overridden? And even if it does exist "higher up", there is no call to it form the GameInfo function since there is no Super.SetPause. Unless you call sub-classes "higher classes" and that's what you mean? Well it's not in any subclass either.

I take your point however that setting the Level.Pauser may trigger other actions that I'm not familiar with so really I need to get into the nuts and bolts of what it causes and the answer will probably be self evident. I guess I only post here for quick answers to things I think others already know about. I'm not one for repeating other peoples past successes :) I'd rather learn (leech?) from them and push the boundaries a bit more in my own way :0

Cheers for the help anyhow
 
Sorry about the 'short and crypic' awnser, sometimes I write something I don't understand it myself afterwards.

A subclass of GameInfo is CTFGame for example, that could have his own pause handeling, so that class has overwriten the SetPause function to do it's own stuff when the pause starts. (couldn't think of anything that it could do, but... maybe)

Native: (from: http://wiki.beyondunreal.com/wiki/Engine_Concept )
The term native is used in the UT2K3 environment to indicate code that is not written in UnrealScript but is instead written in C/C++ and compiled by Epic. Native items are usually made so because UnrealScript is roughly twenty times slower than C/C++. Crucial pieces of UT2K3 or often used pieces of code are made native to optimize the game. Quite often you'll see the term native magic thrown about: this is usually indicative of a process that is not completely understood. Processes like this are assumed to be handled, at least partially, in native code.

If you come across any more words you don't get you might want to look here: http://wiki.beyondunreal.com/wiki/Terminology

The problem with a question like this is that I never worked with Pause myself, but I really want to help.

It seems as if you know quite some UScript, but don't know how everything is called and stuff, you might want to look around the wiki (and learn some stuff ;)). Or I could be totaly wrong and you're a beginner.
 

Kuhal

New Member
Jul 13, 2001
29
0
0
55
New Zealand
Visit site
Thanks again. I know what native means but I didn't understand your reference to it. I already checked for subclassed SetPause actions and I know there are none. As it happens I tried my luck on the Wiki (check my profile there - you will see I've been around a while ;) ) and Mychaeel had some info on there I hadn't picked up on myself. I think my solution is so simple as to be laughable. All I may need to do is update RemainingMinute in the Level.Game and this should replicate tot he clients.

Cheers
 
Ok, :D

I ment with the native that the function has a UScript representation, but that code isn't the 'real' code that's used by the game, it actualy uses C++ code that you can't see. The UScript might do the same, but that's not always the case.
I can't think of an example where that happens right now, but I've seen it somewhere...