Project Zomboid

Project Zomboid

Multi-Cpu Enhance *FIXED*
Additional steps and a manual configuration without a script.
TLDR

- Install "Better FPS" mod (manually, as instructed on the workshop page).

- Install "Every Texture Optimized" mod.

- Turn ON "Texture Compression" - Skip for now. Recommended only if you experience unreasonable stutters, crashes, freezes or simply monitor your VRAM consumption via software like the RTSS + MSI Afterburner.

- EITHER Simply change "-Xmx" line in your ProjectZomboid64.json to 6g or 8g (no mods/few mods), up to 12g (for all but the gigantic modpacks), 16g (if absolutely necessary).

"-Xmx12g",

Do not forget the commas! And that it goes in the "vmArgs" block!

OR Copy this and replace your whole "vmArgs" block with this. Please read notes below the provided code:

"vmArgs": [ "-Djava.awt.headless=true", "-Xms8g", "-Xmx12g", "-Dzomboid.steam=1", "-Dzomboid.znetlog=1", "-Djava.library.path=linux64/:.", "-Djava.security.egd=file:/dev/./urandom", "-XX:+UseG1GC", "-XX:-OmitStackTraceInFastThrow", "-XX:MaxGCPauseMillis=50", "-XX:+ParallelRefProcEnabled", "-Dzomboid.maxthreads=4" ] }

This copy-paste block is totally optional, it's my config. The real value here is the Xmx line only.

Please do not forget to configure Xms (minimum) and Xmx (maximum) lines according to your system's availability of RAM!!!

Also, you can change the last line to "maxthreads=6", or any other number, actually. But it likely won't make a difference. 4 is safe choice. Reason for this line is to limit the game to it's natural capabilities, just another barrier for stability, since the game practically is unable to use more than about 2 threads anyways.

Yapping about VRAM
VRAM of your GPU could be the main issue that makes the game unplayable and prone to crashing. Monitor it, if it hits the limit, or near-limit (like 11.7GB out of 12GB) - it's a problem. The tips I provided above were small things, except for RAM allocation (extra important). But then I discovered that the setting "texture compression" in game being turned off (as instructed by many modders) was exactly the issue that caused the insane VRAM usage. If you have few mods that add their own textures, you could get away with not using texture compression (especially with the mod "Every Texture Optimized"), but supposedly main downside of using texture compression is loss of detail. Some modders pre-compress their own mods' textures, which is ideal, but does not work when you have other mods with raw textures.

As I mentioned previously: Turn on texture compression if you experience unreasonable stutters, crashes, freezes. Monitor your VRAM consumption via software like the RTSS + MSI Afterburner, if you'd like to make sure that the source of the issue is the VRAM capacity.
最后由 ★ John Security ★ 编辑于; 10 月 17 日 上午 4:06
< >
正在显示第 1 - 15 条,共 20 条留言
STORMFANG 9 月 12 日 上午 11:40 
do i need the original copy from pz or the one from the CPU mod file
引用自 STORMFANG
do i need the original copy from pz or the one from the CPU mod file

Just use the default ProjectZomboid64.json that you have in your game folder. As mentioned above, do not duplicate the lines that already exist in there. You should have "Xmx" and "UseZGC" by default, so just change their values.

Other lines are probably not there though, so you gotta add them in.
STORMFANG 9 月 12 日 上午 11:52 
ohh' so do i still need to copy the code from this mod or just one you show?
引用自 STORMFANG
ohh' so do i still need to copy the code from this mod or just one you show?
Most of the code from this mod is irrelevant, as well as most of the lines I gave. The difference is that you do not need no third-party .bat file launching on your PC. The lines I gave MIGHT result in more stability, less stutters.

The ONLY important line is "Xmx", which defines the amount of RAM you want the game to be able to use. So - no, no need for the mod. Just use the few lines I provided here.
STORMFANG 9 月 12 日 下午 12:11 
引用自 STORMFANG
ohh' so do i still need to copy the code from this mod or just one you show?
Most of the code from this mod is irrelevant, as well as most of the lines I gave. The difference is that you do not need no third-party .bat file launching on your PC. The lines I gave MIGHT result in more stability, less stutters.

The ONLY important line is "Xmx", which defines the amount of RAM you want the game to be able to use. So - no, no need for the mod. Just use the few lines I provided here.
thank you i''ll try it as soon as i can thanks for the instruction
FearDoirich 9 月 12 日 下午 4:16 
attempting this while monitoring resources to confirm.
Ciao Maihog 9 月 20 日 下午 12:49 
Thank you! For a noob like me, is it possible to post the full text of what should be listed with the corrections above applied? So I can copy and past the whole thing into the file? Then I can adjust the values for my rig.
引用自 Ciao Maihog
Thank you! For a noob like me, is it possible to post the full text of what should be listed with the corrections above applied? So I can copy and past the whole thing into the file? Then I can adjust the values for my rig.

My current config in the ProjectZomboid64.json on a pretty damn strong rig with 32 gigs of RAM and good top-ish range CPU with 400> mods and x2 population looks like this:

"vmArgs": [ "-Djava.awt.headless=true", "-Xms8g", "-Xmx16g", "-Dzomboid.steam=1", "-Dzomboid.znetlog=1", "-Djava.library.path=linux64/:.", "-Djava.security.egd=file:/dev/./urandom", "-XX:+UseG1GC", "-XX:-OmitStackTraceInFastThrow", "-XX:MaxGCPauseMillis=50", "-XX:+ParallelRefProcEnabled", "-Dzomboid.maxthreads=6" ] }

That is not the full contents of the .json, but just the important and configurable "vmArgs" part. I got a lot of mods and so I had to put "-Xmx16g", so far no crashes, but there are rare stutters.

Also important to note is that even without mods the game can eat A LOT of VRAM without "texture compression" turned on. Which was the main cause for ALL the crashes and freezes and stutters when I had all 400> mods with a 12 gig VRAM GPU. Some modders tell to "turn off texture compression", but even with "Every Texture Optimized" mod for vanilla textures - the game still eats all 12 gigs of VRAM for me.

Upon some research, I figured out that the texture compression slows down loading into the save (or so I noticed) and supposedly reduces the texture quality, especially in small details. But it reduces the VRAM consumption DRAMATICALLY, which fixed the performance that was making the game unplayable.

引用自 FearDoirich
attempting this while monitoring resources to confirm.

Please do not forget that VRAM could be the main cause of dramatic performance issues. I could not get rid of constant stutters and low fps until I turned on texture compression, despite many modders saying to turn it off.
Ciao Maihog 9 月 20 日 下午 1:47 
Thank you very much sir! And especially for such a quick response!
Ciao Maihog 9 月 20 日 下午 1:58 
Looks like I may have a similar setup. New OC rig with high-end AMD processor, 32 gigs RAM, 5080 w/16gig vram, tons of mods enabled. I'll try the exact setting you have with the texture comp on and then off to look for the performance delta. Again, many many thanks!
Just keep in mind that upon loading new cells it may tank the performance. After things settle down though, and especially if you are not with high population in Louiseville, you'll get back to stability.

My case was dips to an average of 90 fps with stutters when driving fast within the city. A high vehicle count and zooming out does not help. But within a minute, walking in farmland is now a consistent 150> fps at all times. That is even with lighting update being set at 60.

Better FPS mod is a big contributor. It shrinks your actual physical render distance (outside your view). I have generation older PC btw.

Anyways, I'm stopping the yap. Be sure to come back with results!
Kenpa 9 月 28 日 下午 5:50 
@★ John Security ★ Thank you for taking the initiative to step in and help out. Your suggestion is the proper way to do this.
The Don 10 月 2 日 上午 12:09 
Doesn't seem to work, my process doesn't go above 3gb (reported in task manager) with Xms at 8g and Xmx at 12g.
引用自 The Don
Doesn't seem to work, my process doesn't go above 3gb (reported in task manager) with Xms at 8g and Xmx at 12g.

1. If the game does not need more, especially with no mods installed, then it may not even bother using as much.

2. Check if you actually pasted it right. It should under the "vmArgs" block, along with the other lines.

3. Check if you did not miss a symbol, a comma or a quote sign, and that every character is exactly what it has to be.

4. Try using the megabyte unit, instead of a gigabyte. Examples for 12g:
"-Xmx12288m",

5. Make sure you modify the ProjectZomboid64.json for a 64-bit OS, or ProjectZomboid32.json for 32-bit OS. If unsure, just modify both.

6. If you are certain that none of this works: delete the .json file, then verify the game files integrity via steam's library, thus restoring a default, untouched .json file. Because the issue might be that you just don't see a tiny little character, or the lack of one, that prevents the lines from being read properly. Now carefully modify the "Xmx" line to the desired value.

I think that's all the steps. Maybe save it and make sure it's saved by re-opening it, as well as do it all with a closed game. If these steps do not fix an issue, and if there IS an issue with performance and the reason for it being the lack of RAM, then there is something more unusual at play. Which is something you'll need to find out yourself.
ivmakk 10 月 13 日 下午 12:57 
What the original mod config does for FPS is adjust RAM usage based on what you have in your system to more optimal values (by default in game used ~1GB RAM which too low for heavy modded gameplay). Setting a high minimum RAM like “-Xms8g” isn’t safe — in my initial tests it caused random crashes (not saying it’ll happen to everyone, as it depends heavily on your specs, but I’d rather stick with the original ranges). In my case, I have >16GB RAM, and using Xms=4096m caused no crashes (that's what mod config apply).

- Turn ON "Texture Compression" and/or install "Every Texture Optimized" mod.
As a modder and pixel-art asset author, I’d actually recommend doing the opposite — keep it OFF if you have enough VRAM. Otherwise, you’ll get a noticeable anti-aliasing/washed-out effect on many 2D vanilla icons. It has zero FPS impact unless you’re on a budget or laptop GPU with very limited VRAM.

“Every” possible retexture mod will likely have the opposite effect — it’ll slow down save loading and may even reduce FPS further. If you trust the retexture author, give it a shot, but be prepared that it might do the opposite. Vanilla assets are already quite well optimized, and the game automatically applies optimizations to use smaller assets based on your specs.

UPD: Found that it was a reference to [B41/B42] Every Texture Optimized instead of “every”. Haven’t tested it myself to tell if it has any impact, but as a rule of thumb — it’s only worth using reduced textures if you know for sure that you’re limited in VRAM.

VRAM of your GPU could be the main issue that makes the game unplayable and prone to crashing.
The game is literally CPU-heavy due to the Java engine; GPU has a smaller impact on FPS when CPU, disk, or RAM becomes the main bottleneck in heavily modded gameplay. So using an SSD, better CPU and a proper RAM setup will give you better performance in most cases without stability issues.

While I don’t fully understand every runtime argument since I’m not deeply familiar with the JVM runtime, the conclusion still seems wrong on the listed points.

P.S. This is based on my many performance tests on B42 after many hours of debugging the game engine and mod performance optimizations. I could be wrong about some statements if you’re on B41.
最后由 ivmakk 编辑于; 10 月 13 日 下午 1:27
< >
正在显示第 1 - 15 条,共 20 条留言
每页显示数: 1530 50