overload-development-community / olmod

A mod for the game Overload that enhances the multiplayer experience.
https://olmod.overloadmaps.com
MIT License
32 stars 15 forks source link

CTF+JIP Bugs #270

Closed AllanGibbs closed 1 year ago

AllanGibbs commented 2 years ago

Hello, dear Overload community, programmers and fellow pilots. I'm Gibbs from the Discord server.

I would like to officially request a repair of the CTF mode in Olmod.

I stumbled of the fact, that quiet a few pilots would like to play CTF. Minimum 10 pilots. Unfortunately the Olmod CTF mode is broken: After a few minutes in the match errors occur.

Likewise:

Mentioned on Discord on 09/05/2022 "Gibbi: I think it is FUBAR."

I think me and the other CFT fans would appreciate a running CTF mode. It would also enhance the Overload Team League, since it is a nice team based competitive mode.

roncli commented 2 years ago

That is quite a formal post for an informal project. 🙂

Doing a local test with just 2 players, I had no problems.

Last successful game of CTF was played on the 0.5.5 patch (20 minutes, 9 players). You mentioned on September 5 that it wasn't working, but that is also the 0.5.5 patch. So, there has to be something specific going on with your games. What settings are you using when creating multiplayer games? Is this on a specific server this keeps happening? When did you last try it and on what server? We probably want to get the server op to pull the logs so we can see if there were any server errors.

AllanGibbs commented 2 years ago

Yesterday we tried another session to provide more detailed information. It seems that more than 2 players cause the issue. We didn't check it as 1on1 yesterday.

I hope you can retrieve log from here:

Descentformum.net, 10 min ctf, 4 players at the beginning a 5th joined at min 6 or so -> crash

DK EU Server, 10 min ctf, -> no crash

When the crash happened: Player "Wormaus" and the other players could not use ESC to exit to the game's multiplayer browser. Player "Gibbs" could exit using ESC to exit to the game's multiplayer browser. Players played on olmod version 0.5.8. Gibbs played using 0.5.5. Servers provided olmod version 0.5.8.

Server game settings: I used the OTL CFT preset and changed:

https://youtu.be/zRlU33-h_IQ https://youtu.be/P2gwtSSosr8

We also thought of this idea, tested it but couldn't replicate it:

An instant flag change might cause the bug(s). Blue ship positioned in orange flag spwan while no orange flag present.

Orange flag carrier killed, orange flag returned to orange flag spwan, blue ship instantly picking up the orange flag. Because players reported duplicated flags (I never saw duplicated flags).

On D.Cents EU server happened this: The match ran without any problems for 10 min and ended nearly normally. But the countdown timer got stuck at 00:00:01 seconds. No scoreboard was displayed. ESC to game multiplayer menue was successful.

What settings are you using when creating multiplayer games? I used the OTL preset and changed: https://youtu.be/zRlU33-h_IQ https://youtu.be/P2gwtSSosr8

Is this on a specific server this keeps happening? No. Descentformum.net DK EU Server D.Cents EU server

When did you last try it and on what server? Descentformum.net DK EU Server D.Cents EU server Last try 2022/11/03 23:38 ECT-Berlin

roncli commented 2 years ago

This is good information. I've asked D.Cent, dreawus, and Do_Checkor for their server logs for that time period, we'll see if we can't get to the bottom of this.

AllanGibbs commented 1 year ago

For me flags have the correct team color. Orange and blue. No issues to report regarding the flag color. Oops, I accidental closed this issue.

roncli commented 1 year ago

I don't think this is closeable just yet, @terminald3 was also reporting similar issues to you.

We're trying to get logs, but I think the European folks don't keep their logs. If you use an Overloader or one of the Azure servers, those keep logs for 30 days and indefinitely respectively.

AllanGibbs commented 1 year ago

Oops, I accidental closed this issue. Just wanted to comment. OK. Thanks. We will try the Overloader and Azure servers when we are testing it next time to provide server logs. I think, I will also record the entire test session for visual feedback for you.

derhass commented 1 year ago

A couple of people tested CTF on a 0.5.4 server today (clients still 0.5.8), and the issues (at least some of them) could be reproduced there. Attached is the server log file, there are lot's of CTF-related exceptions: Player.log.zip

AllanGibbs commented 1 year ago

Thank you for the test run and for providing the LOG-file, @derhass .

derhass commented 1 year ago

Thank you for the test run and for providing the LOG-file, @derhass .

@AllanGibbs: Actually, the log is from Wormaus' server, and he and a few others did the test, I wasn't involved besides just looking at the logfile and uploading it here.

roncli commented 1 year ago

Thanks for the log, this is super helpful. Even though this is an 0.5.4 server with 0.5.8 clients (I would not do this again), it provides enough information that I think we can get to the bottom of it.

Here's the first error.

NullReferenceException: Object reference not set to an instance of an object
  at GameMod.CTF.SendCTFPickup (Int32 conn_id, Overload.Player player, Int32 flag_id, FlagState state, .Item item) [0x00000] in <filename unknown>:0 
  at GameMod.CTF.SendJoinUpdate (Overload.Player player) [0x00000] in <filename unknown>:0 
  at GameMod.JIPReadyForCountdown+<MatchStart>d__2.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 

Here is the timeline of significant events:

So, this appears to be some kind of JIP issue. But that's not the end of it. INSANER, who did not join cleanly, picks up the flag, and then this error occurs.

Unhandled Exception detected: KeyNotFoundException: The given key was not present in the dictionary.

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

System.Collections.Generic.Dictionary`2[UnityEngine.Networking.NetworkInstanceId,GameMod.CTF+CTFStats].get_Item (NetworkInstanceId key)
GameMod.CTFClientHandlers.OnCTFNotify (UnityEngine.Networking.NetworkMessage rawMsg)
UnityEngine.Networking.NetworkConnection.InvokeHandler (UnityEngine.Networking.NetworkMessage netMsg)
UnityEngine.Networking.LocalClient.ProcessInternalMessages ()
UnityEngine.Networking.LocalClient.Update ()
UnityEngine.Networking.NetworkClient.UpdateClients ()
UnityEngine.Networking.NetworkIdentity.UNetStaticUpdate ()

After this, the game is hosed.

So clearly there are some shenanigans going on with CTF+JIP (which is why some people are having no problem with CTF - they don't use JIP). I think this helps narrow down the issue, but will take a pretty hard look at the code to figure out how to fix it.

CCraigen commented 1 year ago

I might have something. MatchModeCTF.cs, in SendJoinUpdate(), line 458. CTF.SendCTFPickup(conn_id, FindPlayerForEffect(x.Key), x.Value, FlagState.PICKEDUP); As far as I can tell, SendJoinUpdate() only fires on the server, and only in the case of JIP, and is trying to use FindPlayerForEffect() to get the Player object to attach the glow to. However, FindPlayerForEffect() has a check that returns null if it is run on the server. I haven't tested it yet but it looks wrong. Gonna take a peek.

-- Yep that appears to be the cause of the first null reference, and fixing it made the second one not happen too. Working on a patch now, there's some other stuff not firing properly on JIP too that's now visible.

AllanGibbs commented 1 year ago

Cool, @CCraigen!

CCraigen commented 1 year ago

I've managed to fix up most of the problems, the main stubborn one remaining is that when JIPing the flag colors are sometimes reversed. They still behave correctly, they just look wrong. As soon as they're picked up they go back to normal when dropped or returned, so it's just the initial spawn, and I'm assuming it's something similar to ship customizations sometimes not taking properly.

AllanGibbs commented 1 year ago

I'm very glad to hear that you could solve issues regarding the CTF mode. I'm excited. Thank you very much, @CCraigen.

CCraigen commented 1 year ago

Glad to help. What it really needs is a real good shakedown to make sure I didn't miss anything, there's only so much testing I can do with a couple of clients running on the same computer. If you've got people that want to play and you're willing to play around and test it out, I can post a DLL for you to try and break.

AllanGibbs commented 1 year ago

Hello CCraigen. Yes, post the DLL. I should find some testers. I guess it will be the same ones as last time. Afterwards you will receive the server logs.

CCraigen commented 1 year ago

Attached. GameMod.zip

CCraigen commented 1 year ago

I see Ron has merged this - how did the tests go? Were you guys able to give it a good work-over?

derhass commented 1 year ago

I haven't heard of anyone actually testing this. But the "0.5.9 RC2+2" version on D.Cent's server has all those stuff in it, and should be compatible with the DLL posted here on client side, so people could test it on this server at any time.