[Fixed] Limit of $randoms in SNDINFO

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Limit of $randoms in SNDINFO

Postby theleo_ua » Thu Sep 29, 2016 8:46 pm

There are some cases, when you reach the limit of $random-type sounds in sndinfo, so adding any new $randoms will make zdoom hang during loading a level

Here is an example of a test mod: https://drive.google.com/file/d/0BygbyP ... sp=sharing

Put heretic.wad to ZDOOM\DOESNT_WORK folder and run TESTMOD_RANDOM_SOUNDS.BAT

You will see that zdoom hangs during loading

Then try to edit WADS\Z_SOUNDS\Z_SOUNDS__ORIGINAL.pk3 file: unpack it, open SNDINFO.__BLOOD file and remove (or comment) next lines:

Code: Select allExpand view
$random blood_ua_TEST_001 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_002 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_003 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_004 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_005 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_006 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_007 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_008 { blood_ua_01 blood_ua_02 blood_ua_03 }
$random blood_ua_TEST_009 { blood_ua_01 blood_ua_02 blood_ua_03 }

$random blood_ua_TEST_010 { blood_ua_01 blood_ua_02 blood_ua_03 }


Then try to run TESTMOD_RANDOM_SOUNDS.BAT again and you will see no hangs - level loaded correctly without hanging

For any case I created 2 folders:
DOESNT_WORK - folder where bug should be reproduced (contains all "$random blood_ua_TEST" strings)
WORKS - folder where bug should not be reproduced (doesn't contain "$random blood_ua_TEST" strings)


Tell me please, if you are interested in fixing such kind of issues, so I will try to reduce size of a testmod
User avatar
theleo_ua
 
Joined: 07 Feb 2016

Re: Limit of $randoms in SNDINFO

Postby Graf Zahl » Fri Sep 30, 2016 1:31 am

This had nothing to do with any limit of randoms. You just ran into a bug in the sound precaching code which did not handle $aliases to $random. Normally this just results in caching the wrong sound, but in this case you ran into the rare case that the index into the $random table was interpreted as an $alias to a sound which was referencing the sound that was currently precached, resulting in an endless loop.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Limit of $randoms in SNDINFO

Postby Graf Zahl » Fri Sep 30, 2016 1:59 am

BTW, you do have a definition error in your files:

Code: Select allExpand view
$random new_p_pkup
{
PickupArtifact_NEW
//
//
//
}


$alias PickupArtifact_NEW new_p_pkup


This does not work. The list links back on itself which will create problems.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Limit of $randoms in SNDINFO

Postby Graf Zahl » Fri Sep 30, 2016 3:54 am

fixed everything that got triggered by this mess...
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Limit of $randoms in SNDINFO

Postby theleo_ua » Fri Sep 30, 2016 9:53 am

Graf Zahl wrote:BTW, you do have a definition error in your files:

This does not work. The list links back on itself which will create problems.


Big thanks, now I understand why gzdoom hanged some time ago because of

Code: Select allExpand view
$random PickupPowerupItem_OLD { PickupArtifactHeretic_OLD PickupArtifactHexen_OLD }


in SOUNDS.pk3\SNDINFO

It's very interesting, because changing this

Code: Select allExpand view
$random PickupPowerupItem_OLD { PickupArtifactHeretic_OLD PickupArtifactHexen_OLD }


to this

Code: Select allExpand view
$random PickupArtifact_NEW { PickupArtifactHeretic_OLD PickupArtifactHexen_OLD }


makes gzdoom to "ignore" that definition error you mentioned above (in case of this code loaded before "definition error" code)
User avatar
theleo_ua
 
Joined: 07 Feb 2016


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests