UTComp

Discuss and provide feedback on Maps.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

custom scoring mutator
Not sure how that would affect weapons:
It only replaced one function of ONSPowerCore.OnCoreDestroyed... which only gets called at end of round.

Part of that function is this (PC)

Code: Select all

 PC = PlayerController(C);
        if (PC != None)
        {
            PC.ClientSetBehindView(true);
            PC.ClientSetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            PC.SetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            if (!ONSGame.bGameEnded) {
                 PC.ClientRoundEnded();
                 if (bDebug) log("PC.ClientRoundEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            } 
            else { // match/game ended
            	  PC.ClientGameEnded();
            	   if (bDebug) log("PC.ClientGameEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            }    
Not sure any of that affects player weapons...

Or do you mean the custom scoring inside UTComp?
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

All Custom Scoring Code:

Code: Select all

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	 local ONSPowerCore PC;
	  
	  PC = ONSPowerCore(Other);
	  if (PC!=None && bCustomScoring)
        {
        	  PC.OnCoreDestroyed = MainCoreDestroyedOmniScoring;
        	  // Replace Stock MainCoreDestroyed Function with our own.
            if (bDebug) log("Setting OnCoreDestoryed = Omni",'OmniONSScoring');
	}
	return true;
}

function MainCoreDestroyedOmniScoring(byte T)
{
    local Controller C;
    local PlayerController PC;
    local int Score;

    if (ONSGame.bOverTime)
        Score = CustomOvertimePoints;
    else
        Score = CustomRegulationPoints;
        
   

	 if (bDebug) log("Assigning Custom Points",'OmniONSScoring');

    if (T == 1)
    {
        BroadcastLocalizedMessage( class'ONSOnslaughtMessage', 0);
        ONSGame.TeamScoreEvent(0, Score, "enemy_core_destroyed");
        ONSGame.Teams[0].Score += Score;
        ONSGame.Teams[0].NetUpdateTime = Level.TimeSeconds - 1;
       ONSGame.CheckScore(ONSGame.PowerCores[ONSGame.FinalCore[1]].LastDamagedBy);
    }
    else
    {
        BroadcastLocalizedMessage( class'ONSOnslaughtMessage', 1);
        ONSGame.TeamScoreEvent(1, Score, "enemy_core_destroyed");
        ONSGame.Teams[1].Score += Score;
        ONSGame.Teams[1].NetUpdateTime = Level.TimeSeconds - 1;
        ONSGame.CheckScore(ONSGame.PowerCores[ONSGame.FinalCore[0]].LastDamagedBy);
    }
		if (bDebug) log("Begin Client Reset",'OmniONSScoring');
    //round has ended
    for (C = Level.ControllerList; C != None; C = C.NextController)
    {
        PC = PlayerController(C);
        if (PC != None)
        {
            PC.ClientSetBehindView(true);
            PC.ClientSetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            PC.SetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            if (!ONSGame.bGameEnded) {
                 PC.ClientRoundEnded();
                 if (bDebug) log("PC.ClientRoundEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            } 
            else { // match/game ended
            	  PC.ClientGameEnded();
            	   if (bDebug) log("PC.ClientGameEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            }    
        }
       // this does fix UTComp End game drama, but its a bandaid
       /*
        if (!ONSGame.bGameEnded) {
        	   if (bDebug) log("C.RoundHasEnded called",'OmniONSScoring');
            C.RoundHasEnded();
        }    
        */
        
    }

    if (bDebug) log("End Client Reset",'OmniONSScoring');
    
    ONSGame.ResetCountDown = ONSGame.ResetTimeDelay;
      
    if (bDebug) log("CustomMainCoreDestroyedOver..",'OmniONSScoring');
}
Don't see anything in there that would affect weapons/aiming etc.

If we can't fix the interaction, we could always just set the regulation time to be really low (1 minute, 1 1/2 mins?) only on a few maps would you ever get core down in 60-90s of play..
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

Stock Code function (from Onslaught.ONSOnslaughtGame)

Code: Select all

function MainCoreDestroyed(byte T)
{
    local Controller C;
    local PlayerController PC;
    local int Score;

    if (bOverTime)
        Score = 1;
    else
        Score = 2;

    if (T == 1)
    {
        BroadcastLocalizedMessage( class'ONSOnslaughtMessage', 0);
        TeamScoreEvent(0, Score, "enemy_core_destroyed");
        Teams[0].Score += Score;
        Teams[0].NetUpdateTime = Level.TimeSeconds - 1;
       CheckScore(PowerCores[FinalCore[1]].LastDamagedBy);
    }
    else
    {
        BroadcastLocalizedMessage( class'ONSOnslaughtMessage', 1);
        TeamScoreEvent(1, Score, "enemy_core_destroyed");
        Teams[1].Score += Score;
        Teams[1].NetUpdateTime = Level.TimeSeconds - 1;
        CheckScore(PowerCores[FinalCore[0]].LastDamagedBy);
    }

    //round has ended
    for (C = Level.ControllerList; C != None; C = C.NextController)
    {
        PC = PlayerController(C);
        if (PC != None)
        {
            PC.ClientSetBehindView(true);
            PC.ClientSetViewTarget(PowerCores[FinalCore[T]]);
            PC.SetViewTarget(PowerCores[FinalCore[T]]);
            if (!bGameEnded)
                PC.ClientRoundEnded();
        }
        if (!bGameEnded)
            C.RoundHasEnded();
    }

    ResetCountDown = ResetTimeDelay;
}
Identical except for Scoring values AND
in my version there's the ONSGame reference, whereas stock function doesn't have it.

But my mutator does this:

Code: Select all

function PostBeginPlay()
{
	log(Class$" build "$Build, 'OmniONSScoring');
  ONSGame = ONSOnslaughtGame(Level.Game);
}	
	
So its just a reference to base class. If that reference got messed up, then custom scoring wouldn't work after first round, eg. if the game recreates ONSOnslaughtGame(Level.Game), so that class lives for the match.

Is there any interaction with UT comp with Level.Game or ONSOnslaughtGame?
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

Ok, I did a bunch of testing this morning. I don't want to play ClassicEvilDead anytime soon :lol:

I removed all mutators except UTCompOmni and the problem went away. I then went through and retried with different combinations.

It seems it's the OmniONSScoring mutator that causes the unreg problem after the second round.

I put all server settings back to how I found them, so OmniONSScoring is enabled. At least we know where the problem is now.


I'll investigate more how e.g. ClientRoundEnded() might affect things, and how CheckScore() also. This was moved to a separate mutator because it was crashing inside UTCompOmni. I wonder if this issue is related and we still have something going wonky?

There is some other hooks that happen in UTComp_ONSGameRules that were borrowed from ONSPlus. I think it also hooks OnCoreDestroyed? To give the bonus for node isolation...

I'm not sure if it's needed, but we might need to guard against power nodes here. PowerNode derives from PowerCore so this would hook the OnCoreDestroyed for all power cores *and* power nodes. I don't think it matters but something I noticed right away.

Code: Select all

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
	 local ONSPowerCore PC;
	  
	  PC = ONSPowerCore(Other);
	  if (PC!=None && bCustomScoring)
        {
        	  PC.OnCoreDestroyed = MainCoreDestroyedOmniScoring;
        	  // Replace Stock MainCoreDestroyed Function with our own.
            if (bDebug) log("Setting OnCoreDestoryed = Omni",'OmniONSScoring');
	}
	return true;
}
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

I'll investigate more how e.g. ClientRoundEnded() might affect things, and how CheckScore() also. This was moved to a separate mutator because it was crashing inside UTCompOmni. I wonder if this issue is related and we still have something going wonky?
Those are both called from normal ONS code.
I'm not sure if it's needed, but we might need to guard against power nodes here. PowerNode derives from PowerCore so this would hook the OnCoreDestroyed for all power cores *and* power nodes.
Nope just checked.
OnPowerCoreDestroyed gets called from ONSPowerCore.PowerCoreDestroyed()
But that function is overidden in ONSPowerNode, it has its own PowerCoreDestoryed() function, and doesn't call OnCoreDestroyed.

Pretty much everything is just like it is in base ONS code except this:

Code: Select all

if (ONSGame.bOverTime)
        Score = CustomOvertimePoints;
    else
        Score = CustomRegulationPoints;
There is some other hooks that happen in UTComp_ONSGameRules that were borrowed from ONSPlus. I think it also hooks OnCoreDestroyed? To give the bonus for node isolation...
Might be good to look here, given the first two seem more unlikely.

Question would be does it unreg with just OmniONSScoring and NOT UTComp?

Now does it happen with Enh Net Code off, I don't remember..

We can't really seperate out UTComp Features though, but we could say turn off node isolation and see?
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

I put all server settings back to how I found them, so OmniONSScoring is enabled. At least we know where the problem is now.
If its a big deal we can turn that mutator off.. just make Regulation time one minute or 90 seconds, increase OT. Maybe on bath you get two points if you kill the core quick..but unlikely and most other maps no way. This would solve it without any more coding.... ;)
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

New version! Download here UTCompOmni_1.55.zip

Changes

- Remove the custom RoundEnded and GameEnded states that were copied over from ONSPlus.

I don't think they were needed.
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

Might be good to look here, given the first two seem more unlikely.

Question would be does it unreg with just OmniONSScoring and NOT UTComp?

Now does it happen with Enh Net Code off, I don't remember..

We can't really seperate out UTComp Features though, but we could say turn off node isolation and see?
The unregs issue only happens with net code on, and it only happened after the first round. It only happened with OmniONSScoring. I tested without it and no more unregs.

My aim isn't the greatest, but other players like Anon and Sub-Zero confirmed it only happened after the first round. They said it was much better last night, so I think it's fixed now. They certainly had no trouble killing me :lol:

I was reading the docs and apparently if a delegate actor is deleted but the delegate remains, calling it will crash. Maybe this is what was happening before when we had crashes as players left between rounds previously (and cores are destroyed/remade when round restarts)? I think OmniONSScoring works around that by always replacing the delegate when cores are respawned.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

1.55 on server.
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

new version! Download here UTCompOmni_1.56.zip

Changes
- Limit vehicle damage points to damage actually dealt

This is on the server
Post Reply