Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 17, 2011, 13:30   #1
noone42
Rookie
 
Join Date: Oct 2011
Posts: 6
noone42 is on a distinguished road
Lil bug in sound processing?

Hi there

( Please excuse my bad english )

Since quite a while i don't check for new Angband versions.
Now i got the newest and its still fun to play!
But i think i discovered a lil bug in sound processing.
In older versions the sound events in sound.cfg for a single event where chosen by random ( if there was more then one sound for one event )
So for example in sound.cfg

.....
# You miss a melee attack against a monster.
miss = miss.wav miss1.wav miss2.wav miss_a.wav miss_b.wav
.....

means that one of the 5 sounds

miss.wav
miss1.wav
miss2.wav
miss_a.wav
miss_b.wav
is played by random if the "miss" sound event occurs

I checked this behavior with my sound.cfg and older versions of Angband

3.0.9b works fine
3.1.0 beta works fine
3.1.1.1626 works fine
3.1.2.v2 works fine
3.2.0 ONLY PLAYS FIRST SOUND IN LIST ( NO RANDOM CHOICE )
3.3.0 ONLY PLAYS FIRST SOUND IN LIST ( NO RANDOM CHOICE )

so if i dont miss something new ( i read the changes.txt files and find nothing special ) this maybe is a lil bug since version 3.2.0 ??

If i just have to change something in my sound.cfg so please let me know.

Thanks and keep up this good work on this great game!
noone42 is offline   Reply With Quote
Old October 17, 2011, 16:22   #2
noone42
Rookie
 
Join Date: Oct 2011
Posts: 6
noone42 is on a distinguished road
Hi again!

Meanwhile i found the reason. Up to version 3.1.2v2 in source file main-win.c
the sound is prepared with

/* Build the path */
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]);

with function Rand_simple implemented in z-rand.c

Since Version 3.2.0 you will find this line in main-win.c

/* Build the path */
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][0]);

and function Rand_simple is defined in z-rand.h but no longer implemented in z-rand.c

so its obvious why only the first sound is played ...

But i don't understand why Rand_simple is no longer implemented in z-rand.c ???
Does it any harm to the gameplay?


Any explaination is welcome

Thanks!
noone42 is offline   Reply With Quote
Old October 17, 2011, 16:26   #3
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
This wasn't me, but I think it might be related to the switch to the WELL1024 RNG. I'm not certain about that - you'd need to do git blame to see when that line was changed and what that commit was about. I agree that this is a bug though - please open a ticket at trac.rephial.org (I am confident that it has not already been reported).
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old October 17, 2011, 16:52   #4
Blue Baron
Adept
 
Join Date: Apr 2011
Posts: 103
Blue Baron is on a distinguished road
Quote:
Originally Posted by Magnate View Post
This wasn't me, but I think it might be related to the switch to the WELL1024 RNG. I'm not certain about that - you'd need to do git blame to see when that line was changed and what that commit was about. I agree that this is a bug though - please open a ticket at trac.rephial.org (I am confident that it has not already been reported).
Rand_simple was reimplemented for the temporary save file names so fixing this would just be changing the line back?
Blue Baron is offline   Reply With Quote
Old October 17, 2011, 17:05   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Blue Baron View Post
Rand_simple was reimplemented for the temporary save file names so fixing this would just be changing the line back?
Maybe, yes - if it does the same thing as before!
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old October 17, 2011, 17:47   #6
noone42
Rookie
 
Join Date: Oct 2011
Posts: 6
noone42 is on a distinguished road
I checked with the source from 3.3.0 and Rand_simple is NOT implemented there. It is declared in z-rand.h but not implemented in z-rand.c.
So compiling Angband with Bloodshed Dev-C++ 5.0 beta 9.2 (4.9.9.2)
fail in the first place for me.

( I changed the line back to
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); )

Then i just copy and paste the Rand_simple function from z-rand.c of older Angband 3.1.2v2 source. Compile works fine with it. Sounds played by random choice again and gameplay seems normal to me. ( Windows )

May i have to try it with the development version of Angband before opening a ticket? ( checking it out first with git or something? )
noone42 is offline   Reply With Quote
Old October 17, 2011, 19:54   #7
Blue Baron
Adept
 
Join Date: Apr 2011
Posts: 103
Blue Baron is on a distinguished road
Quote:
Originally Posted by Magnate View Post
Maybe, yes - if it does the same thing as before!
If you mean does it generate a random number without disturbing the state of the main RNG, then yes. but the internals are different.

I don't know what V's Rand_simple did before, but Z+'s Rand_simple copies the state of the main RNG, replaces it with its own state, generates the number, then restores the main state. I felt this was too complicated, so the one I wrote calls time then blends it with a modified seed.

noone42:
It is in both the dev versions and the 3.3.2 RC, possibly 3.3.1 as well.
Blue Baron is offline   Reply With Quote
Old October 17, 2011, 20:15   #8
noone42
Rookie
 
Join Date: Oct 2011
Posts: 6
noone42 is on a distinguished road
Thanks Blue Baron,

i tested with source from download page version 3.3.0 August 1, 2011.
No Rand_simple implemented in z-rand.c there but declared in z-rand.h.
So if Rand_simple is implemented again now i am sure random sound works again.
Only thing to do is to replace the line in main-win.c with the old version.
( Works fine here with 3.3.0 source and reimplemented old Rand_simple )

Problem solved i guess
noone42 is offline   Reply With Quote
Old October 18, 2011, 22:38   #9
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,932
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by noone42 View Post
I checked with the source from 3.3.0 and Rand_simple is NOT implemented there. It is declared in z-rand.h but not implemented in z-rand.c.
So compiling Angband with Bloodshed Dev-C++ 5.0 beta 9.2 (4.9.9.2)
fail in the first place for me.

( I changed the line back to
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_simple(i)]); )

Then i just copy and paste the Rand_simple function from z-rand.c of older Angband 3.1.2v2 source. Compile works fine with it. Sounds played by random choice again and gameplay seems normal to me. ( Windows )

May i have to try it with the development version of Angband before opening a ticket? ( checking it out first with git or something? )
This is fixed in the development version now, thanks.
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old October 19, 2011, 19:55   #10
noone42
Rookie
 
Join Date: Oct 2011
Posts: 6
noone42 is on a distinguished road
Nice!

I cant compile the git version yet but i with the older source it works flawless for me.
Thanks for fixing it because i love to play Angband with my sounds
Now i cant wait for this great Angband 64 x 64 pixel tileset from Shockbolt to be finished.
This looks very good and it will be fun to play Angband again with this new tileset.
noone42 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable sound? Zambaku Vanilla 9 June 21, 2011 07:24
Sound Not working at all froboz Vanilla 1 June 22, 2010 18:12
Does anyone have sound working? Mushuukyou Vanilla 22 May 7, 2010 03:19
SDL sound Nick Development 1 July 16, 2009 21:14
Sound configuration nurak Vanilla 6 May 14, 2008 10:23


All times are GMT +1. The time now is 22:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.