Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

any kind of mods
Post Reply
  • Author
  • Message
Offline
User avatar
Posts: 64
Joined: 11 Sep 2013, 22:34

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Daetarek wrote:So after messing around with various dll's configs i figured there must be an easier way to swap between values without the need for a new file, and setting a single flag to swap between multiple configs added far too much code for my liking so i came up with the following.
I did something like this myself too for testing. Since I anticipated recompiled dlls will be uploaded everywhere I figured I make the first patch with fixed numbers for the copy pasters so it is a bit safer for the mindless masses :)

I sugguest to make both ini values pure MB numbers to make sure their total sizes are dividable by 64kByte. Note that the number for the first block needs to add 100h or 256 decimal.
safewrite ... MemBlock1+256
safewrite ... MemBlock2*1024*1024

in the ini you can then have a much cleaner looking

[NotPlacebo]
GiveFirstBornToSheson=1
MemBlock1=512
MemBlock2=256
Last edited by sheson on 19 Jan 2014, 14:32, edited 1 time in total.

Offline
Posts: 29
Joined: 18 Jan 2014, 04:27

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

sheson wrote:
Daetarek wrote:So after messing around with various dll's configs i figured there must be an easier way to swap between values without the need for a new file, and setting a single flag to swap between multiple configs added far too much code for my liking so i came up with the following.
I did something like this myself too for testing. Since I anticipated recompiled dlls will be uploaded everywhere I figured I make the first patch with fixed numbers for the copy pasters so it is a bit safer for the mindless masses :)

I sugguest to make both inis value pure MB numbers to make sure their total sizes are dividable by 64kByte. Note that the number for the first block needs to add 100h or 256 decimal.
safewrite ... MemBlock1+256
safewrite ... MemBlock2*1024*1024

in the ini you can then have a much cleaner looking

[NotPlacebo]
GiveFirstBornToSheson=1
MemBlock1=512
MemBlock2=256
Cool I will give that a try and let you know how i go, I updated my code to be a bit cleaner, so i fixed the memblock references and did some general neatening up.

Edit, have amended my code post with your suggested changes thanks heaps Sheson.
Last edited by Daetarek on 19 Jan 2014, 14:48, edited 1 time in total.

Offline
Posts: 1
Joined: 19 Jan 2014, 13:43

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Simply amazing work here. Constant CTDs were killing Skyrim for me, and I rebuilt my entire load order countless times looking for a good solution. This truly saved Skyrim in 2014 for myself, and likely many others.

After compiling this DLL I went from a CTD every 10 mins, to absolutely none. By the way, the DLL compiles and runs just fine using VS 2013.

My specs are:
Windows 8.1 x64
GTX 570 1280MB VRAM (lame, I know)
16GB DDR3 RAM
Core i7 3770k

I really cannot thank you enough Sheson for releasing this to the modding community.

Offline
Posts: 37
Joined: 12 Jan 2014, 09:51

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

As first of the newbie's to ask questions here to ask the summary on how to do this:

I'm only gonna play the game with the default ugridstoload=5 and a lot of people are looking at this thread right now and are estatic of this discovery so i'm gonna be the first newbie to make the summary of it(hopefully it is right)

1.Download the SKSE source files which is the 7z archive from the SKSE site (you can put it anywehre on a temporary folder)
2. Download Microsoft Visual C++ Express 2010 .download the free trial or just buy it(works either way) and update it to the latest untill it says updated to the latest versions
3.In your newly downloaded SKSE folder, go to src, skse, skse.snl . SKSE.snl may not have the extension showing on your computer. You can verify that this is the correct file by right clicking and viewing Properties. Your folder path should look like this --> skse_1_06_16\src\skse\skse.snl
4.open it with Visual C++ Express 2010
5.Click on the arrow next to "steam_loader" and double click on "main.cpp". Copy and paste sheson's code in the bracket starting with

InstallHook(void * retaddr, UInt32 hookSrc)

Placing the code just above

FlushInstructionCache(GetCurrentProcess(), NULL, 0);


6.Locate and change "Debug",drop down on toolbar change it to "Release" then On the left panel, locate and right click on "steam_loader" and select "Build".

7.Now create (or if you already have an SKSE.ini file just paste it there) and put it in your SKSE folder(not the plug-ins) and paste the line:
[NotPlacebo]
GiveFirstBornToSheson=1


seems Daetarek has made a new line that makes it easier to just edit the mb through the SKSE.ini rather than swapping and making a new one? so can we just replace shesons Line with Daetareks line :

the SKSE.ini lines are as follows

[NotPlacebo]
GiveFirstBornToSheson=1
MemBlock1=256
MemBlock2=256

now the question is probably if we do Daetareks lines (since it seems easier than swapping and making another file) do we still have to edit stuff in the skse.snl file or we could just tweak the 2 memblocks lines in our SKSE.ini ?


sorry if i had to repeat the process here but i think a lot of peeps here are watching and looking at this thread now and am just trying update it for total newbs like me (if it's okay with you sheson,Daetareks and etc)
_________________
I7 4770K ,@4.5GHz(OC'd) // Corsair Dominator Platinum 32gb 1866MHz // EVGA GTX Titan Superclocked 2x (SLI) // Samsung EVO 1TB 2.5" SSD, Samsung 840 EVO 500GB 2.5" SSD // Windows 8.1 Pro

Offline
Posts: 4
Joined: 19 Jan 2014, 07:41

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

sheson wrote:
Psychor wrote:Well this fix the opposite effect for me. :shock:

I haven't had a single CTD since using: (1) SafeteyLoad; (2) ShowRaceMenu Precache Killer. I compiled the DLL (as well as tried the pre-compiled DLL on Reddit in case I screwed something up), disabled SafeteyLoad, disabled ShowRaceMenu Precache Killer and ran the game. The result was a constant CTD at the character generation screen while trying to switch genders. I verified that the fix was active by checking skse_steam_loader.log.

However, if I run Skyrim with your fix and leave both SafeteyLoad and ShowRaceMenu Precache Killer enabled I don't experience a CTD. What's interesting though is that it takes longer to switch gender than it did prior to using your fix.

Sheson, any idea why your fix would be doing more harm than good for me?

Some of my settings in case it might help:
OS/Hardware=http://pc.thedigitalfoundry.com
uGridsToLoad=7
uExterior Cell Buffer=64
ENB=RealVision ENB (0.245 Boris; Wrapper)

I do appreciate your work - keep it up!
just to recap from above link. Win8 64 bit, 16GB

Things to test:
1) Turn off sfatey load but keep Precache Killer
2) Use VMMap to see if the first block is used up once in the game. If it is increase first block.

Post screenshot of VMMap if problem continues.
Sheson, thanks for getting back to me. Correct, I'm running Win8 x64 Enterprise w/ 16GB RAM.

I'm not entirely clear on what to look for in VMMap. However, I played around with the allocations a bit in the code and thus far the following code has allowed me to disable SafeteyLoad and ShowRaceMenu Precache Killer without CTD or slowdowns. It seems to have also reduced the time it takes to zone.

Code: Select all

SafeWrite32(0x00687e87+2, 0x00000400);
SafeWrite32(0x00a4e6be+1, 0x40000000);
SafeWrite8(0x004bd832+1, 0x11);
I guess the issue was that the default allocations were not enough?

I have one question though - your code comment states "//1st block, request 512MB (0x0300) instead of 256MB (0x0200)." Isn't 0x0200 512MB and 0x0100 256MB?

Offline
Posts: 29
Joined: 18 Jan 2014, 04:27

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

aldz24 wrote:snip...

now the question is probably if we do Daetareks lines (since it seems easier than swapping and making another file) do we still have to edit stuff in the skse.snl file or we could just tweak the 2 memblocks lines in our SKSE.ini ?


sorry if i had to repeat the process here but i think a lot of peeps here are watching and looking at this thread now and am just trying update it for total newbs like me (if it's okay with you sheson,Daetareks and etc)
If you create the DLL with the code i have adjusted instead of Sheson's original code you can just change the memory values via the skse.ini file, and unless Sheson or someone else comes up with some additional changes or modifications there should be no need to rebuild the DLL again. I hope this answers your question.

Offline
Posts: 37
Joined: 12 Jan 2014, 09:51

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Daetarek wrote:
aldz24 wrote:snip...

now the question is probably if we do Daetareks lines (since it seems easier than swapping and making another file) do we still have to edit stuff in the skse.snl file or we could just tweak the 2 memblocks lines in our SKSE.ini ?


sorry if i had to repeat the process here but i think a lot of peeps here are watching and looking at this thread now and am just trying update it for total newbs like me (if it's okay with you sheson,Daetareks and etc)
If you create the DLL with the code i have adjusted instead of Sheson's original code you can just change the memory values via the skse.ini file, and unless Sheson or someone else comes up with some additional changes or modifications there should be no need to rebuild the DLL again. I hope this answers your question.

:D i already made a steam.loader.dll file on my end and yes sir i created it with your code,so if a problem occurs i have an original backup for the original dll . what would be the recommended numbers though ? 256? 512?1gb?

thanks for the making an easier version though insead of rebuilding and swapping again :D
_________________
I7 4770K ,@4.5GHz(OC'd) // Corsair Dominator Platinum 32gb 1866MHz // EVGA GTX Titan Superclocked 2x (SLI) // Samsung EVO 1TB 2.5" SSD, Samsung 840 EVO 500GB 2.5" SSD // Windows 8.1 Pro

Offline
Posts: 29
Joined: 18 Jan 2014, 04:27

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

aldz24 wrote: :D i already made a steam.loader.dll file on my end and yes sir i created it with your code,so if a problem occurs i have an original backup for the original dll . what would be the recommended numbers though ? 256? 512?1gb?

thanks for the making an easier version though insead of rebuilding and swapping again :D
I would start with Sheson's original values of 1st at 512Mb and 2nd at 256Mb and then work from there as necessary, personally i am using 768Mb and 512Mb.

If i had not made the code adjustments i am sure someone else would have, and i could not of done it without some help to get it right (thanks to Sheson and Winterlove), all in all just glad to help in the end, for anyone seeing any troubles please post something, the more reports that are posted back here the better.

And of course all thanks should go to Sheson, he is the one who developed this excellent patch :D

Offline
User avatar
Posts: 64
Joined: 11 Sep 2013, 22:34

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Psychor wrote:
sheson wrote:
Psychor wrote:Well this fix the opposite effect for me. :shock:
I guess the issue was that the default allocations were not enough?
I have one question though - your code comment states "//1st block, request 512MB (0x0300) instead of 256MB (0x0200)." Isn't 0x0200 512MB and 0x0100 256MB?
Good to hear it works

1) yes it seems you have so many mods and stuff it even needs more than my anticipated value of 512MB fits all. So raising the first block seemed to help. You could use VMMap to verify how large the first block actually needs to be. I will update my OP with a more detailed description about this soon.
There is no use in pre-allocating more space than the game will later need.
Only raise the second block if skyrim doesn't start or in fact does ILS (only really high ugrids or insane number of mods/stuff in mods) while the first block is large enough.

2) You are correct, however in this case this is part of magic that this fix actually works so easily. The value is a base value to set things up, including but not limited to the size of the first block. Calculations later in the code turn the default value of 0x200 into 0x10000000 for the allocation. So it needs to be 0x100 more than what you would expect.

Offline
Posts: 31
Joined: 06 Jan 2014, 15:35

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Question: If I try to set 1GB for each block, the game won't load. If I do 1024, and 768, the game loads then crashes at the title screen.

Anyone figure out the correct "stepping" for the limits?

It seems the only stables number I can get is 768/768. Any higher and the game won't even load, or the game crashes when the title screen comes on.

Also thanks for the INI edit coding, makes things a lot quicker to test.
Post Reply