74oshua / RoombaMines

A mod for Lethal Company that makes mines move like Roombas. Must be installed on client and server!
1 stars 1 forks source link

Mines near ship #2

Closed Vicerek closed 8 months ago

Vicerek commented 8 months ago

A ton of mines spawn next to the ship and cause immense lag and they do not disappear between moons.

74oshua commented 8 months ago

Are you using any other mods? Please post screenshots.

Vicerek commented 8 months ago

So I made a modpack with a lot of mods and brutal company plus mod and there was a lot of mines spawning but when I used a different modpack without brutal company plus they still spawned but in much smaller quantities so they weren't causing any lag but now I checked and with only brutal company plus they still spawn. image image image

The mods in the modpack don't do any as drastic changes as brutal company plus but I have no idea how modding works so maybe some of this change the same value and it somehow impacts the boombas.

The mods in the modpack without brutal company plus are: BepInExPack LC_API Custom_Boombox_music Custom_Boombox_fix Capybara_MouthDog AdditionalContentFramework AdditionalSuits FreddyBracken LCSoundTool CustomSounds ineedmorebullets_turret HealthMetrics AAAAAGHH Skinwalkers Mimics IsThisTheWayICame PushCompany GamblingMachineAtTheCompany RoombaMInes Karls_Extra_Suits LethalCompany_InputUtils Runtime_Netcode_Patcher BetterEmotes Gigachad_Suits LethalPosters

74oshua commented 8 months ago

Can you try running the game with RoombaMines installed as the only mod and see if the issue persists?

Roobotics commented 8 months ago

I've been able to recreate this also happening with only your mod installed as well as 'HazardsOutside' mod, it seems like any mines that are spawned outside, end up stuck nearby your ship upon leaving(you can hear them in space), and never despawn, are still there the next day PLUS the new mines spawned for the day, so it gets very laggy when you combine these sessions of mines.

Even with small amounts of them, they likely stay until the session is fully ended to menu, it will just get progressively worse. Also for troubleshooting, a mod like 'SupplementaryMines' or 'OverprotectedFacilities' will multiply the mines, and 2nd moon visited, will often be a slideshow that requires ALT+F4

You should try to despawn all mine instances upon departure. Likely any mod that spawns them outside is not being accounted for, but is being influenced by your mod. The ones outside, also don't 'roomba' or move around, that I've ever seen.

A secondary class of roomba mines, that we could configure as say.. 'speedy' ones outside, would actually be a great idea while looking into this, also. I'd also recomend making them chirp more frequently or customizable if you decide to persue that later, as early feedback.

Vicerek commented 8 months ago

Yes, unfortunately they still spawn. I think the amount of them somehow depends on the number of entities spawned on the moon and that's why there was so much of them with the brutal company plus mod but with the roomba mines as the only mod they still spawn just in much lesser quantities. For example I only encountered a thumper and one mine spawned but at the same time when I saw the bracken there was no mines so maybe it doesn't really matter but idk.

Roobotics commented 8 months ago

I went and tested again, I realized my testing was very much flawed by jumping straight to a mod with outside mines.. Simply using 'SupplementaryMines' to just increase only the vanilla/indoor mine-spawns by 3x in it's config, then getting a Experiment moon landing that spawns indoor mines(not all of them do), upon leaving, it is indeed the indoor mines following the ship around, as outdoor ones don't even exist in this pack anymore. Hopefully this info helps more now.

Is the mod maybe displacing the mines to somewhere, replace them with a different roomba entity perhaps? Maybe that's what these are? Else the roomba mines on the moon are getting collected upon leaving, and are left floating beside the ship until game exit. The performance hit just for having them there is crazy tbh. So, yes, something is very much not right with just the core mod here, the added indoor mines just make it apparent a lot sooner!

74oshua commented 8 months ago

@Roobotics Thanks, that helps. I suspect this has to do with how Unity's NetworkTransform works, it's possible that when you leave the facility, the mines are being moved to the same position in the overworld. I need to do some testing.

Vicerek commented 8 months ago

The ones outside, also don't 'roomba' or move around, that I've ever seen.

Actually it only happened once but I landed on a moon and it was like all the mines stuck to the ship just went on their way (I didn't have any hazards outside mod) and there was just a ton of mines roaming around the ship

74oshua commented 8 months ago

I believe I've found the issue, it seems like my code for setting mines that spawn in the air on the ground was putting mines next to the ship. I still don't entirely know why, but reducing the distance of the raycast fixes it. As for the mines not despawning between moons, I've reworked the mod so it now modifies the landmine prefab itself instead of spawning a separate object as a parent of existing landmines, and that seems to have fixed the issue. I'll be releasing 1.1.3 today, please let me know if it fixes the issue for you.

74oshua commented 8 months ago

1.1.3 released, please let me know if you still experience the issue

Roobotics commented 8 months ago

I've tested with indoor mines multiplied via 'SupplementaryMines', and it has indeed gotten rid of this issue of old mines following the ship around and creating gameplay breaking lag!

I'll open a separate issue to try and describe outdoor mines.. they uhh started moving suddenly. But not quite as expected. Else this massive performance snag has been figured out quickly, thanks!

74oshua commented 8 months ago

@Roobotics Feel free to use this issue to describe anything relating to outdoor mines, it was mentioned in the original post after all. I'll close the issue when both have been fixed.

Roobotics commented 8 months ago

@74oshua Apologies but I'd already been writing the other explanation now up, they never moved for me originally, so this is a new behavior entirely, Feel free to mark this one as closed. You've definitely sorted the performance bug that was present, and quickly I might add! That was a real show-stopper from being able to couple your mod to things like 'OverprotectedFacilities' and not have to reload the save every round!

74oshua commented 8 months ago

@Roobotics Fair enough, closing as solved