More Awesome Than You!

TS3/TSM: The Pudding => The World Of Pudding => Topic started by: MechanicalPen on 2017 March 10, 18:11:39



Title: Reducing Hitching in The Sims 3 via Upgrading its Mono Runtime
Post by: MechanicalPen on 2017 March 10, 18:11:39
Disclaimer; I'm much more a forwards engineer than a reverse engineer, so if I am completely off base please let me know.

Sims 3 runs about as well as my asthmatic step-brother, especially if one tries to play with all Expansion Packs installed at once. This occurs (partially, I assume) for the same reasons the Unity3d engine gets hitchy; they both use an old version of the Mono Runtime for scripting. See, the first garbage collector that shipped with Mono was a Boehm GC. It was fast to implement and mathematically proven to work on any sort of code. However it accomplishes this by pausing all threads while it did its work, which isn't what you want in a real-time simulation video game.

Since then, a more .NET-like garbage collector was implemented, SGen, that reduced garbage collection times by switching from a mark-and-sweep algorithm to a generational algorithm. So I figure, if The Sims 3's current Mono Runtime was ripped out and replaced with a newer version that uses a Generational GC we might just see a performance increase.

The path to this would be to replace the statically linked Mono Runtime Library with a newer one, and then decompile and recompile all the scripting DLLs. Is this idea theoretically sound? Or have I missed something obvious?


Title: Re: Reducing Hitching in The Sims 3 via Upgrading its Mono Runtime
Post by: J. M. Pescado on 2017 March 11, 05:52:11
Aside from the difficulty of doing that, I don't see anything wrong with the concept. Let us know how it goes. I suspect TS3's bottlenecks are elsewhere, as you point out the problem occurs with more expansion packs, except more expansion packs don't add more actual .NET overhead as the core remains the same,  but good luck.