RimWorld

RimWorld

Fast Mod Audio Load
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.
llunak  [author] 23 Dec, 2024 @ 10:42am 
@Incursion: The only audio-related line there that I can see is "28464.729ms (49%) (self: 2.420 ms) 558x Reload audio clips". So your startup spends 28 seconds loading audio without this mod. Also since the toplevel times with and without this mod are 110437.125ms and 140810.317ms, that suggests that my mod saves you about half a minute of startup time.
Sup 23 Dec, 2024 @ 9:38am 
Thanks to this mod, the work on the steam deck increased much faster.:steamthumbsup:
Incursion 23 Dec, 2024 @ 9:19am 
@llunak Alright, I followed the same formula as your reddit post, here is some of the lines from the logs that were generated. Both with this mod enabled and without: (https://pastebin.com/bpT5rLNN)

If need be, I could upload the entire log file.
llunak  [author] 23 Dec, 2024 @ 1:14am 
@Incursion: It is in the normal log file after you enable the verbose logging according to the instructions linked from the mod description. The location of the log file is shown by a button somewhere in the RimWorld options. But on my Linux it is simply in /tmp.
Incursion 23 Dec, 2024 @ 12:31am 
@llunak Ah, I see, that makes sense then. I definitely did get the FMOD bug confused with the unoptimized code that this mod fixes, my apologies.

Regarding the logging, where can I find the verbose logging file for the game? (Or enable it if it isn't already) Thanks
llunak  [author] 22 Dec, 2024 @ 10:50pm 
@Incursion: You are mixing things, trocapalot was talking about the FMOD bug. As for the mod saving you only 2 seconds with P-Music on Linux, I'd like to see the measurement from RimWorld's verbose logging on that - Ludeon has not published a fix for the bug yet, your machine is unlikely to be 10x faster than mine, so you possibly made a measurement error.
Incursion 22 Dec, 2024 @ 4:07pm 
@trocapalot My results concluded the same. My high spec-machine (intel i9 13900k, 32gb ddr5 6000mhz ram) got 4 minutes and 11 seconds to boot with mod Without the mod, I got 4 minutes 13 seconds.

Tested on Linux, arch in particular. Also using the same P-Music mod that the author used, as well as your enhanced sound mod, troapalot.

Used my modlist consisting of 577 active mods in total.
trocapalot 19 Dec, 2024 @ 3:40pm 
@polat.cal, @llunak, it's an unfixable error, some users with my mod experience the same error and it has to do with Rimworld using an outdated FMOD plugin for audio, only Ludeon is able to fix this, leading to an incompatibility with audio mods.

From my testing it seems that powerful machines are mostly unaffected by this. I guess this has to do with the amount of processing power, avoiding the freezing problem and managing to close the game anyways. A temporary workaround is to close Rimworld with Task Manager.
llunak  [author] 18 Dec, 2024 @ 9:48am 
@polat.cal: I don't know, I don't see the problem here. Try without this mod and see.
llunak  [author] 18 Dec, 2024 @ 9:46am 
@sel: Interesting, thanks for the update. I have just noticed that I previously used a different sound mod pack that you did, the right one actually has 728 audio files. It probably cannot get much better than 2ms per file without a lot of work, so I'll leave it at that.

And I actually do not use mods with many small audio files myself, so I'm glad it helps you ;).
polat.cal 18 Dec, 2024 @ 9:42am 
First of all, thank you for this amazing mod.

And If I come to my problem - when I try to exit Rimworld - player.log just keeping spamming and gives this error.

C:\buildslave\unity\build\Modules/Audio/Public/sound/SoundChannel.cpp(393) : Error executing m_FMODChannel->stop() (The specified channel has been reused to play another sound. )
(Filename: Line: 15)

Could it be related to your mod? Thanks @Ilunak
sel 18 Dec, 2024 @ 5:59am 
- - - 3921.293ms (3.7%) (self: 1.653 ms) 188x Reload audio clips
- - - - 1567.221ms (40%) (self: 1567.221 ms) Loading assets of type UnityEngine.AudioClip for mod Bonible.Modded.Gun.Sound.Pack
- - - - 441.271ms (11%) (self: 441.271 ms) Loading assets of type UnityEngine.AudioClip for mod VanillaExpanded.VPsycastsE
- - - - 406.545ms (10%) (self: 406.545 ms) Loading assets of type UnityEngine.AudioClip for mod CP.RimmuNation.2.Weapons
Pmusic is down to 66 MS, its so far down the list now I cant include it, or the text would exceed the steam comment size limit.
for reference this is on an SSD, a WD blue 1tb, amazon says the read/write is 560mb/s and 530 mbs, respectively. with 460 GB free to use, I recall remaining space changing performance.
Your changes seem to be working, we went from 7,200 MS to 3,921 MS. Hope this helps you
llunak  [author] 17 Dec, 2024 @ 10:26pm 
@sel: Can you please try again? I got curious about that 2.3s for the gun sound pack. It contains 237 small sound files (=10ms/file), so streaming does not help. But the Unity API for loading audio files seems rather dumb for local files, I have reworked the code a bit, and that reduces the time to process them all. However it was noticeably faster than your time already before (either Linux or my SSD is faster at loading I guess), so I don't know how much it can help you.
sel 17 Dec, 2024 @ 10:36am 
- - - 5805.482ms (24%) (self: 1.429 ms) 188x Reload audio clips
- - - - 2363.560ms (41%) (self: 2363.560 ms) Loading assets of type UnityEngine.AudioClip for mod Bonible.Modded.Gun.Sound.Pack
- - - - 608.671ms (10%) (self: 608.671 ms) Loading assets of type UnityEngine.AudioClip for mod CP.RimmuNation.2.Weapons
- - - - 605.334ms (10%) (self: 605.334 ms) Loading assets of type UnityEngine.AudioClip for mod VanillaExpanded.VPsycastsE
- - - - 360.573ms (6.2%) (self: 360.573 ms) Loading assets of type UnityEngine.AudioClip for mod Dubwise.Rimatomics
- - - - 215.162ms (3.7%) (self: 215.162 ms) Loading assets of type UnityEngine.AudioClip for mod Peppsen.PMusic

Figured I'd try the mod because ~5 seconds less loading sounded pretty nice.
These are the results with your mod, thats quite a big improvement on P-music's load time. Not quite 5 seconds in total, but still, any amount of less loading is better than more time spent waiting.
Nice mod, and thanks for sharing it.
llunak  [author] 17 Dec, 2024 @ 10:01am 
@sel: Thank you for the information, it's good to see this tested for real.

It has been meanwhile pointed out to me that the Windows RimWorld version uses different code to handle audio (something called RuntimeAudioClipLoader), so that explains the difference.

As for not needing the mod on Windows, it's not a big difference, but it appears that my mod still loads audio somewhat faster than the numbers you have provided. I can load P-Music in ~250ms compared to your ~1100ms, and your CPU is a little bit faster than mine. So presumably you could save ~5 seconds of startup time for all the audio you use, if that would matter to you. I'll change the mod description and let people decide.
ferny 17 Dec, 2024 @ 7:11am 
I'll do my own testing soon
ferny 17 Dec, 2024 @ 7:10am 
According to Zaljerem it appears to have little effect on Windows
sel 17 Dec, 2024 @ 6:07am 
And I would assume there is no memory usage issue with the music mods, at least on windows, Ive at least never noticed any excessive memory usage in my years of playing with music mods enabled.
sel 17 Dec, 2024 @ 6:05am 
Hey, I run windows 10 and I did the verbose logging thing, its hard to read, but from what I can tell this issue does not exist on Windows versions.
- - - 7275.280ms (28%) (self: 1.573 ms) 187x Reload audio clips
- - - - 2661.048ms (37%) (self: 2661.048 ms) Loading assets of type UnityEngine.AudioClip for mod Bonible.Modded.Gun.Sound.Pack
- - - - 1128.518ms (16%) (self: 1128.518 ms) Loading assets of type UnityEngine.AudioClip for mod Peppsen.PMusic
- - - - 774.085ms (11%) (self: 774.085 ms) Loading assets of type UnityEngine.AudioClip for mod VanillaExpanded.VPsycastsE

You can see PMusic only takes up 1128 MS which is around ~1 second, much less than the 15,000 MS you experienced on Linux.
If giving you my specs helps at all, Im using a ryzen 9 7900 CPU, with a NVIDIA RTX TITAN GPU. I've 64 gigs of ram, and 72 gigs of VRAM, while the log says its using 24225 MB of Vram.

I havent tried your mod by the way, as it seems I dont need it
llunak  [author] 16 Dec, 2024 @ 7:46pm 
I have tried running the Windows version on Linux, and I cannot see the problem there. So it is possible the problem does not exist there, for whatever strange reason (I have checked and the Windows version does not use audio streaming by default either).
llunak  [author] 16 Dec, 2024 @ 2:42am 
Could somebody using Windows please check if the issue exists there as well? See one of the links for how to measure startup time, and I assume there is some way in Windows how to compare memory usage of running RimWorld with and without this mod. The numbers in the description are on Linux.

For the Music on the Rim mod there are comments complaining about its memory usage (it should be almost 4GiB more by my estimate), but the mod author commented that it does not happen on Windows. I doubt there is any difference, but I'd like to know.
Vulkandrache 15 Dec, 2024 @ 10:52pm 
I dont need extra functions to figure that out.
350 mods explains more than enough.
I just found it funny to read something about 20 seconds.
llunak  [author] 15 Dec, 2024 @ 10:27pm 
@Vulkandrache : Mine now takes 36 seconds *shrug*. Also, see the info I have added to the description.
Vulkandrache 15 Dec, 2024 @ 9:05pm 
An extra 20 seconds?
My game takes about 5 minutes to load anyways.
ferny 15 Dec, 2024 @ 9:00pm 
Great work
ferny 15 Dec, 2024 @ 8:55pm 
YOOOO This is fucking awesome! I can actually release my giant music mod