PLUGIN: DirectMusic plugin

Started by modgeulator, Wed 28/04/2004 03:15:15

Previous topic - Next topic

Pet Terry

Hmm, I got similar happenings as a-v-o. At the game starts short snap, then everything is quiet until I interact with bluecup.

300 mHz processor
160mb RAM
Creative SoundBlaster 128 PCI
Windows 98 (finnish)
DirectX 8.1
<SSH> heavy pettering
Screen 7

modgeulator

Quote from: Petteri on Sat 01/05/2004 07:55:26
Hmm, I got similar happenings as a-v-o. At the game starts short snap, then everything is quiet until I interact with bluecup.

300 mHz processor
160mb RAM
Creative SoundBlaster 128 PCI
Windows 98 (finnish)
DirectX 8.1

I should edit the first post in this thread. If you're running windows 98 you have to use winsetup and turn the digital sound off completely first. Please let me know if it works after that.

a-v-o

I think I used the menu and sometimes Alt-F4 to quit the game. It seems to me that it doesn't matter.

I tried it on a Pentium 166 with Win98SE and DirectX8a installed and the sound stuff worked like on the other Win98 Computer, the difference was that I could always start the game again. So maybe this is a special problem of the other Win98 computer.

Pet Terry

Yep, it seems to be working now, but, of course, I can't hear any digital sound :P

Nice change of tune between town and shop btw!
<SSH> heavy pettering
Screen 7

modgeulator

Quote from: a-v-o on Sat 01/05/2004 08:32:57
So maybe this is a special problem of the other Win98 computer.
I think I figured out the problem. I was compiling the game using an outdated version of AGS, and the engine shutdown event is only called by the latest version - so my code to release everything wasn't being executed at all...
I've compiled a new exe using the latest version of AGS. Try extracting this over the current demo: http://members.iinet.net.au/~snderson/DMDemo_fixed_exe.zip
hopefully you should be able to quit and restart the game without problems now.

a-v-o

Yes, now it can be restarted without probems.
:D

Gregjazz

#26
Okay, I'm interested. One question though: would I be able to use this plugin in conjunction with the AGS PlayMusic/PlaySound stuff?

(sorry for bringing this thread back up from the dead)

EDIT: Never mind about that question, I've figured it out. Great plugin, by the way!

modgeulator

Thanks. This thread might seem dead but this little project isn't.
Currently you can't use it with the AGS Allegro stuff. Well you sort of can, but it's a dodgy workaround and won't work on Win 95/98/ME computers.

Here's where I'm stuck at the moment:
CJ added a "GetDirectSound()" which hopefully should be able to be used to initialize the DirectMusic stuff inisde the AGS stuff and have everything working together. But unfortunately the newer code for "GetDirectSound()" in the updated "agsplugin.h" conflicts with an include file I need for the DirectMusic code. The LPDIRECTSOUND object in "agsplugin.h" causes a redefinition error with the LPDIRECTSOUND object in "dsound.h" (an include file the DirectMusic code requires.) I'm too crappy a programmer and haven't been able to figure out a way to fix this.

Changing the order of the include files only changes where the redefinition error is raised, the only way I can compile is by commenting out the DirectSound code in "agsplugin.h"

If anyone wants to have a look over the source code I've posted it here:

http://iinet.net.au/~snderson/DirectMusic_plugin_source.zip

It's a bit of a messy cut and paste job, I know. You'll need the DirectX 8.1 SDK to compile it.


EDIT: Thanks Pumaman, adding an include for ddraw.h fixed it.

Edit by strazer:

I've contacted Modgeulator about the status of this plugin. This is what he had to say:

"It's still being worked on occasionally. That said, I don't think it's ever going to have any sort of appeal to anyone other than myself, so I'm wasn't planning on releasing anything else publicly. If anyone wants to use DirectMusic for their game they can feel free to message or email me and I'll give them what I have and any other assistance I can provide."

Pumaman

My mistake, it kinda assumes that you're using DirectDraw when that's not necessarily the case.

The simplest workaround is simply to #include <ddraw.h> BEFORE #including the agsplugin.h

Janik

Quote from: modgeulator on Thu 19/08/2004 07:42:07
Here's where I'm stuck at the moment:
CJ added a "GetDirectSound()" which hopefully should be able to be used to initialize the DirectMusic stuff inisde the AGS stuff and have everything working together. But unfortunately the newer code for "GetDirectSound()" in the updated "agsplugin.h" conflicts with an include file I need for the DirectMusic code. The LPDIRECTSOUND object in "agsplugin.h" causes a redefinition error with the LPDIRECTSOUND object in "dsound.h" (an include file the DirectMusic code requires.) I'm too crappy a programmer and haven't been able to figure out a way to fix this.

Changing the order of the include files only changes where the redefinition error is raised, the only way I can compile is by commenting out the DirectSound code in "agsplugin.h"

If anyone wants to have a look over the source code I've posted it here:

http://iinet.net.au/~snderson/DirectMusic_plugin_source.zip

I know this is an ancient thread, but I'm very interested in seeing how you got direct music to work in the plugin. Unfortunately the link to the source seems to no longer be valid, could you possibly make it available again (or email it to me at jzikovsky at hotmail dot com)?

I have tried using "GetDirectSound" but for some reason it always returns NULL - even though the sound works. It does not matter if I set the game to use DirectSound, WaveOut, No sound, etc. And I don't know anything about initializing/using direct sound or directmusic myself - so your source would be great!

Thanks!
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

modgeulator

I re-uploaded the old file to the same location so the link should now work again.
http://iinet.net.au/~snderson/DirectMusic_plugin_source.zip


Not sure how much use it will be. It was some hacked about code I adapted specialised to loading DirectMusic Producer runtimes. It was never intended for playing back normal sound or music files.
Basically you put together all your sound and music resources in DirectMusic Producer and then call routines from AGS using DMRoutine("[routinename]");
The main intention is to be able to recreate the kind of music tricks they had in the old LucasArts iMUSE games. So for example, when you leave one room and go to another it would call up a routine in the DirectMusic Producer project that would cause the music to play a transition piece at the end of the next measure then continue into a new variation or tune, etc, etc.
But yeah, I never could get it to work properly alongside the AGS audio engine, and it's only good for playing back DirectMusic Producer runtimes, not normal audio/MIDI files.
There's plenty of great source code out on the web you should be able to find for that, though.

strazer

Since it seems to be of so little use, I'm removing this from the archive.

modgeulator

I'm sorry I ever posted about it in the first place then, Strazer.

Pumaman

Hehe I don't think he meant it like that -- rather just that since it's a very specialized piece of code, it's probably not appropriate to the Tech Archive :)

strazer

Exactly. Sorry for any misunderstandings.

Janik

Quote from: modgeulator on Wed 26/10/2005 05:50:26
I re-uploaded the old file to the same location so the link should now work again.

Not sure how much use it will be. It was some hacked about code I adapted specialised to loading DirectMusic Producer runtimes. It was never intended for playing back normal sound or music files.
Thank you for making it available again. From my quick reading of the DirectX documentation, it says that DirectMusic basically contains all the features of DirectSound, like playing back audio files. So I think that it might be expanded for more general use; but I don't know enough about it for now...
Play pen and paper D&D? Then try DM Genie - software for Dungeons and Dragons!

TheMagician

Hi everybody.

This thread is about the "DirectMusic Plugin" for AGS.
The plugin was created by 'modgeulator' in 2004 (the current AGS version back then was 2.62).
The original thread can be found here: Original Thread

In the middle of the second page of this original thread modgeulator fixed an issue where the plugin would only work when "No DirectSound" was checked in WinSetup. CJ gave him an advice how to workaround the problem and modgeulator uploaded a new version of the plugin here:

Latest source code of the plugin

However, as you can see this upload contains the source code which has to be compiled.

So here is my first question: can anybody please compile this source code and upload the .dll file? modgeulator mentions that you need the DirectX 8.1 SDK to compile the files but that's beyond my programming knowledge.

And secondly I would be very glad if someone could have a look at the source code and tell me whether there is a simple answer to the following issue:
As I said, this plugin was created when AGS 2.62 was the current version. In the new AGS 3 RC 1 I get an error when I try to test my game using F5 and I think I tracked down the problem to the following:
When the game is started the plugin looks for two files:
'AGSGame.aud' and
'AGSGame.spt'
I created two identical test games with both  AGS 2.62 and AGS 3.
If one of the two files is missing in the games' main Compiled folder AGS 2.62 gives the same error as AGS 3 so I think the problem is that the plugin can't find the files.
However, if I include all the files in the Compiled folders AGS 2.62 tests the game without any problems while AGS 3 still gives the same error.

I can understand that this plugin is not of great use for many people so I would really appreciate it if one of you would be so generous and help me out (it's Christmas time after all  ;)  )
Stefan

P.S. I also contacted modgeulator about these issues but he hasn't been active on these forums for a while now.

Pumaman

With AGS 3, try building the EXE file (F7) and the running it manually. If that works, then copy the files to the _Debug folder as well as the Compiled folder.

TheMagician

#38
Hi CJ,
the first part of your suggestion worked:
doing an F7 comile and then run the game manually from the Compiled folder works.

However, if I then copy all the files (including the plugin dll) into the _debug folder and do a F5 compile I get the old error again.

This is the error message, but I doubt it tell's you anything more than that the plugin causes the crash.

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x014457A5 ; program pointer is -23, ACI version 3.00.960, gtags (0,0)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.



Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.

An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------
OK   
---------------------------

Pumaman

Try putting a copy of all the plugin files in the game folder as well.

SMF spam blocked by CleanTalk