Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - tangerinemusiclabs

#1
Bugs / Re: [A14] Sounds and Music Memory Loading Issues
September 21, 2016, 09:31:50 PM
Bumping this thread but I've been learning about the Unity Engine lately and discovered a possible solution to this issue.

Changing the audio load type for music files to either "decompress on load" or "streaming" would likely solve the audio-related CTD issues if it's indeed loading everything using the "compressed in memory" methodology. 

Hope this helps!  I'd try to fix it myself if I had more time.

https://docs.unity3d.com/Manual/class-AudioClip.html
#2
Quote from: Grogfeld on August 12, 2016, 08:09:32 AM
So i understand that longer songs are troublesome but is there a way to make a chain of 3 minute songs or Rimworld plays random tracks and only specific ones on events.

Random as far as I can tell.  You could just make a longer track rather than trying to chain them together with code...although at this point it's risky to include music files that sum to more than 3-5 minutes.

There's probably a way to pre-load music files in a smarter way -- say, have them load and unload prior to its playing, rather than trying to load everything into it all at once.  But it's all up to the devs now.  I think I've reached the point where I really just can't do much as a modder.
#3
Thanks for the reply.  I think it's safe to say that it's not a RAM issue since I have 32 GB and users with 16GB reporting the same problems.  My setup doesn't get a CTD, but it just stops the sound from playing.  So it's either an issue with Unity or Rimworld, for sure, but at this point I'm not sure which is the culprit.  (It's probably a combination of the sound engine and how the sounds are loaded into the game itself, is my guess.)

Either way, though, if it's experiencing issues with even 20MB of sound files that's going to be fairly limiting, even for non-music related mods.  High quality sounds/music is pretty much out of the question if the buffer for sounds are that small.

Part of the problem, I think, is that the game currently doesn't make a distinction between sound files and music files.  I understand the need to preload sound effects into the memory for immediacy, but ambient musics shouldn't really need that kind of priortization, for the most part.  Dunno if that helps or not.

The thread on the Steam Workshop, if you want to see the discussion:
https://steamcommunity.com/sharedfiles/filedetails/?id=731638290

Hope something can be done about it!  Would be great to keep on adding more stuff to the game.
#4
The mod has been updated with smaller length track sizes.  (I broke them up into smaller chunks.)  If anyone is still having issues, please let me know!  Trying to see if it's a song length or file size issue.
#5
Quote from: skyarkhangel on August 09, 2016, 04:28:06 AM
Quote from: tangerinemusiclabs on August 09, 2016, 04:16:08 AM
Damn, if it's preloading everything into the memory at mod load, there's not much I can do, is it?  I've already reduced the quality down to as far as it'll go.

I think you need to split music with max. 1.5-3 min. each.

Aw, that sucks.  But yeah, the 3 minute track works just fine, while the longer ones have more trouble loading.  Having to split it up this way does put a damper on things, though. :-\
#6
Bugs / [A14] Sounds and Music Memory Loading Issues
August 09, 2016, 04:36:17 AM
I've been making a mod that puts additional background music into the game, but I've run into some issues where the mod loading behavior has been causing some CTD issues for some people.  I think it's because the Unity engine pre-loads all the sound files (music or otherwise) into its memory and if it's too big, then it just quits altogether.  The code of the mod itself is straightforward so I think that it has to be the file size or file type that causing it.

The soundtracks that I made for the mod is fairly long, so it may be part of the reason why it crashes on some people's machines, especially on older builds.  (20+ minutes for one) But I'm not exactly sure what the recommended format, bit-rate, VBR/CBR etc. are for music files, and if there are hard limits that should be avoided in order to make the mod work.  The bizzare thing is that it works fine on my machine -- sometimes -- other times the song just doesn't want to seem to load at all.  Sometimes I hit the "play song" button in the debug menu and nothing plays.  If I restart the computer and try again, sometimes it works.  (No CTD yet, but I do have a lot of physical memory on my computer that others might not have.)

I think it's definitely related to the memory because it plays my 3 minute song just fine, but has trouble with the 20 minute ones.

If anyone here happens to know how to pinpoint in the problem, it'd be greatly appreciated too.  Seems like there ought to be an easy solution to it if it were possible.

Mod is here, for reference:
http://steamcommunity.com/sharedfiles/filedetails/?id=731638290
#7
Damn, if it's preloading everything into the memory at mod load, there's not much I can do, is it?  I've already reduced the quality down to as far as it'll go.
#8
Quote from: biship on August 08, 2016, 03:26:59 PM
I see steam users reporting crashes with this mod.
I don't know if this will help you, but from another music mod (that works perfectly), they used this audio format:

General
Complete name                            : D:\SteamLibrary\steamapps\workshop\content\294100\725130005\Sounds\Neverforgotten.ogg
Format                                   : Ogg
File size                                : 12.5 MiB
Duration                                 : 3 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 450 kb/s
Writing application                      : FL Studio

Audio
ID                                       : 21367 (0x5377)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 3 min
Bit rate mode                            : Variable
Bit rate                                 : 450 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 12.5 MiB (100%)
Writing library                          : libVorbis (â›,,â›,,â›,,â›,,) (20150105 (â›,,â›,,â›,,â›,,))


Thanks for the info.  Yeah, it was the complaints on the workshop that prompted this issue.  I think it might be something related to the length of the songs (most of them are 20 minutes long) so I have to try to keep the file sizes very low, I think.

Do you know if Rimworld loads all of the sounds in memory right at the load of the mod itself?  Not the best way to handle sound files, but if that's the case it would make sense why people have been experiencing crashes on their end.
#9
Hmm, didn't know .ogg was a better format for Unity.  Guess I can give it a try.  There's so little code in the mod itself the culprit has to be the file itself, I think.

Guess I'll have to lower the quality of the files for now until either the Unity or the Rimworld team makes some tweaks.  I know memory leakage has been an issue in the game in general so it seems to make sense.

Hope you enjoy the mod!  It's been a lot of fun making music for games in this way. :)
#10
Adds hours of additional ambient music to the game, all original works improvised on the spot. (It's a jam!) Style is a mix of Tangerine Dream, Ambient Music, IDM, and a little bit of classical here and there. Most tracks are 15-20 mins+ for longer immersion. Current version has about 40 minutes of music, with the final being planned to be around 2-3 hours.

Visit our YouTube playlist for free streaming: http://youtube.com/user/tangerinefm

Steam Workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=731638290

Note: I've been getting reports of this mod crashing the game when loaded from the Steam Workshop, which I'm unable to reproduce on my end.  Is there a size limit to the sound files that can be in-game?  (Some are over 20 mins long, so 20MB+ MP3 files in some cases.)  If anyone has any idea what it could be, please let me know.  There's very little code in the mod itself, so I figure it must be something related to Steam or something else.

Github: https://github.com/rtanaka1981/tangerinemusiclabs_rimworld

[attachment deleted by admin - too old]
#11
Quote from: 1000101 on July 29, 2016, 07:37:21 PM
Actually, RimWorld uses NAudio and NVorbis for audio.  So it's what that set of libraries supports.

Awesome!  That's the info I was looking for.  This'll make conversion much easier. :)  Thanks for the help!
#12
Yes, this thing, right?  Unfortunately it's still not enough info -- it doesn't say anything about bit-rate and constant vs. variable encoding, etc.

https://docs.unity3d.com/Manual/AudioFiles.html

Looking at how the engine works, though, it seems that it keeps these audio files into memory so the problem might be that it's conflicting with other processes as part of the game.  (The files are relatively large.)  I suppose I'll have to experiment with using lower quality audio.
#13
Hi all, I've recently made a mod called Ambient Jams that adds extra music to the game's soundtrack.  Unfortunately I've been having issues with the songs not playing all the time which I think is related to the codec I'm using.

Is there a documentation somewhere that lists the recommended/supported sound formats on there?  There's .OGG, .MP3, and .WAV I know, but more specifically, I need the bit-rate, if it's CBR/VBR, and sample rate, etc.  I'm trying to keep the file size of the mod itself as low as possible, as well.