Random Server Crashes..

General Comments, Questions about all things OmnipotentS that don't go in other topics/forums
User avatar
captainsnarf
Posts: 2682
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

Yeah, I noticed its logging PRI.Name instead of PRI.PlayerName.

For checkscore, here is my suggestion

change this part in the beginning

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{
	local int i;

        CustomScore(Scorer);

	if (bBalancing || Super.CheckScore(Scorer)) {
		if (!bBalancing) {
			// just update recent PPH values
			for (i = 0; i < Level.GRI.PRIArray.Length; ++i) {
				if (Level.GRI.PRIArray[i] != None && !Level.GRI.PRIArray[i].bOnlySpectator)
					GetPointsPerHour(Level.GRI.PRIArray[i]);
			}
		}
		return true;
	}
        ...
to this

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{
    local int i;

    CustomScore(Scorer);
    if (bBalancing) {
	return true;
    }
    ...
I can change it also if you want. I think the call to Super.CheckScore(Scorer) is problematic.

In CustomScore(), maybe make this change too

Code: Select all

function CustomScore(PlayerReplicationInfo Scorer)
{
    ...
    if(Role == ROLE_Authority && EvenMatchMutator.bCustomScoring)
    {
to

Code: Select all

function CustomScore(PlayerReplicationInfo Scorer)
{
    ...
    if(Role == ROLE_Authority && EvenMatchMutator.bCustomScoring && Scorer != None)
    {

User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Done and checked in on Git. Its on the server.
EvenMatchOmni 3.6

So what I added was this:
In CustomScore

Code: Select all

  if(Scorer != None && EvenMatchMutator.bCustomScoring && Role == ROLE_Authority)    {
And its called in one place CheckScore:

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{	local int i;
    if (EvenMatchMutator.bCustomScoring && Scorer != None) CustomScore(Scorer);
Yes its redundant, but there's no point in doing CustomScore at all if Scorer = None. My theory is someone disconnects right at the core explodes it goes to eval the game score with a None (Null) object. UT is usually pretty good and warning and ignoring but this line
onsgame.GameReplicationInfo.Teams[Scorer.Team.TeamIndex].Score = Level.GRI.Teams[Scorer.Team.TeamIndex].Score;
Modifies GRI, and the Scorer is now the array index, and UT doesn't seem to have as many guard rails on arrays (IMO).

I did test it out, with the help of Sanka who joined while I was testing, Big Thanks!, and we played a couple quick matches and it worked fine. Time will tell with more players, but in any case it was something that needed fixed. And I fixed the PRI.Name to PRI.PlayerName.
User avatar
Enyo
Posts: 1678
Joined: Mon Apr 05, 2021 11:27 pm
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by Enyo »

I think you’re onto something pooty… I noticed the crashes always seem to happen at round end right after someone bails but the next round hasn’t started yet, like you said while the core is still exploding.
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.”
― Mark Twain
User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Code: Select all

if (bBalancing || Super.CheckScore(Scorer)) {
Are we calling that to see if the match is over?

Check score is fun, as it cascades via all the ServerRules..
Based function from the base GameRules class

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{
    if ( NextGameRules != None )
        return NextGameRules.CheckScore(Scorer);

    return false;
}
I wonder if we should just

If Scorer == None return
User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Ok so I'll add in, or rather removes the
if (bBalancing || Super.CheckScore(Scorer)) {
stuff. Its basically redundant too..
Was if not balancing updatePPH..
and then the next block is basically
If (mulligan)
Handlemulligan
else
UpdatePPH

No need to possibly do it twice.

So it looks like this

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{
	local int i;

  if (bBalancing) return True;
  // if balancing return, we don't need to do anything else.
  if (EvenMatchMutator.bCustomScoring && Scorer != None) CustomScore(Scorer);

I moved the bBalancing in front of the custom scoring, that's only true when rebalancing for a Mulligan, if its reshuffling no need to checkscores.
User avatar
captainsnarf
Posts: 2682
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

If you notice, nothing after

Code: Select all

if (bBalancing || Super.CheckScore(Scorer)) {
accesses the Scorer parameter.

Also, EvenMatch's CheckScore function already has this code at the bottom

Code: Select all

    if ( NextGameRules != None )
        return NextGameRules.CheckScore(Scorer);
so it's potentially calling NextGameRules.CheckScore(Scorer) twice. That's why I said we probably don't need the call to Super.CheckScore()

UTComp (and ONSPlus) both have their own ONSGameRules class that is getting used. UTComp has a CheckScore function also. I'm not sure about ONSPlus but I'm pretty sure UTComp's is safe. It makes sure all the variables in it are not None before doing anything.

UTComp's CheckScore checks to see if the round has ended and calls Controller.RoundHasEnded() for each of the controllers. Remember in earlier versions of UTComp when the round ended, players could run around and shoot. That was the fix.
User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Ok so EvenMatchOmni 3.61 on server.

Here;s the CheckScore() function now

Code: Select all

function bool CheckScore(PlayerReplicationInfo Scorer)
{
	local int i;

  if (bBalancing) return True;
  // if balancing return, we don't need to do anything else.
  if (EvenMatchMutator.bCustomScoring && Scorer != None) CustomScore(Scorer);

	//if (bBalancing || Super.CheckScore(Scorer)) {
		
		
		/* Removed for 3.61 Might have been crashing.   on Super.CheckScore(Scorer)
		Plus its redundant below if no mulligan (MinDesiredFirstRoundDuration, it updates PPH Scores (if bBalancing = False from line above)
		if (!bBalancing) {
			// just update recent PPH values
			for (i = 0; i < Level.GRI.PRIArray.Length; ++i) {
				if (Level.GRI.PRIArray[i] != None && !Level.GRI.PRIArray[i].bOnlySpectator)
					GetPointsPerHour(Level.GRI.PRIArray[i]);
			}
		}
		return true;
	}
	*/
	if (Level.GRI.ElapsedTime < MinDesiredFirstRoundDuration && Level.GRI.Teams[0].Score + Level.GRI.Teams[1].Score > 0) {
		MinDesiredFirstRoundDuration = 0; // one restart is enough
		bBalancing = True;
		if (Level.GRI.Teams[0].Score > 0)
			FirstRoundResult = 1;
		else
			FirstRoundResult = 2;
		Tag = 'EndGame';

		log("Quick first round, shuffling teams...", 'EvenMatch');
		CurrentGamePPH = ShuffleTeams();
		//BroadcastLocalizedMessage(class'UnevenMessage', 0,,, Level.GRI.Teams[FirstRoundResult-1]);
		replicationHack = 2;
        SetTimer(1.5,false);

		// force round restart
		if (Level.Game.GameStats != None) {
			if (EvenMatchMutator.bDebug) log("Resetting team score stats...", 'EvenMatchDebug');
			if (Level.GRI.Teams[0].Score > 0)
				Level.Game.GameStats.TeamScoreEvent(0, -Level.GRI.Teams[0].Score, "reset");
			if (Level.GRI.Teams[1].Score > 0)
				Level.Game.GameStats.TeamScoreEvent(1, -Level.GRI.Teams[1].Score, "reset");
		}
		if (EvenMatchMutator.bDebug) log("Resetting team scores...", 'EvenMatchDebug');
		Level.GRI.Teams[0].Score = 0;
		Level.GRI.Teams[1].Score = 0;

		bBalancing = False;
		return true;
	}
	else {
		// just update recent PPH values
		for (i = 0; i < Level.GRI.PRIArray.Length; ++i) {
			if (Level.GRI.PRIArray[i] != None && !Level.GRI.PRIArray[i].bOnlySpectator)
				GetPointsPerHour(Level.GRI.PRIArray[i]);
		}
	}

  if ( NextGameRules != none )
	{
		return NextGameRules.CheckScore( Scorer );
  }
    
	return false;
}
So basically the double CheckScore(Scorer) twice is gone.

One thing I noticed while testing was that during MB (fast rounds before OT), when my HUD core counter wasn't updating right, the point didn't count. The core count bug has been there long before our recent mods (years!)...but I think those two things are related -- might be core UT bug.
User avatar
captainsnarf
Posts: 2682
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Random Server Crashes..

Post by captainsnarf »

Any crashes yesterday? I wasn't on all night but when I played I didn't see any.
User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

Yes early on there was one but it was on Dria Randomizer with the Cluster Bomb Nuke tank.
Bunch of lines like below in the log??

Code: Select all

ScriptLog: setviewtarget2
ScriptLog: setviewtarget1
But I don't think it was the same type of crash we were seeing so I think those changes worked. Whoo.
We play MassD, DJY, RedP, NVM, MinusKS all without crash.

Only thing I noticed is a couple of us "got stuck" at the end of the round and had to reconnect -- not sure why...but saw this in my local log
Warning: UTComp_TabPlayerLoginControls Package.UTComp_TabPlayerLoginControls (Function GUI2K4.UT2K4Tab_PlayerLoginControls.ButtonClicked:01BD) Accessed None 'Game'

And I think I found a problem on the Flame tank (but that's really not crash releated, just part of the slow down..there's an error (Function FireVehiclesV2Omni.FlameTankCannon.Tick:0010) Accessed None 'Owner') that just spams the local UT2004.log.
User avatar
pooty
Posts: 4486
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Random Server Crashes..

Post by pooty »

So the random crashes are back again. Not sure what it is, thought it was something in EvenMatchOmni but that seems pretty clean (although snarf, I see some simulated functions there, not sure why since that's server side mutator that shouldn't run anything on the client (simulated)..

At this point I want to revert either UTCompOmni to ONSPlusOmni and see if the crashes continue. If they don't then likely EvenMatch, if they do then probabaly UTCompOmni, however I don't think they've been having any crashes on CEONSS with it so ... maybe that's likely EvenMatch...maybe I should take that out... and we could do Enyo's random teams test at same time.
Post Reply