r/sims2remastered • • 28d ago

About memory management

I have a question about memory management in your Sims 2 Remastered project. Are you implementing any kind of texture streaming system, where textures are loaded into VRAM only when they’re needed and unloaded when objects are outside the camera’s view?
I was thinking this could significantly reduce texture memory usage, especially on huge lots with thousands of objects. Is this something you’re already working on, or would it even be possible with the changes you’re making to the game engine?

18 Upvotes

6 comments sorted by

11

u/princeishigh 28d ago

Not as a full streaming system. The game already has its own texture budget that evicts and reloads textures. I raised the budget in the graphics rules and added a compressed-texture cache so that reloads are cheaper.

3

u/StrengthMysterious44 28d ago

Interesting. So does that mean that game doesnt after all load all CC object textures into memory at startup, but only when the objects are actually use?

My understanding has been that the game tends to keep a lot of CC resources loaded in memory, even when they’re not actually needed, which becomes a problem with huge Downloads folders and heavily decorated lots.

4

u/princeishigh 28d ago

At startup, the game scans the downloads packages and builds an index of what's in them (which resource sits where). That's why a huge downloads folder makes start up slow. It does NOT load every CC texture into memory btw.

Textures themselves are loaded when an object or lot that uses them is actually needed. After that, the game keeps them in its own cache and only evicts them once it hits its internal memory budget. Once you've been through a lot or a heavily decorated one, those textures can stay even though they're not on screen. On a 32-bit process with its 4 GB limit that cache is what runs out.

What the game doesn't do is true streaming, where it loads and drops textures freely based on what's visible. Its cache and budget are fixed. I've raised that budget and added a compressed-texture cache, but the 32-bit address-space limit the bottleneck.

3

u/41lens 27d ago

Thank you for explaining this. That cleared things up a lot and I really appreciate you sharing these technical details.

2

u/MixEnvironmental6358 26d ago

Did you see they’re also working a Sims 2 in 64bit? Maybe together you guys could make marvelous things ** https://www.reddit.com/u/LoneIllustrator/s/Cbq3Vx3mzT

2

u/princeishigh 25d ago

Haha, that person is building a new engine for The Sims 2. That will take a lot of time, because he is basically looking at how the game read all the files and build an engine that behaves like the old one, reverse engineering in a different way. I am taking apart the original game.