Jump to content


Photo

Fmod Sound System Engine


  • Please log in to reply
1114 replies to this topic

#501 Nehacoo

Nehacoo

    GMC Member

  • New Member
  • 180 posts
  • Version:GM8.1

Posted 13 November 2010 - 10:16 PM

Hey icuurd12b42, many thanks for this great DLL!
It has worked perfectly for me until now on the admittedly quite few computers I've tested it on (including never having a problem on my main desktop computer on which I've run my game hundreds of times).

But now that I tested my game on my old laptop, it throws out ye olde "Error defining external function", once for every function defined in LoadFMOD(). If I ignore all of those errors it shows the message "Failed to load sound file <file>" for every sound added. Then the game works, but completely lacks sound.
I've seen the mentions of similar problems earlier in the topic, but this persists through restarts (I've never once got it working on that computer). Another DLL (Yourself's High resolution timer) works as it should even on the laptop, and I think, but I can't remember clearly as it was at least a year ago, SXMS worked on that laptop as well.

The laptop runs Windows XP SP2.

Any idea what causes this problem or any possibilities of fixing it? Thanks.
  • 0

#502 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 14 November 2010 - 03:49 AM

Any idea what causes this problem or any possibilities of fixing it? Thanks.


Darn, did I publish a release with msvc compile instead of codeblocks!!??

Install this and see if it fixes it. In the system or the game directory...
http://www.microsoft...4d-074b9f2bc1bf

When I have more time, I'll compile it without the dependency. I'm really sorry about that. if that is the problem. Another problem is GM itself starts to hickup on loading ANY dll. Truely reboot your PC to fix this

Edited by icuurd12b42, 14 November 2010 - 03:49 AM.

  • 0

#503 Nehacoo

Nehacoo

    GMC Member

  • New Member
  • 180 posts
  • Version:GM8.1

Posted 14 November 2010 - 12:05 PM

Yup, it worked fine after I installed the re-distributable package, good to see it was something (to my knowledge) easy to fix!
Actually I suspected it was something like this because I think I've seen you mention this kind of problem in some other thread months ago. :)

Oh and personally, I'm not in a very big rush to get it fixed as long as I can work on my game (as it will take a while before it's finished), but I guess I can't speak for everyone here.

Thanks a lot!

(Why do applications compiled with visual c++ require such a package anyway? To keep down file size?)
  • 0

#504 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 15 November 2010 - 02:23 AM

(Why do applications compiled with visual c++ require such a package anyway? To keep down file size?)


Yes. Useless IMHO... My dll is not even using the things in those. but MS decided the linker would force it on you anyway. There is an option to turn it off. Someone mentioned it a few places. But everytime I have the energy to recompile my stuff, I try to locate the info and fail to find the post stating the option on how to turn it off. If anyone knows what I'm talking about here please post up the option here.

Edited by icuurd12b42, 15 November 2010 - 02:23 AM.

  • 0

#505 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4935 posts
  • Version:GM8

Posted 15 November 2010 - 07:44 AM

Posted Image
  • 0

#506 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 15 November 2010 - 11:53 AM

My dll is not even using the things in those. but MS decided the linker would force it on you anyway.

It is used, but if you saw it you would be more frustrated that your creation has just crashed. It implements the standard functionality for the language, such as string and vector.
  • 0

#507 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 15 November 2010 - 03:02 PM

My dll is not even using the things in those. but MS decided the linker would force it on you anyway.

It is used, but if you saw it you would be more frustrated that your creation has just crashed. It implements the standard functionality for the language, such as string and vector.


Which I dont use. I only use the basic C++ language (none of the standard classes) and standard c types. I think Revel pointed out the right spot. this will cause either the references to not be included or the implementation be included in my dll directly.

Thanks revel.
  • 0

#508 imuh3

imuh3

    GMC Member

  • New Member
  • 25 posts

Posted 29 November 2010 - 04:11 AM

Hello again, I come back to the sound guru for advice. The FMOD feature list says there is a WAV writer output that writes all FMOD output to a wag file. However, I can't find anything in GMFmodSimple. Please help!

Lastly, I would like to know if there is a way to get VST plugins in game maker. Thanks in advance
, Imuh3

P.s. I'm making a composer, haha

Edited by imuh3, 29 November 2010 - 04:11 AM.

  • 0
Posted Image NECARE , a top down shooter with RTS elements
-Imuh3

#509 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 29 November 2010 - 04:21 AM

It's a flag you pass to the core fmod create_sound function... Which does not send the sound to the audio device... system update is called until the whole file is read while you get the wave data. My wrapper does not allow such fine use. Perhapse the other older fmod system by shaltif allows this.

As for the dsp, I only support fmod's included ones.
  • 0

#510 whothat

whothat

    GMC Member

  • New Member
  • 18 posts
  • Version:GM8

Posted 30 November 2010 - 02:02 AM

i get this error

ERROR in
action number 2
of Other Event: Game Start
for object gamestart_cont:

Error defining an external function.

and after i click ignore 20 or so times, the game runs normal and all the sounds work, any idea whats wrong?
  • 0
Posted Image

#511 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 30 November 2010 - 08:27 AM

See post 503... But in your case. I think it's GM freaking out because you likely worked on the game, terminating it when you had unrelated errors showing you that error window, hitting that abort button is a killer on dlls. Reboot your PC and the problem should go away.

When using dlls, if you have any script error, try to hit the ignore, hope the game will run normally long enough for you to close it (immediatly) normally with ESC. This limits the frequency of this type of problem. It can happen with any dll.
  • 0

#512 whothat

whothat

    GMC Member

  • New Member
  • 18 posts
  • Version:GM8

Posted 30 November 2010 - 07:21 PM

I restarted my computer twice and I am still getting the errors
  • 0
Posted Image

#513 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 30 November 2010 - 09:22 PM

I restarted my computer twice and I am still getting the errors



Make sure you completely shut down the computer, make sure it did not simply go to sleep...

Also, make sure you only call the load script that loads the dll once in your game...
  • 0

#514 whothat

whothat

    GMC Member

  • New Member
  • 18 posts
  • Version:GM8

Posted 01 December 2010 - 12:14 AM


I restarted my computer twice and I am still getting the errors



Make sure you completely shut down the computer, make sure it did not simply go to sleep...

Also, make sure you only call the load script that loads the dll once in your game...


i shutdown then turn it on to restart it, here is the code in in my gamestart event
globalvar bmus;

LoadFMOD()
FMODinit(1000)

bmus[0]=FMODSoundAdd('music/title-tonybob.mid',false)
FMODSoundSetMaxVolume(bmus[0],.9);

FMODSoundSetGroup(bmus[0],3)


alarm[0]=10

  • 0
Posted Image

#515 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 01 December 2010 - 12:54 AM

Can you PM me your project. zip it up, folders, sounds, gmk, dll et all?
  • 0

#516 whothat

whothat

    GMC Member

  • New Member
  • 18 posts
  • Version:GM8

Posted 01 December 2010 - 01:07 AM

Can you PM me your project. zip it up, folders, sounds, gmk, dll et all?

sent...
  • 0
Posted Image

#517 BlueMoonProductions

BlueMoonProductions

    BlueMoonProductions

  • GMC Member
  • 241 posts
  • Version:GM:Studio

Posted 11 December 2010 - 03:12 PM

Hey! The DLL is great, but I'm having some trouble with looping my BG music.

This code is being executed at room start by a persistent controller:
var temp; temp = room_get_bgmusic()
if (FMODInstanceGetSound(current_bgmusic) != temp)
 {
  FMODInstanceStop(current_bgmusic)
  if (temp != -1)
   {
    current_bgmusic = FMODSoundLoop(temp,0,1)
    FMODInstanceSetLoopCount(current_bgmusic,-1)
   }
 }
The script 'room_get_bgmusic' returns the music of the room, -1 if there is no music. The first if statement checks if the music isn't already being played. If not, the current bg-music is being stopped, and if there is music for this room, it is being played.

As you can see there is a third argument in the FMODSoundLoop-script. This is because I edited it a little:
// argument2 is the kind of sound, 0=sfx, 1=music
if !argument2 //sfx
 {
  if global.SFX_option
   {
    *play sound*
   }
 }else{ //music
  if global.MUSIC_option
   {
    *play sound*
   }

 }
Instead of just '*play sound*'.

The last line sets the loop count to 'infinite'. However, the music isn't looping. It just plays once, and then simply stops. What am I doing wrong?
  • 0

#518 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 11 December 2010 - 05:18 PM

try in the game start

sound = FMOND_Sound_Add("yoursoundhere");
inst = FMODSoundLoop(sound);

to test if the looping works. Which it should. If it don;t I have a bug. If it does, it may be your code, possibly room_get_bgmusic() or maybe I have a bug in FMODInstanceGetSound()
  • 0

#519 BlueMoonProductions

BlueMoonProductions

    BlueMoonProductions

  • GMC Member
  • 241 posts
  • Version:GM:Studio

Posted 11 December 2010 - 06:20 PM

Ah, thanks. When I added that code, the music was played twice(at the same time). So I started searching through my codes and object, and found the code 'current_bgmusic = FMODSoundPlay(music[1],0,1)' somewhere in an game start event. I don't know why I placed it there, but when I remove it, everything works fine.

So, sorry for bothering you, and thanks for (porting) this great sound system =)
  • 0

#520 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 12 December 2010 - 03:55 AM

Cool
  • 0

#521 puso

puso

    GMC Member

  • New Member
  • 60 posts

Posted 27 December 2010 - 11:33 AM

Great engine. Really works perfectly. But I still have few questions:

1. Does it support equalizer. If it does, sorry for my bad looking. But if it doesn't, let me know if you will be working on it.
2. Does it support effects such as chorus, reverb, delay...
3. I have seen it in the example, the sound scope. It's really great. But I'm asking, it detect all sounds from windows, or just sounds, from the engine. And another thing, can you use it for specific sounds only (Like for music in the sound settings, or to have it lake a radio, that detects unfamiliar sound).

It's really good stuf, and I love it. Thanks. ^_^
  • 0

#522 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 27 December 2010 - 11:47 AM

1. yes
2. yes
3. engine

#523 gmcsdobbie

gmcsdobbie

    GMC Member

  • GMC Member
  • 298 posts

Posted 03 January 2011 - 08:52 PM

Getting the wave and spectrum data

leftspec = ds_list_create();
	rightspec = ds_list_create();
	leftwave = ds_list_create();
	rightwave = ds_list_create();
	numentries = 1024;

	FMODGroupGetSpectrumSnapshot2(0,0,numentries);
	FMODNormalizeSpectrumData(0,numentries/2);
	FMODSnapShotToDsList(0, numentries/2, leftspec)

	if(!FMODGroupGetSpectrumSnapshot2(0,1,numentries))
	{
		ds_list_copy(rightspec, leftspec);
	 }
	else
	{
		FMODNormalizeSpectrumData(0,numentries/2);
		FMODSnapShotToDsList(0, numentries/2, rightspec)
	}
	
	FMODGroupGetWaveSnapshot2(0,0,numentries);
	leftnorm = FMODNormalizeWaveData(0,numentries);
	FMODSnapShotToDsList(0, numentries, leftwave)
	if(!FMODGroupGetWaveSnapshot2(0,1,numentries))
	{
		ds_list_copy(rightwave, leftwave);
		rightnorm = leftnorm
	}
	else
	{
		rightnorm = FMODNormalizeWaveData(0,numentries);
		FMODSnapShotToDsList(0, numentries, rightwave)
	}

	repeat(numentries/2)
	{
		v = ds_list_find_value(leftspec,i)
		//draw.. v is 0 to 1;
		i+=1;
	}
	repeat(numentries/2)
	{
		v = ds_list_find_value(rightspec,i)
		//draw.. v is 0 to 1;
		i+=1;
	}
	repeat(numentries)
	{
		v = ds_list_find_value(leftwave,i)
		//draw.. v is -1 to 1;
		i+=1;
	}
	repeat(numentries)
	{
		v = ds_list_find_value(rightwave,i)
		//draw.. v is -1 to 1;
		i+=1;
	}
	ds_list_destroy(leftspec );
	ds_list_destroy(rightspec );
	ds_list_destroy(leftwave );
	ds_list_destroy(rightwave );

For spectrum I usually just draw the first half as there is little to display in the second half. That's why I ask for the full spectrum and only grab half the result.

The normalisation is required on the spectrum or you get very tiny values which is not useful fro drawing. It is not required on wave data...

I use group functions here to query the data but the code is exactly the same for instance data.

Note that I get the left/mono channel first then the right channel. If the sound is mono, this ensures that both left and right buffers hold data.


When I use this in the draw event i get this error.
ERROR in
action number 1
of Draw Event
for object object177:

Error in code at line 40:
v = ds_list_find_value(leftspec,i)
^
at position 50: Unknown variable i

But when I put i = 0 at the start, it works.

Edited by gmcsdobbie, 03 January 2011 - 08:56 PM.

  • 0

#524 anselm

anselm

    GMC Member

  • GMC Member
  • 239 posts

Posted 05 January 2011 - 12:17 AM

Hey, I had a question about mic pickup with this system (feel free to beat me across the head if this question has already been asked, or I just missed something that was right in front of me.)

My current employer was interested in whether or not GM could read audio levels (either coming from the mic, or in the game.)

I already know how to read game audio levels in GM, but was stumped when it came to reading mic audio levels. After a bit of research, I came to this mod. Now, I know this mod can read from the mic (I played around with it a bit.) But I was wondering if you could find a way to return the current audio level (like, if the player was screaming in to the mic, or talking at a regular pitch,) and do something code wise accordingly (like, if the player angrily yells in to the mic, have all the enemies in the current room explode, or some such.)

Thanks a ton, and sorry if this question seems stupid.
  • 0

#525 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 05 January 2011 - 02:38 AM

Hey, I had a question about mic pickup with this system (feel free to beat me across the head if this question has already been asked, or I just missed something that was right in front of me.)

My current employer was interested in whether or not GM could read audio levels (either coming from the mic, or in the game.)

I already know how to read game audio levels in GM, but was stumped when it came to reading mic audio levels. After a bit of research, I came to this mod. Now, I know this mod can read from the mic (I played around with it a bit.) But I was wondering if you could find a way to return the current audio level (like, if the player was screaming in to the mic, or talking at a regular pitch,) and do something code wise accordingly (like, if the player angrily yells in to the mic, have all the enemies in the current room explode, or some such.)

Thanks a ton, and sorry if this question seems stupid.


A mixture of things... the spectrm data, not normalized would give a clue... notmalized spectrum data, a few entries at the right spectrum range more than .5 would probably indicate somoenoe screaming.

You should really draw the spectrum in each mode and see what you get...


Reading wave data, looking at the minimum entry value (min wav valey) and maximum value (max peak), the difference would be the actual amplitude of the wave. The normalize function on wave data does return the amplitude though.

But you know it's a mixture of things. What level is his mic at, how he/she screams...

I would ask the player to scream while I record the normalized spectrum entries (smallest range, 32 or 64?) in a ds list over a period of time. Average the entry values of each step of that period so to have one sample of 64 values. The you can use the pitch detection method but using the dslist for comparison. if 75% of the values match or better, you have a detected event...


Note that there is a limitation in how fast you can get to the live data of the mic. Unfortunatly, it's unreliable from PC to PC. I set up the demo to allow for most PC so there is a delay of about 128 ms in there... It's hard to get to the live data without feedback or weird stuff hapening.

Place the sound into group 4 or is it 3, the last group, and mute the group so you can read in the values whitout the sounds going to the speaker

Edited by icuurd12b42, 05 January 2011 - 02:43 AM.

  • 0

#526 anselm

anselm

    GMC Member

  • GMC Member
  • 239 posts

Posted 05 January 2011 - 08:35 PM

Hmm... Okay, I'll need to find out exactly what my employer wants to do, and do some more research in to FMOD (I'm assuming your website has more information on the DLL?)

Thanks a lot, I'll ask here again if I have any more questions :)
  • 0

#527 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 06 January 2011 - 03:38 AM

This here is my web site... I'm not firelight tech :)

If you want more features, go to the official firelight tech site and grab the development system.
  • 0

#528 njp

njp

    Panda

  • GMC Member
  • 2342 posts
  • Version:GM8

Posted 06 January 2011 - 04:23 AM

hey, i downloaded your tutorial and i got lost in a sea of all these things im not looking for. im just wanting to change the pitch of a sound. how high or low the sound sounds.
thanks alot

-nic
  • 0

[--NJP--]


#529 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 06 January 2011 - 04:43 AM

there are pitch functions in there, as well as sound effect that change the pitch without changing the play lenght.
  • 0

#530 njp

njp

    Panda

  • GMC Member
  • 2342 posts
  • Version:GM8

Posted 06 January 2011 - 05:08 AM

ok... i went through the scripts and found the set_pitch one.
so i dont understand how to set the pitch for the sound thats about to play. lets say variable 'sound' because the sound is always changing.
and there are many objects with the variable 'sound' (obj_note). and i want the pitch to be set based on the distance the object is from another object (obj_placer)
'sound' will be one of 4 sounds the user can set.

basicly im lost on how to set the pitch.

thanks
-nic
  • 0

[--NJP--]


#531 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 06 January 2011 - 05:21 AM

SampleController, game start event
global.MySound = FMODSoundAdd(....);

in you object room start, to demonstrate
paused = true;
mySoundInstance = FMODSoundPlay(global.MySound,paused);
pitch = random(10);
FMODInstanceSetPitch(mySoundInstance,pitch);
FMODInstanceSetPaused(mySoundInstance, !paused);


I showed the example with paused, just so if you need it
  • 0

#532 njp

njp

    Panda

  • GMC Member
  • 2342 posts
  • Version:GM8

Posted 06 January 2011 - 05:45 AM

well i get this error o.O
ERROR in
action number 1
of Other Event: Game Start
for object obj_control:

In script FMODSoundAdd:
Error in code at line 72:
return external_call(global.dll_FMODSoundAdd,argument0, argument1, argument2);
^
at position 30: Unknown variable dll_FMODSoundAdd
  • 0

[--NJP--]


#533 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 06 January 2011 - 06:03 AM

Did you place the Sample Controller in your very first room?
  • 0

#534 filulilus

filulilus

    GMC Member

  • GMC Member
  • 966 posts
  • Version:GM:Studio

Posted 07 January 2011 - 03:49 AM

This is beyond awesome... it's... epic.

I'm so ganna use this for my Online FPS (just got it working with correct playing 3d sounds)

I read your documentaion on "FMODListenerSet3dPositionEx()" and figured out that it's almost the same values as you use in your
"d3d_set_projection()" code.
The diffrence is that the fx, fy and fz count in the x, y and z in "FMODListenerSet3dPositionEx" but does not in "d3d_set_projection" for good reasons.

Anyways, this is how the 2 codes could look like in an FPS:

cam_x =cos(direction*pi/180) * cos(direction_updown*pi/180)
cam_y =-sin(direction*pi/180) * cos(direction_updown*pi/180)
cam_z =sin(direction_updown*pi/180)

d3d_set_projection(x,y,z,x+cam_x,y+cam_y,z+cam_z,0,0,1)

FMODListenerSet3dPositionEx(1,x,y,z,cam_x,cam_y,cam_z,0,0,1)

And thanks alot for bringing FMOD into GM!

Edited by filulilus, 07 January 2011 - 03:52 AM.

  • 0
Posted ImagePosted Image

Did I just help you? please give me a +1!
\/


#535 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 07 January 2011 - 04:28 AM

Yep. I also have helper functions in vertapi in the extending gm script section which you can use to calculate the facing vector and the up vector. and use it in there too. At the time I wrote the fmod documentation, I was a little confused about the vectors there. Check it out. it's a must for your 3d games.
  • 0

#536 goldnoah

goldnoah

    GMC Member

  • New Member
  • 39 posts

Posted 24 January 2011 - 07:28 PM

nice engine! but as soon as i play the same sound twice it stops working :blink: even when i add a new sound for each instance it still stops when i play the same sound twice. Any sugestions?
  • 0

#537 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 25 January 2011 - 02:53 AM

nice engine! but as soon as i play the same sound twice it stops working :blink: even when i add a new sound for each instance it still stops when i play the same sound twice. Any sugestions?


FMODUpdate has to be called every end step....
  • 0

#538 dsso123

dsso123

    GMC Member

  • New Member
  • 74 posts

Posted 27 January 2011 - 04:58 PM

Hey, i like this engine you made, im just wondering how could i use it to create an object everytime it hears something..

Like a guitar hero type game.

Thanks.
  • 0

#539 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 27 January 2011 - 07:37 PM

GH type games have multiple track, hand made for each track,
Musical Tracks
guit track, drum track, base track
And a track for each above to define what buttons to press at what time...

You can use tag data, supported by mp3 and opther types, usually it holds artist names, song game and so on, you could insert your own tag data in the mp3 file, information as to when buttons should appear and be hit. But really, a separate file would be best/easier.


It's almost impossible to look at the wave information in order to extract note for each instuments. Sure you can do a pitch detection but really it's WAY too much trouble.

Edited by icuurd12b42, 27 January 2011 - 07:38 PM.

  • 0

#540 dsso123

dsso123

    GMC Member

  • New Member
  • 74 posts

Posted 27 January 2011 - 11:28 PM

Ok thanks for replying.

Really what i wanted to do was, so when people play the game they could load their own tracks.
First the game could analize the song (to find the beats).

Could this be done with your Midihero example? I am not looking for these notes to have alot of tracks just something basic (as when it hears a beat it would spawn a random fret).
  • 0

#541 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 28 January 2011 - 01:35 AM

It could be done with the midi thing. though the midi reading is pure gm code.

For other files formats, unfortunatly I did not include the code to process the entire file in the wrapper. You can only analize a playing sound instance.
Possibly, you could start a sound muted, wait 5-10 second and then play a second instance of it unmuted... You would have a 5 second start to perform analisys...
  • 0

#542 5thman

5thman

    GMC Member

  • GMC Member
  • 41 posts

Posted 11 February 2011 - 03:46 AM

I've noticed a problem that I think must be related to the wrapper: every time my game restarts, the game's cpu usage increases considerably. It varies depending how many sounds/tracks are loaded and what format they are -- it increases slightly if the sound folders have a large number of wavs and one ogg, and almost DOUBLES if it loads a large number of wavs and a half dozen mp3s -- but it increases nonetheless and killing the system prior to the game's restart doesn't seem to do the trick. The sound controller is the same as the one in the demo: i didn't leave anything out that I'm aware of. The game is made in GM7. Any thoughts? Is there a more efficient way to restart the game without overloading the FMOD system? Or was this a "quirk" GM7 was known for?

Edited by 5thman, 11 February 2011 - 04:01 AM.

  • 0

#543 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 11 February 2011 - 05:27 PM

If you used the included DemoControler, you will see it catches the game end event to stop and free everything, including the dll. It also catches the game restart event...
  • 0

#544 5thman

5thman

    GMC Member

  • GMC Member
  • 41 posts

Posted 11 February 2011 - 11:24 PM

If you used the included DemoControler, you will see it catches the game end event to stop and free everything, including the dll. It also catches the game restart event...


You mean the game end event code applies if the game ends OR restarts? Or is there a line of code I missed somewhere?

EDIT: Hang on, I think I found it. Left out the code for freeing sounds. Cpu usage is normal now.

Edited by 5thman, 11 February 2011 - 11:41 PM.

  • 0

#545 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 13 February 2011 - 04:09 AM


If you used the included DemoControler, you will see it catches the game end event to stop and free everything, including the dll. It also catches the game restart event...


You mean the game end event code applies if the game ends OR restarts? Or is there a line of code I missed somewhere?


room_end, then game_end will trigger when you restart a game. So I have code in the game_end event to free everything. the controller is static, it's only in the first room but follows on through the last room (being static). So yeah there is code there to free everything.
  • 0

#546 Koning Stoma

Koning Stoma

    GMC Member

  • New Member
  • 128 posts

Posted 21 February 2011 - 10:36 PM

I am trying to add a BPM detection library to your dll. Before I can do this i'll have to get it working. :P

I can compile your source without any errors or problems in CodeBlocks. The only thing I changed was the "#include <stdafx.h>" line. I commented it out.
The resulting dll file is more than twice as big as the one I was using.
When I try to use it for the Fmod demo, I get the "an unexpected error ocurred" message.

I tried to compile it with Dev-C++, but I cant get it to work there. I cant find all the options and I don't know how to do certain things in there.

I'm not really experienced with C++, and I have no idea what is wrong, since I'm not getting any significant warnings or errors when compiling.
  • 0

#547 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 21 February 2011 - 10:47 PM

I am trying to add a BPM detection library to your dll. Before I can do this i'll have to get it working. :P

I can compile your source without any errors or problems in CodeBlocks. The only thing I changed was the "#include <stdafx.h>" line. I commented it out.
The resulting dll file is more than twice as big as the one I was using.
When I try to use it for the Fmod demo, I get the "an unexpected error ocurred" message.

I tried to compile it with Dev-C++, but I cant get it to work there. I cant find all the options and I don't know how to do certain things in there.

I'm not really experienced with C++, and I have no idea what is wrong, since I'm not getting any significant warnings or errors when compiling.


Comment out the GM interface from the dll. methinks you have the codeblock compilable version but the GM:: stuff in the c file is only good for GM7... The bits having to do with filling up a ds list and the code that inits the gm:: stuff
  • 0

#548 Koning Stoma

Koning Stoma

    GMC Member

  • New Member
  • 128 posts

Posted 21 February 2011 - 10:59 PM

Thanks for the (super) fast reply. I tried it and it gives me the same results.
  • 0

#549 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16540 posts
  • Version:GM:Studio

Posted 22 February 2011 - 12:33 AM

Try to pinpoint the problematic function...

Start with an empty room and add the demo sound controller in it... then gradually add in object and call fmod functions a few at a time untill is blows up.
  • 0

#550 Koning Stoma

Koning Stoma

    GMC Member

  • New Member
  • 128 posts

Posted 22 February 2011 - 06:02 AM

Well, it seems to fail right from the start when calling FMODinit. :(
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users