Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity Build with custom plugins not working on other computers #50

Closed
JimPapanick opened this issue Oct 18, 2024 · 14 comments
Closed

Unity Build with custom plugins not working on other computers #50

JimPapanick opened this issue Oct 18, 2024 · 14 comments
Assignees

Comments

@JimPapanick
Copy link

in unity i've made a game that uses custom audio plugins from max msp's rnbo. i built it on a regular laptop windows 11 home. is there any obvious reason why the plugins in other laptops don't work? I attach my game below so you can look for yourself at the build. https://error-occurred.itch.io/the-room-puzzle

For me it seems that other laptops are missing some libraries but isn't everything inside the exported plugin?

I'm not a programmer or a pro at maxmsp, so please lemme know if it's something that can or can't be fixed

@jinpavg jinpavg self-assigned this Oct 18, 2024
@jinpavg
Copy link
Contributor

jinpavg commented Oct 18, 2024

Hi Jim, very cool idea for a game! Unfortunately (or fortunately?) I think that the game is working for me, so I'm not getting any errors.

I can start the game, I can start to play with my voice, I can tell the ali baba door "open sesame," etc. I hear music playing in the background (very quiet, but I hear it).

Can you share some of the errors you are getting on other machines?

@JimPapanick
Copy link
Author

Should've specified. Those levels don't use any rnbo plugins so far. That starts after level 4 when you have to dim up the lights. The dimmer should be moving along with your voice but it doesn't. Also next level where you have to lift the crates , they also should be moving but aren't. To quickly go to those rooms just say "skip" or "skip this level" . All the solutions and cheatcodes are in the Walkthrough.txt

@JimPapanick
Copy link
Author

JimPapanick commented Oct 22, 2024

Has anyone looked into this? Anyone else have a similar problem? It's like anything that includes the exported dll's isn't being initialized on other computers.
I've checked for OS (they have the same if not very close versions)
I've checked for .NET Framework versions (Also same between pcs)
I've checked audio input/output general settings (same)
I've checked if the .dll's are in the downloaded build folder and they seem ok

It just seems like the game is working on the pc that it was built on but on others, ONLY the exported custom rnbo plugins aren't working.

@jinpavg
Copy link
Contributor

jinpavg commented Oct 22, 2024

Hi Jim -- skipping the levels with "skip" gets me to the high/low note sections, and while I'm not sure if they are functional, I also don't see any errors. Are you getting any errors that you could copy and share here in text form?

If you build your RNBO plugin for Windows, and then build your game from Unity for Windows with the plugin included in your build, you should be able to hear your RNBO-generated audio on other Windows machines.

Here's a question -- if you build your Windows game from Unity, can you quit the Unity editor and successfully run the game (RoomPuzzle.exe) with RNBO-generated audio on that computer? Or are you only hearing audio in the editor?

If you can only hear audio in the editor, you may need to make sure your game has some logic that actually spawns the audio source or listener in the scene, as you might be hearing the audio of the Audio Mixer in-editor but not actually have a component that generates this audio in your game.

Thank you for your patience -- as this is an experimental "use at your own risk" repository, we do endeavor to support you here, but the support might take a little bit of time.

@JimPapanick
Copy link
Author

JimPapanick commented Oct 23, 2024

Thanks for all the troubleshooting, it's due to november so if it seems I'm rushing , it's cause i'm anxious haha

1: The game is always played from the build folder' .exe with the Unity editor and Hub closed.
2: The game never fails to work in the pc it was built on.
3: Other pc's get stuck at the dimmer where you light up the room with your voice.
4: In levels 5 and 6 your voice should go through an fzero~ based plugin with NO OUTPUT so you should NOT hear your voice. I've noticed that I do hear my voice on those levels on other computers (not the one it was built on). The fact that you can hear your voice in those levels indicates that both the attenuation and my custom plugins aren't working (pic attached)
5: I'm getting no errors or warnings when playing through the editor.
image

@jinpavg
Copy link
Contributor

jinpavg commented Oct 23, 2024

Thank you... it sounds like the RNBO plugin dll is probably not being included in your build, or something like that. Can you also share a screenshot of your build settings in the Unity editor, your package settings in the package manager, anything that we could look at to see how you have the project set up?

@JimPapanick
Copy link
Author

JimPapanick commented Oct 29, 2024

The dll's are all here (screenshot from another pc, not the one it was built. This is what you have also from what you downloaded)
image
These are the build settings and where the plugins are within the asset folder
image
Experimental package in use, i don't know if this is of importance
Also package manager with rnbo types installed
image

please let me know if there is anything else you need

@JimPapanick
Copy link
Author

if screenshots don't make sense, do you mind making a discord sharescreen? this would really help I think

@jinpavg
Copy link
Contributor

jinpavg commented Nov 5, 2024

Hi Jim,

Thank you for sharing the screenshots... everything you've shared looks right, but there are a few things you'd want to make sure about. Some of this goes a bit beyond the support we can provide, and is more about Unity development in general, but I can try to point you in the right direction. The "experimental" heading for the RNBO packages is expected and accurate!

  1. You say that the OS between your build machine and other machine is similar, which is good -- but you should confirm also that the architecture you've built on is the same as the architecture you'd like to build for.
  2. One thing to check is whether you are building the RNBO plugin in a Release configuration. In this repo's README, in the "Building for Windows" section, you can find this step: cmake --build . --config Release If you are building a Debug version, that could be a source of your issue.

I'd like us to try something out. Below you can find a link to a simple unity game which uses a RNBO plugin, I've confirmed that it works on multiple Windows machines. I'd like you to try to build this game yourself, using the patch I've pasted below, and following the steps outlined below.

patch:

<pre><code>
----------begin_max5_patcher----------
1651.3oc6a08aaaCD+YWf9+ffdrvIPTxeDOLLfMrWx.VcwJvdoXvfRh1lcRj
tTToIsX4u8QR8EoDss7hiQWpxCQ17HOd72c73OIq6qu9UibCo2ixbc9AmO3L
ZzWEsLR0lrkQUMLxMEdeTBLS0QWzWhgQO5NtT1NHOZKlrYECEwKzDX57q8F6
3u.HuLYZ0+c9qpAQxSwjDDWoQ+pVwwpIfF9wq7c05JMmW0WOUq+yqek7p3x3
da1DzmEJtVs2AYDXJRIhQBoMKHN5dtklOv5bxL0JzS8Ee80YgkyeXGpXDtY3
MDXh6X8OkfyDJr+XCXOXSPUyRC+NDKCSIpAAtN35.yEBhUhUUf0H203Dj1n.
iqD.2sSq8Q5CRhwejpz0hwMsgIEs40zFCcGtREZMCYBPkKPzbVgu39YSb0zD
MFwH4XkAU1pzqWYZJ2qzOlsCF03Lq0faiyxepuz+.lrPdYlmxaMe1DM20H2M
LbbF9KnJ+qZDSM5BGK.b0LkSTeNtY1L1MYfS5gmlBNXXpY.4adzw6ZeCYVhJ
8meiJP7FOsnx.80vghLM6k0Xw1wiybaMDsXRftHoqYUNA+obT4veyiq5pAU2
xPLrzbrohZudoNbq6PYhgpvjmEuPzCQInGEaz8NpmX1MWuHvS6u4hvoESuFL
UuwYhvwYmlWZ7SweM8.9K+NfsXYyfqfb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S6qAVtRdFME+SDqdFMEvIFWc7vdJCuQbV
Yw1Mg8bUPP4lklMmEbEuU6NIpKmhaWV0rksM6OCcCQVsMutb3FK+FUl4TNLf
1mYz25L52mYrBP0flBh8WNro0IgWBvQLk+WQGY1X4oFQBtOHM.pSGg4bZF7N
CpStxFhk4+E2qskCepAZ5NNNE+k58.tKafHWEwJDGwVgHcHm4lmWF5OG4OyK
JL7pEgyCuB.Pqu5F4W8uIZZre3DAQJX2MFEVXsocHi7NIGL5ZKEWTiEhIxxG
pCCRsdjPIarWQWFcKkFKKpnVkgTibZVzpZ07ikrD+IqpJaqfobOlxpnqflBX
pFtZUNaEoeLOwsr71ZmQrpH2rlIDzTNY1yB5Wzo8WMcmzz40moyqyzUtZaUe
YpYpcck0tlxrTOYGnVx5TGYkAp1peL4CG60uRzg+Ebo4Fp.
-----------end_max5_patcher-----------
</code></pre>

steps:

  1. export this patch to an export/ directory, according to the instructions in this repo's README
  2. build in Release configuration, using cmake --build . --config Release, call it something like "RNBOTESTER"
  3. create a new Unity project and import the RNBOTypes package and the package including this RNBOTESTER plugin that you've just built
  4. in your Unity scene, add an Audio Source, and add to your assets an Audio Mixer.
  5. set the output of the Audio Source to the Master track of the Audio Mixer.
  6. load the rnbo plugin RNBOTESTER on the Master track of the Audio Mixer.
  7. start the scene, confirm that you hear the low tone
  8. build the game using Unity's "Build and Run" window
  9. confirm that the game runs and you hear audio
  10. zip up the entire build folder and send it to another computer, confirm that you hear sound

If this works, the game you build should sound just like the one at this link:

https://www.dropbox.com/scl/fi/emp75y5ll2humfvfppzcy/unitybuild.zip?rlkey=jexprdz84lnw779xe2z8sffkn&st=i3a4qesl&dl=0

If this works, we can confirm that RNBO is working correctly for you. Now, check to see if there is any step here that looks different to how you are using RNBO in your project.

@JimPapanick
Copy link
Author

JimPapanick commented Nov 5, 2024

before I do any of these (because I have to renew my rnbo license to do that and I'd like to avoid unnecessary cost)
This is how I export my plugins

1: export the plugin in subfolder "export" in main folder D:\Unity\RNBO\rnbo.unity.audioplugin-main
2: CMD and write below:

D: (secondary disk for more space)

cd (drag n drop the "build" folder in D:\Unity\RNBO\rnbo.unity.audioplugin-main)

ENTER

cmake .. -DPLUGIN_NAME="however the plugin will be called"

ENTER

cmake --build .

ENTER and done

3: Ctrl+C kai Ctrl+V the new folder in the build, within RNBOTypes so that Unity can have it

I don't know if i should add "cmake --build . --config Release" instead of "cmake --build ." at the end of each export of my plugin.
Is that what is wrong? I am missing the --config Release part?

@jinpavg
Copy link
Contributor

jinpavg commented Nov 5, 2024

That's my suspicion -- you are on a Windows machine, so if you run cmake --build ., you'll be building in a Debug configuration. You probably want a Release configuration if you are packaging your game to be played on other people's machines. So, instead of cmake --build ., run cmake --build . --config Release

@JimPapanick
Copy link
Author

That was the problem exactly!
I was building without "--config Release" thus anything in the audio plugins was not properly built for release.

Thank you for your patience

1 similar comment
@JimPapanick
Copy link
Author

That was the problem exactly!
I was building without "--config Release" thus anything in the audio plugins was not properly built for release.

Thank you for your patience

@jinpavg
Copy link
Contributor

jinpavg commented Nov 7, 2024

Hi Jim! Very glad to hear that things are working for you now.

@jinpavg jinpavg closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants