Page 2 of 3

Posted: 31 Jul 2005 20:19
by Sanchimaru
Thanks Csaboka; don't worry for the edit, I think you did it well (^_')b

However the problem with the sounds seems to be, indeed harder than it sounds (totally idiot joke, I know) since it's not something that can easily be added through a GRF file; but a modification to the program's CAT file.

I have another idea, then:

Since editing sounds is so complex we can't do it just the way we are used to (via GRF) and it would be hard that each one had their own sound files:

What about deciding a set of default sonds to be added to the existing ones? We will not have such a great customization option as we do with the sprites, but the limitation would be upgraded a little bit.
For example, we can have typical industries sounds; seagulls voices for the fishing grounds, and maybe new sounds for harbors, etc.
I don't have a clear idea of what would be needed, but I think that we all together could agree on what new sounds could be added to the CAT file.

Posted: 01 Aug 2005 12:46
by SHADOW-XIII
I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? if some devs will want to "translate" it to DOS it is fine, but if you can to make it just for WIN version it is great !
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)

Posted: 01 Aug 2005 13:01
by krtaylor
Sanchimaru wrote: However the problem with the sounds seems to be, indeed harder than it sounds (totally idiot joke, I know) since it's not something that can easily be added through a GRF file; but a modification to the program's CAT file.
We could make it so that the Patch, when loading a GRF file, also looks to see if there's a CAT file of the same name, and if so, concatenates it to the end of the existing one. But that still would require a change in the sound handler, because the length of the CAT file is hard coded, I understand.

Also, I agree with Shadow.

Posted: 01 Aug 2005 14:29
by michael blunck
SHADOW-XIII wrote:I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? [...]
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
That´s just plain ignorance.

- firstly, there are many people out there using the DOS version, not because their PCs are outdated but because the DOS version has indeed its advantages,

- secondly, a good percent of the developers are using the DOS version,

- thirdly, what would you say if I´d stop developing for Windows because I´d prefer DOS?

- fourthly, Csaba had already stated that it seems to be possible to do it explicitly for the DOS version.

I won´t going to do it myself, but I´m very much sure that the DOS version will be patchable as easy as the win version regarding that sound issue. Csaba stated already that there´s no DOS sound drivers involved needed to be patched.

O/c there´s a layer between the sound drivers and TTDLX. CS is a professional programmer and all the talk about "sound drivers" is crap. Learn to read.

regards
Michael

Posted: 01 Aug 2005 14:42
by Csaboka
It seems it would be possible to add new samples to sample.cat without modifying the driver, but loading samples from different files would need a rewrite.

Meanwhile, I found the source of SOUNDRV.COM. It's a third-party sound driver called DigPak, I've found some documentation for it as well. This means the person who wants to rewrite SOUND.COM can have a full documentation about how to use the actual sound driver.

Michael: The DOS version won't be as easy to change as the Windows version, this is sure. TTD runs in protected mode while SOUND.COM and DigPak run in real mode. Interfacing between the two is complicated, not to mention the good old 640K limit which prevents SOUND.COM from having all its samples loaded into the memory. The Windows sound driver runs in protected mode (as any Windows program does), even in the same address space, so exchanging data can be done by simply passing pointers.

Posted: 01 Aug 2005 16:12
by SHADOW-XIII
michael blunck wrote:
SHADOW-XIII wrote:I am reading whole texts about the problems with DOS drivers but hmm ... why not made it WIN-only ? [...]
notice that there are many many WIN version players (especially now when DOS lost all argues why DOS's better than WIN version)
That´s just plain ignorance.

- firstly, there are many people out there using the DOS version, not because their PCs are outdated but because the DOS version has indeed its advantages,
- secondly, a good percent of the developers are using the DOS version,
- thirdly, what would you say if I´d stop developing for Windows because I´d prefer DOS?
- fourthly, Csaba had already stated that it seems to be possible to do it explicitly for the DOS version.
Micheal I know there are people who are using DOS version and certainly I know that developer use DOS version to find & test some things, I see no problem with that, it is just that if something is really difficult to implement in DOS then why bring down whole idea ?
btw. there was once a poll that people voted which version do then use, it was more than 70% of WIN version

MPSSND_C.DLL Recreated!

Posted: 04 Aug 2005 01:34
by stevenh
Folks, I've been reading these forums now for a while and realised it was time to contribute.

For those Windows users out there, backup your current MPSSND_C.DLL file in your TTD directories and replace it with the one I'm providing here.

I've recreated the Library that sits between TTD and DirectSound and now am able to do whatever the hell I want with it!

Talking to Csaboka, We've been scheming up a way to use it to add new sounds. I've created the necessary framework to play raw wave data from somewhere else (other than in my DLL), and therefore WAVE files can be loaded from the GRFs and just played.

Of course, it's now off the the TTDPatch side of things to get the other side of this written.... Right now, this is what it can do:

Panning, Volume and Frequency are all working (all 73 sounds are loaded from sample.cat). They now play at what they're encoded at (ie. what the individual headers state in the wave chunks in the file).


Some things just sound weird, others sound cool.... I probably should end up limiting all the sounds to the normal frequency... either way...


Tell me what you think!
-----------------------------------------------------------------------------------------
:!: :arrow: BTW: DOS Users, don't despair. I intend on recreating the DOS version as well... Just understand that this may take a little more than 48 hours :P

Posted: 04 Aug 2005 10:40
by Aegir
Rawr! Aussie TTD'ers taking over!

Excellent work Steveh. Big thanks to you.

Posted: 04 Aug 2005 11:10
by Csaboka
Yes, thank you very much Steven :bow: :bow: :bow:

Now I can start thinking about the exact details of implementation from the Patch side.

Posted: 04 Aug 2005 12:37
by Villem
Good work, i noticed that the road vehicles now have 2 diffrent startup sounds, is this by you?;)
I also noticed a diffrent cash-in sound.
Also i got the celebration sound on startup of TTD, is this intentional too?:P

Posted: 04 Aug 2005 12:49
by stevenh
The startup sound is my 2c :) ... Clapping on one channel, Cheering on the other.

The different sounds you hear in the game are actually the REAL samples.

In sample.cat, each sound has it's own header information, which includes the speed the sample is played at.

Now, TTD just blatantly limits all sounds to 'single speed' sound (11025Hz) whereas some sounds in there are encoded at 'double speed' (22050Hz)... So the effects you are hearing are actually mistakes by Fish!UK or Microprose.

Glad to see it's working.... Still having issues with Windows9X.

[BTW, if someone running Windows 95.98.ME could try this DLL, it'd be greatly appreciated.]

Posted: 04 Aug 2005 12:49
by wallyweb
Steven ... I just tried your new file from this morning ... still not working for me and still no log but TTDX's own version still works fine.
I'm using TTDX windows version with the Fish(UK) screen so I know I'm not using the DOS version.
My system is Win98SE
My DirectX is 8.1 and sounds test good.
Device: AWE64 Direct Sound Driver[220]
Driver: SB16.VXD
I don't think its your compile ... any other possibilities?

Posted: 04 Aug 2005 12:49
by Csaboka
Akalamanaia: It turns out that the cash-in sound was a bug all along. The headers of that sound say that it's to be played at 22050 Hz, but TTD just ignores the header and plays it at 11025 Hz. The new sound driver respects the header and plays the sound file as originally intended.

Of course, the question arises: should we keep the old buggy behavior because people got used to it, or should we fix it so it works as originally intended?

Posted: 04 Aug 2005 12:50
by Villem
I like the new cash-in sound, it sounds A LOT better.
Also the road-rail crossing bell also now sounds better.
Breakdowns sound slightly better too(the one for trains).

Posted: 04 Aug 2005 13:08
by Hyronymus
This is a very interesting development. I hope adding completely new sounds that will become possible now, it would add another dimension to replacement sets.

Posted: 04 Aug 2005 14:26
by krtaylor
This is indeed fascinating! I'm sure we'll find lots of interesting things to do with it.

Posted: 04 Aug 2005 15:29
by Born Acorn
krtaylor wrote:This is indeed fascinating! I'm sure we'll find lots of interesting things to do with it.
It will be possible to loop sounds to get idle and running sounds.

Posted: 04 Aug 2005 15:45
by Hyronymus
Fascinating, just imagine the sound of a steam engine :).

Posted: 04 Aug 2005 16:37
by krtaylor
I'm not really sure whether loop sounds would be a good idea. I think it'd be annoying. Also, I think it still would be able to play only one sound at a time, so the loop sound would cut off when some other sound-triggering event took place, then start up again abruptly once the other sound ended? Or just block any other sounds from taking place? Either way, probably better not to do that. TTD has fairly short sound clips, and I think that's wise.

Posted: 04 Aug 2005 17:28
by Csaboka
Well, the number of sounds played simultaneously can be set between 1 and 8 in DOS TTD (default is 4), and I think there's no limit in Win TTD.

Still, looping sounds would be difficult to do, especially if they should change position during playback. (For example, the sound of a train going across the screen should change its panning constantly).