UTComp

Discuss and provide feedback on Maps.
User avatar
captainsnarf
Posts: 2630
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

I noticed in the new 1.41 version of UTComp you added None checks around the loop of ControllerList since there are errors about 'Accessed none 'C'.

I looked through all the source on how ControllerList is populated. The Controller.uc class has these two methods:

Code: Select all

native(529) final function AddController();
native(530) final function RemoveController();
Those are where the Level.ControllerList gets new entries added and removed. As far as I can tell that is the only way ControllerList is populated.

Controller.PreBeginPlay() calls AddController(). Controller.Destroyed() calls RemoveController().

So it seems like a controller is getting destroyed before or during that loop. I think the garbage collector will change any references to a destroyed object to None so you get the None access here.

It might be helpful to add logging to BS_xPlayer (UTComp's PlayerController class) Destroyed() method to see when the controllers are getting destroyed.

Also something to mention is I've seen very similar errors in other mutators like 3SPN/TAM. Looping through Level.ControllerList seems to be problematic. It's done quite a lot throughout the engine but there may be cases it's unsafe to do.
User avatar
pooty
Posts: 4351
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

But wouldn't the checks make it safe

Code: Select all

 
     if(Level != None)
            C = Level.ControllerList;
     while(C != None)
        {
            if(C != None) PC = PlayerController(C);
            if (PC != None) PC.ClientSetBehindView(true);
            if (PC != None) PC.ClientSetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
            if (PC != None) PC.SetViewTarget(ONS.PowerCores[ONS.FinalCore[deadCore]]);
            if (PC != None) PC.ClientRoundEnded();
            

            if(C != None) C.RoundHasEnded();

            if(C != None) C = C.NextController;
        }
So say in the middle there's an event where C is destroyed, C becomes 'None', it would skip all the statements (inlcuding C.NextController) and just stop executing the loop. Now that might not be desired behavior if suddenly C is gone.

Now there's this function (taken from core game)

Code: Select all

function AdjustView( float DeltaTime )
{
    local Controller C;

    for ( C=Level.ControllerList; C!=None; C=C.NextController )
        if ( C.IsA('PlayerController') && (PlayerController(C).ViewTarget == Pawn) )
            return;

    Pawn.bUpdateEyeHeight =false;
    Pawn.Eyeheight = Pawn.BaseEyeheight;
}
So I wonder if instead for the While loop, the for executes differently/safer? Logical those two are the same though. I guess lets see if we get any more crashes on disconnect.

Now the function in question is the one that sets the view of the destoryed core correct? And sometimes we see the wrong core instead..possibly related?
User avatar
captainsnarf
Posts: 2630
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

But wouldn't the checks make it safe
Not really. Safer I guess but it's not safe. Doing that only moves the goal posts.

Code: Select all

while(C != None)
{
   if(C != None) /* race condition here */ C.DoSomething();
}
C could become None in between the if statement and the call to C.DoSomething().

Since C is getting modified asynchronously outside of this code, there is no safe way to access it.

In a really old version of UTCompOmni (basically UTComp 1.8 renamed UTCompOmni), there was a problem that after the round was over and you were looking at the dead core, players could still run around, shoot tanks, etc. It's something with how UTComp modified the onslaught game type. The code above was added to fix that. It was mostly copied from the onslaught game code to force players to be unable to move and to force them to view the core explosion at the end.

Maybe the real fix is to remove that code entirely and fix whatever UTComp is breaking with onslaught instead? It might be something simple like Game.GotoState('RoundEnded') or something like that.
User avatar
pooty
Posts: 4351
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: UTComp

Post by pooty »

Still not entirely convinced though it's UTComp or at least that function. Last two I havent seen the C=None warning. But all crashes have been end of round, and when someone leaves.
In a really old version of UTCompOmni (basically UTComp 1.8 renamed UTCompOmni), there was a problem that after the round was over and you were looking at the dead core, players could still run around, shoot tanks, etc. It's something with how UTComp modified the onslaught game type. The code above was added to fix that. It was mostly copied from the onslaught game code to force players to be unable to move and to force them to view the core explosion at the end.

Maybe the real fix is to remove that code entirely and fix whatever UTComp is breaking with onslaught instead? It might be something simple like Game.GotoState('RoundEnded') or something like that.
Have to find the ONS bug in UTComp....do you think its overwriting one of the usual functions?
User avatar
Miauz55555
Posts: 33
Joined: Thu Jul 01, 2021 7:33 am

Re: UTComp

Post by Miauz55555 »

Still not sure what settings would be right in which sittuation regarding ping, fps, netspeed, desired net update rate, netcode on/off.
I started with Netcode ON, Network Update 90, where I had the feelings of much unregs:
https://www.twitch.tv/videos/1782621198
Then I used Netcode ON, Network Update 320 without knowing what it does .. but feelt somehow bad in a different way, too:
https://www.twitch.tv/videos/1782621202
Netcode off, Network Update 365, was best for me I guess.
https://www.twitch.tv/videos/1782621201
But Hellbender missing with charging turrent (around ~0:50) the xhair is clear on target, but the shot is a mile away. I know that sometimes happend when using behind view, but it was in the direct one.
https://www.twitch.tv/videos/1782621199
User avatar
captainsnarf
Posts: 2630
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

In your first video, it looks like you are legit missing a lot of your shots. Bad day? It looks like your shots on aim do hit though.

The "Network Update" on the F5->Misc tab only affects one thing - updates sent about your movement. It has NO affect on aim at all. If you find you are accidentally dodge jumping or dodge jumping isn't working you might want to change the network update rate, but that's all it's for.

UTComp has no affect on vehicle aim. The hellbender bug happens to me even with UTComp disabled. As far as I understand this happens when your position on the server and position on your client become out of sync. Switch to driver seat, move a tiny bit, then switch back to gunner seat to fix this.

If you have a low ping (40ms or less) you might not need enhanced netcode. I know enyo liked it better off, but he has a good ping.
User avatar
Miauz55555
Posts: 33
Joined: Thu Jul 01, 2021 7:33 am

Re: UTComp

Post by Miauz55555 »

I definitly missed a lot there, yes. =D
But I had the feeling, that when the enemy is moving sitewards it doesn't hit, even when on target. Around 1:00. Not sure.

Thanks for the tip with the hellbender, I will try it next time. It's the most frustrating thing when you know it would be a hit on a static target and you see the beam missing a mile away. :twisted:

So when I use a higher Network Update number than I could dodge/jump like offline? I have it sometimes online that a wall dodge or double jump or lift jump doesn't go through. It's not a big deal in ons, unless you make a trial to a secreate room, but it is in freon or tam. .. Campgrounds from the bridge to the other platform with a jump wall-dodge .. I miss that most of the times online.
User avatar
Anonymous.
Posts: 351
Joined: Sat Jun 12, 2021 10:54 pm

Re: UTComp

Post by Anonymous. »

Think we can turn enhanced netcode on by default now that the lag issues are fixed?
User avatar
captainsnarf
Posts: 2630
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: UTComp

Post by captainsnarf »

Anonymous. wrote: Tue Apr 04, 2023 11:31 pm Think we can turn enhanced netcode on by default now that the lag issues are fixed?
Yeah, but it would require a new version. It's a minor change that won't take long but I've been busy with 3SPN/TAM changes too. Soon? :o :D
User avatar
Anonymous.
Posts: 351
Joined: Sat Jun 12, 2021 10:54 pm

Re: UTComp

Post by Anonymous. »

I didn't realize it requires an update, take your time then.
Post Reply