Thanks for getting bcak to me and the link. I agree that asset bundles / Addressables is going to be the way for us long term. Since I bought the source version I plan to eventually refactor the character prefab loading system to use Addressables instead to reduce memory and also because we're building for WebGL and are already hitting the ceiling there for how much we can have loaded into memory at runtime.
Seems like most of the garbage collection is happening from the use of LINQ in various places. For example, from FluxStateTracker.cs beginning at line 559
// Inputs being held down (charges)
controlsScript.inputHeldDown = state.inputHeldDown.ToDictionary(entry => entry.Key, entry => entry.Value);
// Projectiles
controlsScript.projectiles = new List<ProjectileMoveScript>();
foreach (ProjectileMoveScript projectile in state.projectiles) {
if (projectile != null) controlsScript.projectiles.Add(projectile);
}
// Buttons Pressed
controlsScript.MoveSet.lastButtonPresses = new List<ButtonSequenceRecord>();
foreach (ButtonSequenceRecord btnRecord in state.moveSet.lastButtonPresses) {
controlsScript.MoveSet.lastButtonPresses.Add(new ButtonSequenceRecord(btnRecord.buttonPresses, btnRecord.chargeTime));
}
// Cooldown Timers
controlsScript.MoveSet.lastMovesPlayed = state.moveSet.lastMovesPlayed.ToDictionary(entry => entry.Key, entry => entry.Value);
ToDictionary() is the 2nd worst method in terms of garbage collection which is probably why it's steadily climbing there.
https://www.jacksondunstan.com/articles/4840
Because getting UFE 2 to a production ready state for us is going to require a bunch of refactoring and UFE 3 is on the horizon I wonder if @Mistermind would be willing to work something out with us. I'd gladly preorder the source version and contribute to the codebase. I'm paying for the top tier patreon right now to get access to the repo but it seems that the UFE 2 repo has been abandoned in favor of UFE 3 development.
Edit: a few other issues we've run into that I plan to dig in and fix
* If two players begin a search for a match at the same time, neither will find a match and both will set up a room. There's no timeout to go back and search again so they'll both just sit in their room indefinitely thinking no one else is online to play
* Randomly get a bunch of "end of stream" errors in the console from PUN. haven't been able to troubleshoot and dig in yet.
* The one scene and instantiation flow seems to be causing quite a few issues. Plan to replace this with scenes and singletons for anything that needs to be persistent.
* Several other small things we plan to fix. Would much rather put this energy towards UFE 3 though.