Silent fall

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Silent fall

Post by Zyx »

Falling is normally associated with the "dying sound"
However, if another noisy event happens at the same time as the fall, the characteristic sound will not be heard. Which is quite confusing if you didn't see the pit.
Maybe the falling sound should always be played on another channel than the rest of the sounds?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

another channel than the rest of the sounds
The program ( and I for that matter ) know nothing of
'channels'. The Windows system call that plays a .WAV
file has no parameter corresponding to 'channel' that
I know of. If someone knows how to tell Windows what
'channel' to use then I could probably arrange for the
falling sound to be played on a 'channel'. But I am not going
to incorporate 'DirectX' or some other monstrous library
between myself and the operating system.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

That's why the Amiga version was a lot better! :P Four sound channels, so sounds didn't interrupt each other, like they do in the PC and Atari versions...

I don't think you can assign channels in Windows without using directx. When I used to develop multimedia CD-ROMs in the early days (1993-1998!), sound cards only had one available channel in Windows. It's only with newer hardware and DirectX that you can access more than channel as far as I know.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Gambit37: Thanks for the information that supports
my impression of how things work.

One thing I might do. I could assign a priority to
sounds and arrange that a low-priority sound not
interrupt a high-priority sound. Perhaps. There are
always portability concerns now that the code is expected
to work on Linux, macintosh, and PortablePC.

I'll see if it is a reasonable approach.
Rebecka

Channels

Post by Rebecka »

In Linux we implemented a simple array with a fixed number (16) of "sound channels" (or sound devices). Every sound is then assigned to a channel as we go. If all channels are playing already, we wait.

This is a quite lame way, I know... but it works and CSB doesn't need to know anything about channels. It just says "play sound". The major drawback is that the rattle of a door opening, is not being perfectly synchronized. The rattle-sounds should wait for each others before playing, but.now occur almost simultanousely.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Yes, this is more-or-less what I decided to do. I implemented
a queue. They are not channels because only one can be
played at a time. But it will prevent sounds from being lost.
I still know of no way to implement channels with the standard
Windows SDK calls.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I appreciate your research. But I will repeat
a couple things that I said before.
I still know of no way to implement channels with the standard
Windows SDK calls.
But I am not going
to incorporate 'DirectX' or some other monstrous library
These restrictions still apply. The cost/benefit ratio is
simply too high.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

@zyx.....I posted a new CSB17Levels.rar that has the
capability of queueing up to three sounds. It is a little
strange because the second sound must wait for the first
to finish but at least the sound does not simply disappear.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Personally, I'd rather leave it as it is than have sounds wait for each other. That seems stranger than having no sound at all.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Thank you Paul, I tried the "queued sound" version with conflux II:
at the very beginning of Conflux II, you need to fall through a pit to start playing. I tried several times but never heard the fall sound, only the clinging of the torch falling on the floor.

As Gambit, I find the queuing weird. Sounds are only informative if they're synchronous to the event, otherwise they're confusing.
So I guess it would be best to prioritize the sounds (if possible)

Here's a suggestion, from more important to less:
falling > spell explosions > receiving damage (wound and hitting walls) > teleporter > doors > monster attacks > party actions (using weapons, drinking) > objects falling on the floor > clicks (mouse clicks, actuators)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

at the very beginning of Conflux II, you need to fall through a pit to start playing. I tried several times but never heard the fall sound
Being the curious type, I loaded ConfluxII to see why the
sound was missing. But I could cause no sound because
I could not find any way to add a party member before
falling through the pit. But, of course, without a party member,
no damage is done and there is nobody to cry out in pain.

Code: Select all

     if (d.numCharacter > 0)
     {
       .......
       QueueSound(6, ......)
     };
Is there some way to add a party member before reaching
the pit?

I see that it is going to be difficult to prioritize the sounds.
They are generated in the standard DM way; by creating
a timer entry. Generally the delay is zero but not always.
The timer entry is full. No place to put a priority without
increasing the size of the entry or getting clever with a few
bits that must be zero (like the x and y coordinates use only
five of the available eight bits). The former is a lot of work
because of backward compatibility and the latter is ugly.

I think you will have to choose between a queue of sounds
played in succession (rather rare, I imagine) or the latest
sound terminating a prior sound.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Ah, i see, I never thought the falling sound was the human voices of the party... I was thinking rather of the sound lady Fortune would make when she strikes us ...

I tried with a party member and I heard all the sounds when falling, it was so delightful that I restarted the game several times just to feel again the anguish of falling through a pit. I am quite pleased with the result of queued sounds - I take the last ones are just echoes in my mind which can't keep up with what is happening ;) -. Thank you again.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

so delightful ..... to feel again the anguish of falling
Have you considered seeing a professional?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

which one do you use to stay sane in the sea of requests, new platforms and bug fixes? : )
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

And just what is it that make you think we have been
successful?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

*backs away slowly with no sudden moves*
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Is there a way to specify queued/non queued sounds as an option in the CONFIG file. Or has the queued version superceded the original? I find it very strange and it doesn't sound half as good as the original...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Under what circumstances does it sound strange? It is not
supposed to make any difference unless there are two
sounds that are being played simultaneously. Perhaps
I goofed when checking to see if a sound was already active.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

It's a perception thing -- many things, such as being attacked by a group of monsters, now sound 'slower' because of the queueing. For example, the muncher room in CSB that you open by pressing on Chaos' face seems less threatening because you're party doesn't 'oof' as quickly -- so it sounds like the muncher's aren't attacking as quickly. Or say you are surrounded by gigglers -- it's not as clear that there are lots of them because you're waiting for one giggle to finish before the next. Or the front door sounds very slow now -- you only get four or so 'clanks' where before there were many more... Or a deth knight that does a double swing attack now sounds like he's half asleep, etc etc.

Maybe it's just me, but I prefer things to sound faster, even if sounds are getting cut off.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

another problem:
It seems that CSBwin with queued sounds can't play while another application using sounds is running (like winamp).
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Sounds like we have a problem.
Or the front door sounds very slow now
This is the most reproducible of the cases you mention so
let us use it. I tried CSB on my slow (166 MHz) laptop with
Windows 95. I played with CSBwin version 9.6 (long before
sound queueing had been invented) and with version 9.6Plus20
(which is available in CSB17Levels.rar).

I could not hear any difference when opening the prison doors.

Could you try those two versions? If they are significantly
different on your machine then I will want to create a special
version of CSBwin for you to try. I will install some traces
to see what is happening inside the sound sub-system.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

I retract my statement -- there's no difference! I've been playing so many different versions (RTC, Amiga CSB, CSBWin, X68000, etc) that I'm obviously a bit confused.... some of the other versions do play that door sound effect much faster, so that's probably what I'm thinking of. My apologies.

I'll have another listen to things in other versions to see if maybe that's what I had observed. Will take me a while to dig them all out though.
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

too bad it wasn't based on the Amiga version.. :P
While it stated 4 channel sounds comming from the Paula chip it was shown later through octamed that you could go easily to 8 channel sounds. I had heard that Octamed Soundstudio supported up to 128 channels but I didn't find out if you needed a new sound card for that or what.

Anyway the way things like Mods worked was two channels per ear meaning you could hear two sounds at the same time in each ear. allowing for 4 simultanious sounds. Meds I think were either a hack or it was somekind of realtime sound mixing as they allowed 4 sounds per ear.

now.. for me to stop reliving the dream that is Amiga.. ;)

I'm assuming you desire to refrain from DirectX is not rooted in a deep hatred for M$ but for purley compatability reasons... so under that assumption.. Would it not be possible to just have a button that says "do you want enhanced sounds 'yes' 'no'" and then let the code for sounds be rerouted through a secondary program.. some kind of evil directX sound library.. this providing the option of those on the mac also to take advantage of this by writing an equivilent library or whatever to translate the sounds to be blended as well.

just a stray thought or two.. or four.... hopefully some of the is coherent.

moo
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Certainly. I can do that. Send me the code for the
function that will do this 're-routing', I will put it into
CSBwin, and I will install a Menu Option to select it.
No problem. Note that the code you send must be
compatible with Linux, Windows, mac OS, and WindowsCE.
There are flags that will allow you to simply turn off
the code for any of these cases if you choose not to
implement (for example) WindowsCE.
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

in otherwords it's not possible.. or not within your range of reasonable requests? Since I'm guessing that was a sarcastic remark as we all know I can't program my way out of a cardboard box. :) Though that doesn't often dissuade me from seeking out examples and code on the net.. however.. today I'm so stuffed up I can't hardly think straight so.. no such luck. :P

Just sounded like something that might be a solution to the compatability issues. A sort of .. sound translator plugin. (shrug)
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Paul's humour is somewhat drole. ;)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Sorry about that. It was intended to be sarcastic and
yet it was an honest offer. I do not know how to provide
such a capability. The simple way of using a library is to
include it as part of the program and then either call it
if necessary or not call it. But it is always there. Your
suggestion requires code that will load the library, if it
exists, at runtime and figure out some sort of way to call
it. I am sure such things are possible. But the effort is
more than I wish to expend for the gain of having two
sounds at the same time.

Nevertheless, if someone were to provide the code to
accomplish this (pointing to a place where I can learn
to do it does not count) then I will put the necessary hooks
into CSBwin to activate such code at the player's request.
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

I've been told that all that needs to be done is to make a DLL and call to it. I'll try to see if my friends is willing to aid in this at all. Maybe you might get some code out of it after all..

moo
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

If you had a function like 'PlaySound( sound ID, volume)' that would simply play any number of sounds at the same time, would that be enough? There would also be a function to stop all sounds of course. Then, each platform implements that function the way they want. The Windows one can have a DirectSound implementation, the rest can do what they do now (and simply play only one sound at a time) There would of course be some init functions to allow the implementation to preload the sounds into memory, but that's all implementation dependant. If you need to have multiple implementations per platform (like a DirectSound and a WinMM (the win32 PlaySound) then this will work for that also. The Init function could decide what to use and then just call the right internal methods when you call the external PlaySound( sound, volume )' function.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”