Adding new sounds [coders needed]

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

User avatar
Sanchimaru
Tycoon
Tycoon
Posts: 1542
Joined: 05 Feb 2004 22:39
Location: Kobe, Japan
Contact:

Post 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.
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post 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)
what are you looking at? it's a signature!
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post 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.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Post 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
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post 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.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post 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
what are you looking at? it's a signature!
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

MPSSND_C.DLL Recreated!

Post 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
Attachments
mpssnd_c.zip
Update: 21/08/2005... no more massive log file... not that anyone noticed :p
(20.07 KiB) Downloaded 120 times
Last edited by stevenh on 21 Aug 2005 09:30, edited 2 times in total.
User avatar
Aegir
Tycoon
Tycoon
Posts: 2884
Joined: 09 Feb 2004 10:02
Contact:

Post by Aegir »

Rawr! Aussie TTD'ers taking over!

Excellent work Steveh. Big thanks to you.
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.

14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post 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.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post 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
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Post 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.]
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Post 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?
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post 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?
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post 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).
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post 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.
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

This is indeed fascinating! I'm sure we'll find lots of interesting things to do with it.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7596
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post 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.
Image
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Fascinating, just imagine the sound of a steam engine :).
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post 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.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post 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).
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 8 guests