How to play without freezes/lag - guide

Tips on optimizing the game

Everyone knows the problem of this game - if you zoom in a big battle you can see so-called freezes(short pauses) in the game.
For a long time I could not understand why this is happening, the search for a solution to this problem does not lead to the expected result.
Until I accidentally renamed the folder "Sound" located in the game directory - and lo and behold!, the decision came by itself...
 
1. --- How to check that it works ---
Open the game installation folder and just rename the folder "Sound" well, for example in "Sound_123".
Then run the game and load the save where the game before was broken i.e. with freezes and see that they are no more, as well as sound.
So now in the game along with the lack of lag there is no sound!
And what are we going to do? Play without sound? Oh, no.
We know that this game supports 3 audio format: OGG, MP3 and WAV.
The first two use compression, whereas WAV does not use - it is something we need...
I think it is clear that now we need to convert all sounds from OGG format to WAV format.
2. --- Solution ---
Download any audio converter than can use batch convert for example Power MP3 WMA Converter (it's free http://www.cooolsoft.com).
Create "Sound_wav" folder
Convert all "ogg" files (1608) from "Sound" folder in the game directory to "wav" in "Sound_wav" folder
("C:\Program Files (x86)\Steam\steamapps\common\Sins of a Solar Empire Rebellion\Sound")
It's about 5 minutes to convert all files and size of all files about 2,8 Gb (but it's worth it)
Then create "rename.txt" file in "Sound_wav" folder and put this line:
ren *.wav *.ogg
Save and rename it to "rename.bat"
Launch this file and than you can delete it.
Now all our "wav" files has an "ogg" extension (as default game sounds).
So, at the end put "Sound_wav" in game directory and rename as "Sound"
(don't forget create a backup of original "Sound" folder just renamed it).
69,441 views 12 replies
Reply #1 Top

hmmm. will have to test this. 

I assumed .ogg files were compressed to save ram, but the compression could be causing a load problem.

I also recommend maybe doing this as a mod. Doing any verification may undo the changes where if the sounds exist in the mod that is where they are loaded from.

Bookmarked  B)

Reply #2 Top

I think that WAV format reduce CPU load because it's not needed to decode/decompress sounds.

And I test this solution on different saves where a battle was lagging and always there is no lag anymore.

With or without 4 GB patch the game will not crashing or something else. But it need testing for a long time.

Reply #3 Top

Does not work!

File rename.bat does not work, the files remain in the wma format and in a game they are not working, no sound!

Reply #4 Top

Quoting KorsakSD, reply 3

File rename.bat does not work, the files remain in the wma format and in a game they are not working, no sound!

This file just rename extension of all converted wav files. It 100% work, just tested.

It don't work because you launch this file from Administration rights!

It's no needed!!! Just double-click on it...

Reply #5 Top

That's not renames them, the files remain in the wma format!

Reply #6 Top

And these files to replace the original files in the Sound folder after I'll put them there?

I have have simply remained in a format wma and were located near to original! O_o

Reply #7 Top

Ok. Another way.

 

Create folder Sound on drive C and put there all converted wav files.

 

Launch command line. Start -> Run -> cmd

 

Then write:

 

cd C:\Sound (and press Enter.) Now it's in Sound folder.

 

Then write:

 

ren *.wav *.ogg (press enter)

 

Rename original sound folder to Sound_ogg.

 

At the end copy your Sound folder that place on drive C to game directory where the original folder was placed.

 

 

 

 

 

Reply #8 Top

You'l need WAV format - not WMA!!! Only WAV!

 

It's different audio formats - not the same.

 

Reply #9 Top

Quoting myfist0, reply 1

I assumed .ogg files were compressed to save ram, but the compression could be causing a load problem.

Sounds plausible. If that is the case the quickest & most significant gain would be to convert frequently played, small, sounds from .ogg to .wav format - weapon/ability effects and engine loops spring to mind, especially as several play at the same time.

Music maybe a factor but that tends to be large and only one tune plays at a time, so conversion may not save much CPU load (but could use more RAM).

Converting dialogue sounds (unit orders and GameEventSounds) probably would have the least benefit as thy are heard comparatively infrequently.

If anyone uses Cygwin then the 'sox' command can be used to convert from one format to another.

Eg: Convert SOA2's Borg mantra :borg:

$ sox BORG_Effect_WeAreTheBorg.ogg BORG_Effect_WeAreTheBorg.wav

This does show that .ogg is compressed when compared to .wav - 111kB for .ogg versus 1.4Mb for .wav.

However, unless .ogg's can be sent directly to the OS's audio subsystem (like some texture formats can be loaded directly by video drivers) this difference may not reflect an increase in RAM usage as Sins would have to uncompress the .ogg into a larger memory buffer (to store the compatible format) before playing. So converting from .ogg to .wav may not be that bad in terms of memory usage.

After all .oggs may have been chosen to reduce the size of the stuff written to DVD (back in the old days) or to reduce the size of the download via Steam (or Impulse, again back in the old days)

 

Reply #10 Top

I for sure wouldn't do music in wav format but there might be value in converting smaller sound effects.

I'll give it a try too. Audacity can batch convert ogg to wav and it should be simple enough to convert the non-music to wav format.

 

Reply #11 Top

Yes, confused, not in a format convert! Everything works, thank you :)

Reply #12 Top
I think I just found the answers to some questions.
Everything in order:
 
Q: Why they (developers) used OGG format?
A: Because it's 1) open audio format, 2) has less audio files size 3) gives normal sound quality (at 2008 year)
 
Q: Why are the WAV format provides best performance?
A: 1) Sounds on WAV format don't require decoding/decompression when playing, so we can see reducing CPU load.
 
Q: Why game is lagging when it's using OGG format?
A: Because they (dev team) use very old coder libvorbis v1.1.0 (Xiph.Org libVorbis I 20040629) where 2004 06 29 is a release date! When the game was released in 2008! Possibly came from original Sins?
I found this information at info panel in foobar 2000 v1.3.10 when I opened original ogg files. You can see  libvorbis coders change log at this page: http://svn.xiph.org/trunk/vorbis/CHANGES
There are many optimizaitions, bug fixes, capability improvements were made after version 1.1.0... Now the actual version of libvorbis is 1.3.5 (2015-03-03) -- "Xiph.Org libVorbis I 20150105"
But I don't found any information what version of libvorbis.dll they used, but I think it's outdated too.
A: Also if you set the parameter value "SoundUseHardware" in rebellion.user.setting from FALSE to TRUE - it's don't work properly(you can hear a crackling in the battle), that means the game engine does not fully support new sound cards, that can decode OGG format and other on the fly.
It still use Software algorithm to decode sounds, that also create additional load on CPU, that's why it's lagging. The more sounds, the more load.
 
So, if the developers will change libvorbis 1.1.0 coder to Lancer 20061110 (https://web.archive.org/web/20100217183320/http://homepage3.nifty.com/blacksword/),
that support SSE SSE2 SSE3 instructions and even Multi-threading technology - the situation may change radically )))
Besides all ogg coders are open and all necessary documentation and files are available.
This is my opinion. And now we can use the wav format with an ogg extension.