utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
371 stars 42 forks source link

Various script errors when building #185

Open d6e opened 6 months ago

d6e commented 6 months ago

When I do a godot build, I get these script errors in my CI logs:

SCRIPT ERROR: Parse Error: Could not find type "ParameterDisplay" in the current scope.
          at: GDScript::reload (res://addons/fmod/tool/ui/EventParametersDisplay.gd:14)
ERROR: Failed to load script "res://addons/fmod/tool/ui/EventParametersDisplay.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2775)
SCRIPT ERROR: Parse Error: Could not find type "FmodBankExplorer" in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:12)
SCRIPT ERROR: Parse Error: Identifier "FmodEditorExportPluginProxy" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:14)
SCRIPT ERROR: Parse Error: Identifier "FmodEmitterPropertyInspectorPlugin" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:15)
SCRIPT ERROR: Parse Error: Identifier "FmodBankLoaderPropertyInspectorPlugin" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:16)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:41)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:45)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:45)
SCRIPT ERROR: Parse Error: Identifier "FmodBankExplorer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodPlugin.gd:49)
piiertho commented 6 months ago

Hello ! Can you give informations about the CI steps you're doing with where it fails ?

d6e commented 6 months ago

Right, sorry, the errors can be reproduced simply by launching the editor from the CLI: godot --editor --quit --headless

piiertho commented 2 months ago

Sorry for late reply. It looks like the types has not been added to project.godot.
Did you commit changes to this file ?

3ter commented 1 month ago

I've got similar errors using https://github.com/abarichello/godot-ci/blob/master/.gitlab-ci.yml to export my game to Windows.

$ godot --headless --verbose --export-release windows ../build/windows/$EXPORT_NAME.exe
Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Using "default" pen tablet driver...
JoypadLinux: udev enabled and loaded successfully.

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 2995524600
EDITOR API HASH: 3767149329
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
EditorSettings: Load OK!
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:8)
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:11)
ERROR: Failed to load script "res://addons/fmod/FmodManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:[27](https://gitlab.com/imagine-group/knowledge-is-power/-/jobs/6885192305#L27)26)
ERROR: Failed to create an autoload, script 'res://addons/fmod/FmodManager.gd' does not inherit from 'Node'.
   at: _create_autoload (editor/editor_autoload_settings.cpp:423)

My project.godot has these entries regarding fmod (I did not modify them):

[Fmod]

General/auto_initialize=true
General/channel_count=1024
General/is_live_update_enabled=true
General/is_memory_tracking_enabled=false
"Software Format/sample_rate"=48000
"Software Format/speaker_mode"=3
"Software Format/raw_speaker_count"=0
General/default_listener_count=1
General/banks_path="res://"
General/should_load_by_name=false
DSP/dsp_buffer_size=512
DSP/dsp_buffer_count=4
"3D Settings/doppler_scale"=1.0
"3D Settings/distance_factor"=1.0
"3D Settings/rolloff_scale"=1.0

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"

[editor_plugins]

enabled=PackedStringArray("res://addons/fmod/plugin.cfg")
piiertho commented 1 month ago

I've got similar errors using https://github.com/abarichello/godot-ci/blob/master/.gitlab-ci.yml to export my game to Windows.

$ godot --headless --verbose --export-release windows ../build/windows/$EXPORT_NAME.exe
Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
TextServer: Added interface "Dummy"
TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
Using "default" pen tablet driver...
JoypadLinux: udev enabled and loaded successfully.

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
CORE API HASH: 2995524600
EDITOR API HASH: 3767149329
WARNING: Custom cursor shape not supported by this display server.
     at: cursor_set_custom_image (servers/display_server.cpp:505)
EditorSettings: Load OK!
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:8)
SCRIPT ERROR: Parse Error: Identifier "FmodServer" not declared in the current scope.
          at: GDScript::reload (res://addons/fmod/FmodManager.gd:11)
ERROR: Failed to load script "res://addons/fmod/FmodManager.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:[27](https://gitlab.com/imagine-group/knowledge-is-power/-/jobs/6885192305#L27)26)
ERROR: Failed to create an autoload, script 'res://addons/fmod/FmodManager.gd' does not inherit from 'Node'.
   at: _create_autoload (editor/editor_autoload_settings.cpp:423)

My project.godot has these entries regarding fmod (I did not modify them):

[Fmod]

General/auto_initialize=true
General/channel_count=1024
General/is_live_update_enabled=true
General/is_memory_tracking_enabled=false
"Software Format/sample_rate"=48000
"Software Format/speaker_mode"=3
"Software Format/raw_speaker_count"=0
General/default_listener_count=1
General/banks_path="res://"
General/should_load_by_name=false
DSP/dsp_buffer_size=512
DSP/dsp_buffer_count=4
"3D Settings/doppler_scale"=1.0
"3D Settings/distance_factor"=1.0
"3D Settings/rolloff_scale"=1.0

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"

[editor_plugins]

enabled=PackedStringArray("res://addons/fmod/plugin.cfg")

Can you try to run godot --headless --editor --quit before trying to create the export ?

3ter commented 1 month ago

Unfortunately godot --headless --editor --quit is already part of the pipeline.

I've just added a stage to download the actual files (including the libraries which are not saved to the repository to save storage space):

download-addons:
  stage: download-addons
  script:
    - apt-get update
    - apt-get install -y curl
    - cd $EXPORT_NAME/addons
    - rm -rf fmod
    - curl -L https://github.com/utopia-rise/fmod-gdextension/releases/download/4.2.0-4.2.0/addons.zip -o addons.zip
    - unzip addons.zip -d .

And directly afterwards there is this (which I didn't change)

# Open the editor to import assets in case the cache was empty or outdated
import-assets:
  stage: import-assets
  script:
    - godot --headless --verbose --editor --quit

Unfortunately the errors persist. I can log all of them if it helps godot_export_log.txt

I don't understand the following error in particular because the file inflated just fine from the zip:

inflating: ./fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

but then

ERROR: Failed to open /builds/imagine-group/knowledge-is-power/godot-project-top-down/addons/fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll
   at: copy (core/io/dir_access.cpp:346)

💥EDIT: Now that I think about it. How could a .dll file be opened on linux anyways? Does it have to open those for the export? Shouldn't it use the linux ones?

I just checked with ldd that all .so files can be used. Is there some additional setup needed for linux (in this case ubuntu)?

piiertho commented 1 month ago

Unfortunately godot --headless --editor --quit is already part of the pipeline.

I've just added a stage to download the actual files (including the libraries which are not saved to the repository to save storage space):


download-addons:

  stage: download-addons

  script:

    - apt-get update

    - apt-get install -y curl

    - cd $EXPORT_NAME/addons

    - rm -rf fmod

    - curl -L https://github.com/utopia-rise/fmod-gdextension/releases/download/4.2.0-4.2.0/addons.zip -o addons.zip

    - unzip addons.zip -d .

And directly afterwards there is this (which I didn't change)


# Open the editor to import assets in case the cache was empty or outdated

import-assets:

  stage: import-assets

  script:

    - godot --headless --verbose --editor --quit

Unfortunately the errors persist. I can log all of them if it helps

godot_export_log.txt

I don't understand the following error in particular because the file inflated just fine from the zip:


inflating: ./fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

but then


ERROR: Failed to open /builds/imagine-group/knowledge-is-power/godot-project-top-down/addons/fmod/libs/windows/libGodotFmod.windows.template_release.x86_64.dll

   at: copy (core/io/dir_access.cpp:346)

💥EDIT: **Now that I think about it. How could a .dll file be opened on linux anyways?

Does it have to open those for the export? Shouldn't it use the linux ones?**

I just checked with ldd that all .so files can be used. Is there some additional setup needed for linux (in this case ubuntu)?

It should use Linux so files.

I think this is because of Godot cache not being present. I tried locally to remove my Godot cache and got same errors and cannot regenerate it using import command line argument. Can you try to commit your Godot cache (I know this is not a good practice) just to see if error goes out ?

3ter commented 1 month ago

Yeah, when the cache folder is included the pipeline works (although there were some errors in the logs). image

FMOD Sound System: Successfully set DSP buffer size
[ERR] FMOD_OS_Library_Load                     : dlopen failed to open 'libpulse.so.0', dlerror = libpulse.so.0: cannot open shared object file: No such file or directory
[LOG] SystemI::init                            : Initialize version=20212 (131544), maxchannels=1024, flags=0x00030004
[ERR] FMOD_OS_Library_Load                     : dlopen failed to open 'libpulse.so.0', dlerror = libpulse.so.0: cannot open shared object file: No such file or directory
[LOG] SystemI::setOutputInternal               : Setting output to 'FMOD ALSA Output'
[LOG] OutputALSA::registerLib                  : Loaded ALSA version 1.2.6.1.
[LOG] OutputALSA::enumerate                    : Found device NAME:null IOID:(null).
[WRN] SystemI::init                            : No output sound devices found - switching output mode to FMOD_OUTPUTTYPE_NOSOUND

But in our case the project doesn't really like getting exported it seems. The .exe closes on itself (and I don't see an error message when running it from the console). This has nothing to do with FMOD though, at least in a newly created project with the addon enabled it exported fine.

EDIT: I found out what let the game crash so ungracefully. When I remove (or disable, mind the missing *) my autoload (it's the FmodBankLoader) it runs smoothly again... If you've got more intel on this, please consider answering here: https://github.com/utopia-rise/fmod-gdextension/discussions/222.

[autoload]

FmodManager="*res://addons/fmod/FmodManager.gd"
AudioSingleton="res://autoloads/audio_singleton.tscn"

EDIT2: 💥 It was not (really) that, because the folder containing the banks started with an uppercase letter (like in the example in the docs: https://fmod-gdextension.readthedocs.io/en/latest/user-guide/3-nodes/) and for some reason in the FmodBankLoader that folder had a lower case letter. It would be REALLY helpful to have at least some hint at the error in contrast to no messages at all. image image