Limit of $randoms in SNDINFO

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
theleo_ua
Posts: 162
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine
Contact:

Limit of $randoms in SNDINFO

Post by theleo_ua »

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 all

$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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Limit of $randoms in SNDINFO

Post by Graf Zahl »

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+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Limit of $randoms in SNDINFO

Post by Graf Zahl »

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

Code: Select all

$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+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Limit of $randoms in SNDINFO

Post by Graf Zahl »

fixed everything that got triggered by this mess...
User avatar
theleo_ua
Posts: 162
Joined: Sun Feb 07, 2016 11:38 am
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Ukraine
Contact:

Re: Limit of $randoms in SNDINFO

Post by theleo_ua »

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 all

$random PickupPowerupItem_OLD { PickupArtifactHeretic_OLD PickupArtifactHexen_OLD }
in SOUNDS.pk3\SNDINFO

It's very interesting, because changing this

Code: Select all

$random PickupPowerupItem_OLD { PickupArtifactHeretic_OLD PickupArtifactHexen_OLD }
to this

Code: Select all

$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)
Post Reply

Return to “Closed Bugs [GZDoom]”