AnJo888
AnJo888

Reputation: 71

Godot - Game 'executable' won't find resources

there. When using Godot 3.2.2 stable (all templates updated) to export for OSX (from High Sierra) and Windows (VMWare with Windows 10) , many resources are not find, by the interpreter. While testing in the IDE, everything runs perfectly. I already changed files names (avoiding spaces and non alphanumeric and '_' characters), deleted everything from the '.import' folder and re-imported all files, and even changed my code to avoid loading stuff 'on the fly', in order to have all resources properly referred in the resulting code. The files are in their original folders, their '.import' files are there too and mapping to existing files in the '.import' folder. I was able, too, to check the '.pck' file and the '.wav', '.ogg' and '.png' files are there. The game will prompt messages like:

ERROR: _load: No loader found for resource: res://sounds//Starting_Lights.ogg.
       At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sounds//Testing.wav.
       At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sprites//Backlash_Pic.png.
   At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sprites//Backlash_Grand_Prix.png.
   At: core/io/resource_loader.cpp:285.

One of the 'not found' resource '.import' files has

[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://sprites/Backlash_Grand_Prix.png"
dest_files=[ "res://.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex" ]

and all indicated files are there

AnJo888i7:sprites AnJo888$ pwd
/Users/AnJo888/Desktop/Godot/project_mr/sprites
AnJo888i7:sprites AnJo888$ ls -l Back*
-rw-r--r--@ 1 AnJo888  staff   55120  9 Jun 21:31 Backlash_Grand_Prix.png
-rw-r--r--@ 1 AnJo888  staff     693  7 Jul 18:36 Backlash_Grand_Prix.png.import
-rw-r--r--@ 1 AnJo888  staff  255514 29 Jun 16:40 Backlash_Pic.png
-rw-r--r--  1 AnJo888  staff     672  7 Jul 18:36 Backlash_Pic.png.import
AnJo888i7:sprites AnJo888$ ls -l ../.import/Back*
-rw-r--r--  1 AnJo888  staff       91  7 Jul 18:35 ../.import/Backlash.obj-1faf80b2c76bbdff34635db74f883c59.md5
-rw-r--r--  1 AnJo888  staff   879958  7 Jul 18:35 ../.import/Backlash.obj-1faf80b2c76bbdff34635db74f883c59.mesh
-rw-r--r--  1 AnJo888  staff       91  7 Jul 18:35 ../.import/BacklashFF.obj-1f7907e7c14594be339288bdbcc49d13.md5
-rw-r--r--  1 AnJo888  staff  1134886  7 Jul 18:35 ../.import/BacklashFF.obj-1f7907e7c14594be339288bdbcc49d13.mesh
-rw-r--r--  1 AnJo888  staff       91  7 Jul 18:36 ../.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.md5
-rw-r--r--  1 AnJo888  staff    55358  7 Jul 18:36 ../.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex
-rw-r--r--  1 AnJo888  staff       91  7 Jul 18:36 ../.import/Backlash_Pic.png-802dae49352de96e7456539e639a1c34.md5
-rw-r--r--  1 AnJo888  staff   268132  7 Jul 18:36 ../.import/Backlash_Pic.png-802dae49352de96e7456539e639a1c34.stex
AnJo888i7:sprites AnJo888$ 

So... although all seems to be in place, the game will not play music/sounds (some sounds are played and I changed the loading code, for the others, in order to make everything as equal as possible, without success - all sounds are loaded by a couple os singletons) and not show some textures (mainly stuff loaded during the game execution).

These sounds load and play:

    extends AudioStreamPlayer
    
    var audioTeamsFiles = ["res://sounds/Team_Braillewalk.ogg",
                            "res://sounds/Team_Candy_Cane.ogg",
...
                            "res://sounds/Team_Cash_is_King.ogg",
                            "res://sounds/Team_Watermelon.ogg"
                            ]
    
    var audioTeamName
    var names = Array()
    var volSpeech
    
    
    func _ready() -> void:
        volSpeech = get_node("/root/Globals").volSpeech
        for i in range(audioTeamsFiles.size()):
            audioTeamName = AudioStreamPlayer2D.new()
            audioTeamName.stream = load(audioTeamsFiles[i])
            audioTeamName.volume_db = volSpeech
            names.append(audioTeamName)
            add_child(names[i])
    
    
    func say_team_name(team):
        names[team].play()
    
    
    func shut_team_name(team):
        names[team].stop()
    
    
    func set_volume():
        volSpeech = get_node("/root/Globals").volSpeech
        for i in range(audioTeamsFiles.size()):
            names[i].volume_db =  volSpeech

These will not load:

    extends AudioStreamPlayer
    
    var audioSoundFiles = ["res://sounds/Live_the_Life.ogg",
                            "res://sounds//Love_the_Sound.ogg",
                            "res://sounds//Love_this_Song.ogg",
...
                            "res://sounds//Vuvuzelas.ogg"
                            ]
    
    var audioSound
    var sounds = Array()
    var volEffects
    var volMusic
    var volSpeech
    
    onready var globals
    
    func _ready() -> void:
        globals = get_node("/root/Globals")
        for i in range(audioSoundFiles.size()):
            audioSound = AudioStreamPlayer2D.new()
            audioSound.stream = load(audioSoundFiles[i])
            sounds.append(audioSound)
            add_child(sounds[i])
        set_volume()
        play_sound(0)
    
    
    func play_sound(sound):
        sounds[sound].play()
    
    
    func quiet_sound(sound):
        sounds[sound].stop()
    
    
    func set_volume():
        volEffects = globals.volEffects
        volMusic = globals.volMusic
        volSpeech = globals.volSpeech
        for i in range(audioSoundFiles.size()):
            if i == 0:
                sounds[i].volume_db = volMusic
            elif i < 6:
                sounds[i].volume_db = volSpeech
            else:
                sounds[i].volume_db = volEffects

I even included all kind of extensions, available in the export feature, and pointed the sprites and sounds folders, to be included (I used the triple slash I saw in some other reference to Godot's exporting 'issues').

[preset.0]

name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter="res:///sounds/*, res:///sprites/*"
exclude_filter=""
export_path="./AGC.dmg"
patch_list=PoolStringArray(  )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
application/name="Absolutely Goode Championship"
application/info="Made with Godot Engine"
application/icon="res://AGC_Icon_256.png"
application/identifier="com.AGC.game"
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
codesign/enable=false
codesign/identity=""
codesign/timestamp=true
codesign/hardened_runtime=true
codesign/entitlements=""
codesign/custom_options=PoolStringArray(  )
texture_format/s3tc=true
texture_format/etc=true
texture_format/etc2=true

It would be great if somebody could help me figure out what I'm missing here...

Btw, if I copy the sprites and sounds folders with the '.exe' in Windows, everything works fine and I was willing to use the same fix for the OSX version (regardless the duplicated files), but not even copying those folders to the app package worked.

Thanks in advance for all answers.

Upvotes: 1

Views: 2933

Answers (1)

AnJo888
AnJo888

Reputation: 71

So... after the realization that some of my paths were wrong, I revised all of them and, after correcting the 'wrong' ones, the exported game is working OK. The issue is that Godot's IDE is quite forgiving when it comes to find files and such, even if we make mistakes like using double slashes (in other places than 'res://') when pointing to resources. Not trying to lessen the programmer's responsibility to get things done right, but it would've been better, IMHO, if the IDE had punched me in the face earlier, saying: "Your F-ing files are not available, in the F-ing folders you F-ing said they were."... or something like that. Anyway... as the Lego Movie stated... Everything is Awesome...

Upvotes: 0

Related Questions