Moonzel / Godot-PerfBullets

This plugin uses the MultiMeshInstance2D to render thousands of bullets easily while running the logic in C++ to run at maximum performance.
MIT License
355 stars 8 forks source link

Using it on OSX #2

Open WarrenFaith opened 1 year ago

WarrenFaith commented 1 year ago

Hey,

I wanted to try it in a fresh project, so I used the internal AsserLib to get this one but it fails to load. This is the error output:

Can't open dynamic library: /Users/.../workspace/git/.../addons/PerfBullets/bin/spawner.macos.template_debug.framework. Error: dlopen(/Applications/Godot.app/Contents/MacOS/../Frameworks/spawner.macos.template_debug.framework, 0x0002): tried: '/Applications/Godot.app/Contents/MacOS/../Frameworks/spawner.macos.template_debug.framework' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Godot.app/Contents/MacOS/../Frameworks/spawner.macos.template_debug.framework' (no such file), '/Applications/Godot.app/Contents/MacOS/../Frameworks/spawner.macos.template_debug.framework' (no such file). core/extension/gdextension.cpp:455 - GDExtension dynamic library not found: /Users/.../workspace/git/.../addons/PerfBullets/bin/spawner.macos.template_debug.framework Failed loading resource: res://addons/PerfBullets/bin/spawner.gdextension. Make sure resources have been imported by opening the project in the editor at least once.

I see that there are files missing but I am not sure what to do to fix this. I also read in the readme that this is prebuilt for Windows but I haven't seen a guide to built it for OSX.

Any help appreciated!

Moonzel commented 12 months ago

Thanks for leaving the error logs. I have only prebuilt Windows in the plugin so far, as that is the only platform I have available to test with my hardware. If you look towards the bottom of the README, I have put directions on how to edit/build the plugin, and at least the general idea should apply to OSX. If they do not, please comment here, I'd be glad to help more.

Moonzel commented 11 months ago

If there are any further problems, please let me know.

blabtonic commented 10 months ago

Same error happens on Linux as well

Dan-Mizu commented 6 months ago

Yes it seems this addon only seems to work with Windows at the moment. I work on my Godot projects on different platforms and due to this I can't work on projects utilizing this addon on MacOS.

It is a shame because I LOVE this addon so far as the dev experience has been great, and I lack the skills needed to build this on MacOS- and the knowledge to understand why certain gdextension addons fail to run on different platforms. If anyone else figures it out or creates a successful build I would love to know!

Moonzel commented 6 months ago

I am sorry to see that this is still occurring. The way gdextension is set up should allow this to work seamlessly on MacOS and Linux. Has anyone on Mac or Linux tried building the project through command line? Since all I have is a Windows PC, it makes it extremely difficult for me to debug other OSs.

PedroG98 commented 5 months ago

Hello, I managed to run the plugin on Linux. Note that I'm not sure which of the following steps are necessary:

It's a bit confusing, but I hope it helps.

Moonzel commented 5 months ago

This is great progress! Thank you for writing this out. I see how this would be an issue, as I was not aware that the name changed per OS. I will attempt to update the spawner.gdextension file with the new name, but I need somebody on MacOS to try these steps to get the name on MacOS. @Dan-Mizu, would you be willing to try?

Ughuuu commented 5 months ago

I mean, I can add a PR and add automated actions to this. I recently merged the build and sign actions into godot-cpp-template https://github.com/godotengine/godot-cpp-template?tab=readme-ov-file#usage---actions

Moonzel commented 4 months ago

If you think that would fix it, go right ahead! I do not know as much about this aspect of GDExtension.

Ughuuu commented 4 months ago

Do you have a apple developer account though? As after those steps(in the action I linked), you will still need to sign it.

Moonzel commented 4 months ago

I was not aware I needed that, I do not have it. Is there any other way you can think of to debug this?

Ughuuu commented 4 months ago

If you dont sign it it will work on mac(and other platforms) but on mac it will give error and you have to click bypass security. Ill create a branch for you to review this week.

Ughuuu commented 4 months ago

Also, for this i would suggest you do it different. First, you move your code to /src folder. Then you clone as subrepo godot-cpp. In either godot-cpp or thirdparty/godot-cpp folder. I can start on a pr with this to show the changes, if you believe they might be good(changing locations). Also, the build output i would put as bin/addons... And such in github a actions you just export that.

Ughuuu commented 4 months ago

Also what I propose is basically actions that would build for all platforms after every commit, eg. similar to this: https://github.com/appsinacup/godot-rapier-2d/actions

Moonzel commented 4 months ago

I will be honest with you, I am not very familiar with Github and its actions. Please make a PR for your ideas, as they seem to make sense, just make sure to update the paths on any of the GDExtension files that need a path (this has caused problems in the past).

Ughuuu commented 4 months ago

On it!