Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crash while loading
#8
So I found the issue, and it turns out that sound files are to blame.
Basically LF2 has an array of sound file names. Each sound file is at max 19 characters long (which means that it takes 20 bytes to store its name due to null-terminated strings).
There are a max of 400 sound files in total, loading more than that will cause memory that is not associated with sound files to be overwritten causing weird things to happen.
In this case NTSD was sitting at 400 sound files loaded, and along comes two more sound files from a new character and a pointer to some data to with sprites gets overwritten, so when LF2 tries to load a new sprite, everything comes down burning.

If you look at some of the sound files you may notice that they have names that are longer than 19 characters (for example "data\SNDDATA_2377.wav"). In this case its name will take up some space from the next sound file, and when the next file is then loaded it will invalidate the previous name, so if a data file tries to use it, the sound file will be loaded again.
tl;dr of previous paragraph: Having names longer than 19 characters may cause a sound file to be loaded twice.

So the way to solve this would be to reduce the length of the sound file names.
Specifically "data\SNDDATA_1926.wav", "data\SNDDATA_2133.wav", "data\SNDDATA_2275.wav", "data\SNDDATA_1911.wav", "data\SNDDATA_0552.wav", "data\SNDDATA_1317.wav", "data\SNDDATA_1325.wav", "data\SNDDATA_1330.wav", "data\SNDDATA_1860.wav", "data\SNDDATA_1862.wav", "data\SNDDATA_1883.wav", "data\SNDDATA_1885.wav", "data\SNDDATA_1886.wav", "data\SNDDATA_1922.wav", "data\SNDDATA_1955.wav", "data\SNDDATA_2052.wav", "data\SNDDATA_2058.wav", "data\SNDDATA_2063.wav", "data\SNDDATA_2138.wav", "data\SNDDATA_2150.wav", "data\SNDDATA_2274.wav", "data\SNDDATA_2283.wav", "data\SNDDATA_2308.wav", "data\SNDDATA_2320.wav", "data\SNDDATA_2328.wav", "data\SNDDATA_2352.wav", "data\SNDDATA_2359.wav", "data\SNDDATA_2367.wav", "data\SNDDATA_2373.wav", "data\SNDDATA_2380.wav" and "data\SNDDATA_2382.wav" seem to be loaded multiple times, specifically the first four are loaded thrice while, the rest of them are loaded twice.
You would also need to update the data files to reflect the name change of the sound files.

@Doctor A: Could you write a tool to automate this change? I am too lazy to do it myself.
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply


Messages In This Thread
Crash while loading - by T.O.R.N.A.D.O - 07-20-2015, 03:23 PM
RE: Crash while loading - by Rhino.Freak - 07-20-2015, 03:39 PM
RE: Crash while loading - by STM1993 - 07-20-2015, 04:43 PM
RE: Crash while loading - by Rhino.Freak - 07-20-2015, 05:03 PM
RE: Crash while loading - by T.O.R.N.A.D.O - 07-20-2015, 05:07 PM
RE: Crash while loading - by A-Man - 07-20-2015, 05:16 PM
RE: Crash while loading - by Rhino.Freak - 07-20-2015, 05:19 PM
RE: Crash while loading - by Som1Lse - 07-21-2015, 06:28 AM
RE: Crash while loading - by A-Man - 07-22-2015, 11:58 AM
RE: Crash while loading - by Rhino.Freak - 07-21-2015, 09:12 AM
RE: Crash while loading - by Som1Lse - 07-21-2015, 10:20 AM
RE: Crash while loading - by T.O.R.N.A.D.O - 07-21-2015, 02:24 PM
RE: Crash while loading - by Rhino.Freak - 08-02-2015, 12:47 PM



Users browsing this thread: 1 Guest(s)