Limit of $randoms in SNDINFO

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Limit of $randoms in SNDINFO

Re: Limit of $randoms in SNDINFO

by theleo_ua » Fri Sep 30, 2016 8: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 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)

Re: Limit of $randoms in SNDINFO

by Graf Zahl » Fri Sep 30, 2016 2:54 am

fixed everything that got triggered by this mess...

Re: Limit of $randoms in SNDINFO

by Graf Zahl » Fri Sep 30, 2016 12:59 am

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.

Re: Limit of $randoms in SNDINFO

by Graf Zahl » Fri Sep 30, 2016 12: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.

Limit of $randoms in SNDINFO

by theleo_ua » Thu Sep 29, 2016 7: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 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

Top