CaKlassen / gmwwise

A Wwise Plugin for GameMaker: Studio
25 stars 4 forks source link

Can't load banks: error #4

Closed doublebee022 closed 7 years ago

doublebee022 commented 7 years ago

Hi! I saw this repository was updated 14 days ago, so I'm hoping someone is still updating it out there...

I followed the instructions to the letter as proscribed in the manual. I'm using the latest version of Wwise, 2016.2.1.5995, which should be compatible...however, when I execute the code to load the banks, I get hit with the following error:

Unable to load the bank: Init.bnk wwise: 64: invalid bank version: make sure the version version [sic] of Wwise that you used to generate the SoundBanks matches that of the SDK you are currently using.

I'm not sure what I'm doing wrong here. I verified that the path is being set correctly. I'm not even trying to post an event yet (the demo project throws an error every time it attempts to do so, incidentally)

CaKlassen commented 7 years ago

Hey there,

The most recent release of GMWwise (1.4.1) supports version 2015.1.6 of Wwise, but not higher! This is because Wwise modifies their SDK between versions, requiring me to recompile the dll/dylib files. Your best bet would be to install this older version of Wwise, and build your banks again.

If I misunderstood the problem, please let me know!

Thanks,

Chris

On Sat, Feb 18, 2017 at 11:10 PM, BrianBibbo notifications@github.com wrote:

Hi! I saw this repository was updated 14 days ago, so I'm hoping someone is still updating it out there...

I followed the instructions to the letter as proscribed in the manual. I'm using the latest version of Wwise, 2016.2.1.5995, which should be compatible...however, when I execute the code to load the banks, I get hit with the following error:

Unable to load the bank: Init.bnk wwise: 64: invalid bank version: make sure the version version [sic] of Wwise that you used to generate the SoundBanks matches that of the SDK you are currently using.

I'm not sure what I'm doing wrong here. I verified that the path is being set correctly. I'm not even trying to post an event yet (the demo project throws an error every time it attempts to do so, incidentally)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CaKlassen/gmwwise/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AFsyiJ1IJ8fh9wuF-Dh_ALBHLb_Rjorfks5rd-rRgaJpZM4MFYiw .

JeffBrilhante commented 7 years ago

Hello,

We are having a great deal of trouble getting sounds to play in our game via GMWwise. We at times have followed the tut to a T and have received no errors and no sounds. Also, we are testing out the demo project to at least see if the implementation will work. So far we have been unsuccessful

error1

error 2

Thank you

doublebee022 commented 7 years ago

There's a minor error in the documentation and in the demo project that's causing this problem. If you simply follow the statement template as displayed by GMS2's IDE when you type 'gmwRegisterObject' you can easily see what the issue is.

At any rate, the problem is simply that the demo project and manual confuse the order of expected arguments when using gmwRegisterObject. The manual lists it as:

gmwRegisterObject(id, XX, global.DEFAULT_GROUP);

when it actually should be

gmwRegisterObject(id, global.DEFAULT_GROUP, XX);

replace 'global.DEFAULT_GROUP' with whatever group variable you want, obviously.

Reminder: XX = the string name of the object you're registering. I recommend using XX + string(id) to differentiate between instances.

I've been meaning to update the manual to reflect this fix. Perhaps I'll find time this weekend.

chaosjoey commented 7 years ago

Hello I'm working Jeff on said project that's having problems,

Sorry to bother you, but I still seem to be having problems both getting our project and the sample project to work. Each seems to have a different problem.

With the sample project I get a "unable to post the specified event 1.44862e-314 for the specified game object 100000" error whenever it tries to play a sound, with numbers changing based on what sound it tried to play. So I tried as you recommended and changed the "gmwRegisterObject(id, "Ball", global.DEFAULT_GROUP);" to be "gmwRegisterObject(id, global.DEFAULT_GROUP, "Ball");" and did the same with the other instances of the gmwRegisterObject() method, but I'm still getting the same errors.

With our project I'm getting sort of a similar problem. We have a SoundController that sets up everything the same way the sample code's sound controller does, but with an event named global.WE_Test instead of the sample ones. Then we have this code in the create event of a object created after the Sound Controller. gmwRegisterObject(id, global.DEFAULT_GROUP, "Test Sound"); gmwPostEvent(global.WE_Test, id); and in said object's destroy event we have gmwUnregisterObject(id,global.DEFAULT_GROUP); It was my understanding that this should play a sound, but it doesn't seem to, though it also doesn't give any errors messages ether. I feel like we must be missing something obvious. Is gmwise not complatible with GMS1.4? Any help would be appreciated.

CaKlassen commented 7 years ago

Based on those calls, that event should be successfully posting. Have you profiled from within Wwise to ensure that the event is reaching the Wwise engine?

If you're not seeing the event posted from the profiler log, it's possible that your initialization logic (eg. bank loading path) is incorrect.

GMWwise should return an error code from most/all functions where it would be important, but there's no easy way at the moment to know what all of the error codes mean without looking at the DLL source. I've been meaning to improve that aspect of the documentation, but unfortunately haven't gotten around to it just yet.

Let me know if none of the above helps!

JeffBrilhante commented 7 years ago

Hello,

So I was successfully able to get Wwise to profile but our events won't post at all / to the profiler

Here is a picture of successfully loading banks myyyduuudee

# I am going to post all of our code to see if we are doing anything wrong. First is the Create Script

//` STARTING FUNCTIONALITY //

// GMWWise Initialization global.GMW_PROFILE = true;

gmwInit();

var path = ("C:\Users\Jeff Brihante\Documents\My Repos\TempestFlash\TempestFlash_Proj\Tempest 141.gmx\datafiles");

if(os_type == os_macosx) { path = working_directory + "sound/banks/Mac/"; } else { path = working_directory + "sound/banks/Windows/"; }

//gmwSetBasePath("C:\Users\Jeff Brihante\Documents\My Repos\TempestFlash\TempestFlash_Proj\Tempest 141.gmx\datafiles\Sound\Banks\Windows"); gmwSetBasePath("Sound/Banks/Windows/");

gmwRegisterCodec(0); gmwRegisterPlugin(6);

// Initialize the banks global.INIT_BANK = gmwLoadBank("Init.bnk"); global.TempestFlash_WwiseBank_BANK = gmwLoadBank("TempestFlash_WwiseBank.bnk");

global.DEFAULT_GROUP = 1;

// Register the sound controller with the engine gmwRegisterObject(id, "Sound Controller", global.DEFAULT_GROUP);

// Initialize links to IDs

// Jeff - Tutorial Event Examples. global.AA = BB or global.WWE_WwiseEventName = WwiseEvent ID

//Jeff - global.WWE_BOUNCE = 3465618802; //Jeff - global.WWE_PLAY_MUSIC = 2932040671;

//Jeff - My Actual Events global.WE_Test = 2051142276

//DemoProj Events

global.WWSG_AUDIO_TYPE = 1382476432; global.WWS_REGULAR_EARS = 3909415557; global.WWS_PLUGGED_EARS = 3764425673;

global.WWXG_WALL_GROUP = 376337484; global.WWX_WALL_STONE = 1216965916;

global.WWP_MUSIC_VOLUME = 1006694123;

// Set the music volume to max and start playing it global.VOLUME = 100;

gmwSetGlobalParameter(global.WWP_MUSIC_VOLUME, global.VOLUME);

// Set up the initial ear state global.PLUGGED_EARS = false; gmwSetState(global.WWSG_AUDIO_TYPE, global.WWS_REGULAR_EARS)

# Next Destroy

// Unregister the sound controller gmwUnregisterObject(id, global.DEFAULT_GROUP);

// Unload the sound banks gmwUnloadBank(global.TEST_BANK); gmwUnloadBank(global.GAME_BANK);

// Stop GMWWise gmwStop();

# Next Step // Toggling music if (keyboard_check_pressed(ord("M"))) { if (global.VOLUME == 100) { // Mute the music global.VOLUME = 0; gmwSetGlobalParameter(global.WWP_MUSIC_VOLUME, global.VOLUME); } else { // Mute the music global.VOLUME = 100; gmwSetGlobalParameter(global.WWP_MUSIC_VOLUME, global.VOLUME); } }

// Toggling ear state if (keyboard_check_pressed(vk_space)) { if (global.PLUGGED_EARS) { // Set the ear state back to regular global.PLUGGED_EARS = false; gmwSetState(global.WWSG_AUDIO_TYPE, global.WWS_REGULAR_EARS); } else { // Set the ear state to plugged ears global.PLUGGED_EARS = true; gmwSetState(global.WWSG_AUDIO_TYPE, global.WWS_PLUGGED_EARS); } }

# And finally posting events

gmwRegisterObject(id, global.DEFAULT_GROUP, "Test Sound"); gmwPostEvent(global.WE_Test, id);

doublebee022 commented 7 years ago

You're not supplying gmwSetBasePath() with the correct information.

You've left out working_directory, which is a built in system variable that you must use to point the loading routine to the right place.

Here's how your code should look, starting at line 4:

//This was set to your local copy, not sure why. All we need is to initialize it here. var path = "";

//Make sure these folders exist under 'included files' in the resource manager (duh) if(os_type == os_macosx) { path = working_directory + "sound/banks/Mac/"; } else { path = working_directory + "sound/banks/Windows/"; }

//Here's where you went wrong: //gmwSetBasePath("Sound/Banks/Windows/");

//Not sure why you went with an explicit reference here, but the variable 'path' above //has your working_directory built into it, so instead it should be: gmwSetBasePath(path);

//-----------------------------------------------------------------------------

Following the logic though I get the sense that you perhaps had it that way at first and it didn't work. Try copying all of your GeneratedSoundBanks\Windows\ folder (presuming you're using windows) over to the "included files", to make sure you've got all the files you need. This is what I do. Apart from the code discrepancies above your implementation is more or less the same as mine. Also, make sure you've got the same RTPCs and whatnot set up in your project as what you're initializing. Most of that seems to be from the demo project, not sure if you meant to leave it in.

JeffBrilhante commented 7 years ago

var path = ""; and gmwSetBasePath(path);

We have had it this way in the past so you are correct but like you said we weren't successful so just trying new things.

I have my generated sound banks path in Wwise set to sound/banks/Windows - sound/banks/Mac...etc. Do you think I need to set them to the default generated soundbanks folder in Wwise and just copy them manually every time I make a change?

Roger that on the RTPC's. As of right now we dont have any RTPC's in our wwise project. I was wondering if we just can make them into comments for reference at a later time? Do we need to initialize them right now in GM? Might be a stupid question but I thought I would clarify if the code needs to have them for whatever reason :)

Thank you ! Hopefully these changes fix everything

CaKlassen commented 7 years ago

Setting something like: global.WWP_MUSIC_VOLUME = XX;

when no such parameter exists in the Wwise project should be fine, so long as you don't try to post the event. (Even then, it should just display an error message in the profiler).

What confuses me is that the profiler isn't even displaying errors for when you try to post events. Are you calling gmwProcess(); every step?

JeffBrilhante commented 7 years ago

Ok awesome!

Joey just made the path changes that you informed us from above as well as add gmwProcess(); in the sound controler's end step event and informed me we are getting sound from Wwise now. I have to confirm with the Wwise profiler but its looking good :D

Thank you soooo very much for your time !!

CaKlassen commented 7 years ago

Glad to hear it! Thanks for bearing with me while the documentation isn't quite up to snuff :)