Dege wrote:Ok, I found a bug in the code generator that causes the crash and another causing the polygon corruption. […]
Show full quote
Ok, I found a bug in the code generator that causes the crash and another causing the polygon corruption.
As for the flashing pink issue: when it occurs then the game draws with a vs/ps pair that transform a single position vector and emits a constant color.
I don't know what the appearance of the problem is relying on but it seems, as if some textures or other needed objects couldn't be loaded earlier and the renderer fell back to some very primitive shaders. Or sg like that. According to my observation the game eats up a lot of the address space with "too much" video memory available. And probably can't create all of its objects later.
Anyway, I think I managed to make it work: I selected the GF 5700 Ultra with 128MB. It's a card from 2004 with SM2.x support, contemporary of the game.
I played the game for some time (mainly the tutorial levels) with my limited knowledge and experience and it worked fine, no flashing red/pink polygons appeared (unlike with the internal card with much video memory).
But, it may appears after playing for, say, more than a half an hour, or with some very complex scene. I'm not sure. 😖
I see. I'm glad that we are making progress! 😎 😁
I downloaded your new WIP build and I gave Sims 2 a go again. I can run the game in 1440p with the new WIP thanks to the bug fixes you implemented no problem. Ran the game at 1440p with all settings maxed out using the internal 3d video card and 2048 MB VRAM. Played the game for over an hour on a lot and had no visible graphics bugs as of yet, no pink flashing either (it strangely appears in thumbnails sometimes but it didn't appear as I was playing a lot with sims). This is the furthest I have ever gotten in this game and it is cool to be able to play it maxed out without any graphical glitches or issues atm.
I think your VRAM issue is also related to the game internally. The game will automatically force the game to run with only 32MB of VRAM because it's in the game's graphics configuration files. If you go to My Documents/EA Games/The Sims 2/Logs/ there is a log file named *your pc name*-config-log.txt and it will log certain events that go on in the game. You can tell if your graphics memory is being limited if you go under "===graphics device info===" and see "Texture memory: 32MB"
This is how to fix that issue.
Go into your main Sims 2 game directory where the game executable folder is (not where the .exe is located but the folder that is outside of that where you see CSBin, TSBin, TSData, and a few other files). Go into this directory "TSData/Res/". You'll see a Config and CSConfig folder. Open the Config folder and you'll see a file called Graphics Rules.sgr
You can open this file with notepad, and you'll see a section that starts with "# Identify gfx device" and another section following it saying "# Configuration override controlled by command line option -cardConfig". Before the latter section and after the "endif" in the "# Identify gfx device" section, add this line:
# GraphicsRulesMaker Tweak: Force memory size
seti textureMemory 2048
That way the game is forced to allocate 2GB of VRAM for loading textures, and the game properly registers it to use 2GB of VRAM as in the dgVoodoo 2 internal gpu, instead of making the game use a sleazy 32MB. Save this graphics rules.sgr file (make a backup of course 🤣) and copy this file over to the other CSConfig folder as well, overwriting that Graphics Rules.sgr too. This way, the game is essentially forced to allocolate that ram and make the game run better.
That is the way to do it manually. You can go onto this website to see other fixes for the Sims 2 to get it to work its best on Windows 10. Hope this helps, (and with your programming knowledge maybe there are things you can find in this Graphics Rules.sgr file that I can't 🤣).
https://pleasantsims.com/sims-2-windows-10/