RimWorld

RimWorld

110 ratings
Fast Mod Audio Load
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5
File Size
Posted
Updated
188.551 KB
15 Dec, 2024 @ 1:33pm
17 Dec, 2024 @ 10:18pm
2 Change Notes ( view )

Subscribe to download
Fast Mod Audio Load

Description
This mod reduces load times for mods that provide additional music or many sounds.
Description

The effect of this mod differs depending on the platform. On Linux the effect is larger than on WIndows. The situation on other platform is not known.

Common

Loading of many small audio files is somewhat inefficient in RimWorld and can take several seconds for sound mod packs with hundreds of sounds. The audio loading changes in this mod appear to save up to one half of the loading time of such mods. This applies to both Linux and Windows.

Linux

When RimWorld loads audio files from mods, it loads them all during startup. On Linux, due to a mistake in RimWorld's code for Linux, they are decoded and loaded entirely. If using mods such as P-Music and Actually Vanilla Music Expansion, this can easily add about 20 seconds to game startup time (measured on AMD 8600G, Samsung 970 EVO Plus SSD). This also wastes a lot of memory, about 2.5GiB RAM for the two mods mentioned.

This mod switches loading of larger audio files from mods to streaming. Such audio files will be loaded later on demand.

Windows

The cost of loading audio from mods on Windows is relatively small (P-Music loads in ~1 second), as the Windows version of RimWorld uses different code to handle audio than Linux. It still appears this mod makes loading about 4-5x faster with music mods, so this might make a diference if they are large enough or several of them. In the comments a user reported reducing time spent loading audio files from 7.2 to to 3.9 seconds.

The only known downside to using this mod on Windows is losing support for mp3 and aiff formats. Mods should not use such formats, as that would prevent them from working on all platforms (only ogg and wav are supported everywhere).

Notes

Audio loaded using the Custom Music mod is not affected, as it uses the same streaming method.

RimWorld has built-in functionality to find out what costs the most during start. It may be useful to help you find out how to reduce you start time. See here.

GitHub: https://github.com/llunak/rimworld-fastmodaudioload
36 Comments
llunak  [author] 21 Jun @ 3:44pm 
Most likely never. The main reason for the mod, the Linux not-streaming problem, has already been fixed. And the changes are relatively intrusive for the rest. Can you still measure any significant difference with the latest 1.5?

Also, your CapsLock appears to be broken.
AzoorFox 21 Jun @ 2:58pm 
UPDATE WHEN?????????????????
晓山alreShan 22 Mar @ 8:37pm 
Be noticed, don't have # in path name.
https://github.com/llunak/rimworld-fastmodaudioload/issues/1
llunak  [author] 12 Mar @ 12:29am 
@sel: That should bring the Linux status to the Windows status, where this mod may still help when using mods with a large number of sound files.
sel 11 Mar @ 9:04pm 
In case you arent aware, from the official discord: "Version 1.5.4395 is up now on the unstable branch.
Fix: Audio clips not streaming on non-Windows platforms."
I just saw it and remembered this wonderful mod. Im not sure if that means you need to change stuff in your mod or not. Just figured I would make sure you're aware they finally (supposedly/hopefully) acted on your bug report on this from months ago.
Cheers!
llunak  [author] 30 Jan @ 1:58am 
If you can't read the description properly, even after explicitly told so, I don't know what to tell you more.
flango 30 Jan @ 1:39am 
ok, and? THIS mod causes sound issues that aren't present without it. no log errors/warnings either, so it's really hard to pinpoint the cause. if rimworld accepts the use of mp3 files for mods, then it's not the modder's fault.
at least a disclaimer would be useful for everyone checking out this mod, rather than having a single line mentioning it and then blaming other mods for it.
llunak  [author] 29 Jan @ 10:40pm 
@flango: No, it shouldn't, read the description again. It's a fault of those mods.
flango 29 Jan @ 8:42pm 
the mp3 warning should be the first line of description. spent many hours figuring out why half of the sounds in my modlist were silent.
Incursion 23 Dec, 2024 @ 11:20am 
@llunak I see, thank you for the assistance. And for the mod, of course.