Strange error while trying to load proxy collection (SOLVED)

Hi guys, last night my game was working before I went to bed today it isn’t. Not sure what happened when I went to sleep. I’ve got a title screen, that loads initially and when you push space it’s supposed to load the first level. But now I’m getting this message…

WARNING:RESOURCE: Resource not found: /icarus/feather/feather_v2/feather_pixel.texturesetc
WARNING:RESOURCE: Unable to create resource: build/default/main/hud/hud.guic
WARNING:RESOURCE: Unable to create resource: build/default/main/main_generated_1.goc
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /main/main_generated_1.goc.

The first line seems strange to me because I changed the file location of the feathers earlier yesterday and it didn’t seem to affect anything then (and I thought changing files shouldn’t affect anything anyway). But like I say it was working right before I went to bed and now it’s not. Any ideas what might have gone wrong? Cheers

To try and figure out what’s going on I’ve made a dummy project. This has a loader collection, with a proxy object and loader script. I used exactly the same script to try and load the proxy collection in this new project and it works. Now I am really really confused, because shouldn’t it work in both projects?

-- loader.script
function init(self)
	msg.post(".", "acquire_input_focus")
	not_playing = true
end

function on_message(self, message_id, message, sender)
	if message_id == hash("restart") then
		-- print("I'm not sure if this is working")
		msg.post("#collectionproxy", "unload") -- new
		msg.post(".", "acquire_input_focus")
		msg.post("/gui", "enable") -- new
		not_playing = true
	end
	if message_id == hash("proxy_loaded") then
        -- New world is loaded. Init and enable it.
        msg.post(sender, "init")
        msg.post(sender, "enable")
    end
    if message_id == hash("proxy_unloaded") then
		print("proxy_unloaded", sender)
	end
end

function on_input(self, action_id, action)
	if action_id == hash("start") and not_playing then
        if action.pressed then
        	not_playing = false
        	msg.post("/title", "disable")
        	--msg.post(".", "release_input_focus")
			msg.post("#collectionproxy", "load")
		end
	end
end

Now, without making any changes to my original project the initial title screen is not even loading. Very very strange. It just crashes giving the error message that I mentioned before. Earlier today, it would load the title screen then crash when I pushed the designated button to load the first level. I’m using editor 1. Tried it in editor 2 and it doesn’t work there either.

Also, I had a factory that had been working perfectly well for about week as far as I could tell. I changed the sprite that it was using earlier yesterday, after which sometimes it would work and other times it wouldn’t I’m not sure what happened there either. I recorded these vids just before I went to bed, when the game seemed to be working. One of them is when the factory is working. The other one when it’s not running on the same script. With the only changes I made being the sprite and in the script the size of the sprite in the create factory call. I’m not sure if there’s some kind of bug here or my coding skills (which are admittedly limited) need work.

It’s hard to tell what could be wrong. What if you try the collections one by one as main collection in game.project? What if you select Rebuild instead of Build? Is this from Editor 1 or 2? What if you remove the build folder inside your project and build again?

You’re welcome to invite me (bjorn.ritzl@king.com) to the project and I can take a look (don’t forget to sync the project!).

1 Like

I’m using editor 1, because 2 doesn’t display graphics properly for me (This bug is still being resolved, I think). I tried those couple of things thanks, and they didn’t work either unfortunately. The thing that really throws me is the message looking for a resource in a folder that doesn’t even exist anymore, though the resource does exist elsewhere. I tried the same set up for the feather in the new dummy project and it works. I think I’m just going to rebuild from the ground up because I wasn’t that far a long into making the game anyway. It’ll be good practice to try and really understand what’s going on. I’m very new to gamedev and even more new to defold. Thanks so much for the offer. Please don’t feel obligated to sort through my code though, I know you must be busy, just with the questions you answer on the forum, let alone whatever else you do (unless of course you think it’ll be useful for the improvement of the engine, then I’m more than happy for you take a look. I added you anyway). Cheers :grin:

Ok, well, see if rebuilding the structure from the ground up helps. If not, let me know and I’ll take a look.

This is part of my job (well, maybe not rummaging through other people’s code on a daily basis, but helping them make better games through forum support). I get paid to do it and I enjoy helping out! Never hesitate to ask for help on the forum or on Slack!

1 Like

Awesome. That’s good to hear. In that case could you please have a quick scan. I’ve added you to the Icarus Ascension project. It’d be good to get feed back as to what’s going on. I’m struggling to figure it out. Thanks so much!

I’m trying to learn game development and I like what defold has to offer, so there’ll be an avalanche of questions on the way… Just while I’ve got you here I’d like to know what kind of questions are hmm, "appropriate"might be the right word, for the forum or slack if there’s a difference. Example, this is the level that I’m at with some things…

I’m trying to use the tile source option for collision detection for my main character. I’ve highlighted all the frames that I want to use with the default colour…

I assumed from explanation in the documentation, that to use the above collision shapes that I’d need to select that tilesource in the collision shape box that the arrow is pointing to, but that doesn’t seem to be working. No options are coming up when I type anything in when I push the “…” button. So, I just used the standard circle and box shapes for now.

Now, 1. Could you please tell me the answer to that question please :grimacing: and 2. back to the original question: is this kind of thing better put on slack or the forum. I only ask because most of the forum questions seem a lot more advanced (at least by my standards) than this. Cheers :+1:

Well, when you use a tilesource to create a tilemap you can then use the tilemap itself as a collision shape:

It doesn’t work the same way if you use the tilesource in a sprite. In the case of a sprite you need to create collision shapes the way you’re doing in your screenshot.

It doesn’t hurt to ask on Slack first. For simple questions you might get an immediate answer if someone is online. But there’s also a risk that no one sees your question and it might get lost in other discussions. Asking on the forum is almost guaranteed to give you an answer although you might have to wait a bit longer. The Defold team is based in Stockholm and we’re most active during normal office hours but now that the community is growing someone else might just as well answer your question.

PS And don’t forget to search the forum before asking. Someone might have already solved your problem or the question might have been answered already.

2 Likes

Ok, so I’ve figured it out. The hud.gui has an invalid path to the texture that is used. The path is:

/icarus/feather/feather_v2/feather_pixel.tilesource

But the actual file is located here:

/icarus/feather/feather_pixel.tilesource

Update the path to the texture and everything is running as expected!

5 Likes

Thanks heaps. You’re a life saver.

3 Likes

Just to let you know, I think there really are some bugs floating around in editor 1 related to refactoring. I’d like to use editor 2 but its graphics editor is broken on my laptop… Today I added a collision object to an object that already existed and that was being used by a factory. I added some code to on_message for collision detection and added the file to the go. I altered each objects group and mask values accordingly. I ran my game and the collision detection didn’t work. Went into physics debug mode to check on things, the hitbox’s were showing up, but collision detection for the two objects in question didn’t work. I copied code from a script that was working that did the exact same thing that I was trying to achieve, in this case to delete the two colliding objects (I only had to change the name of one of the message groups). It didn’t work. I checked the code multiple times for spelling errors and such but couldn’t find any. Finally, I copied the script of the offending game object. Then deleted the game object. Remade it by repeating some of the steps above, used the copy of the script file that I tucked away, and for some reason that I can’t understand collision detection worked this time. Either I’m going crazy or there are some bugs. Has anyone else experienced anything like this?

It’s hard to tell what went wrong there. Did you save all files before building and running the game? Did you check the console for any errors? In editor 1 there’s this super annoying thing that if you edit a property you need to press enter or tab/click outside of the editbox for the value to actually stick. If you build and run while still in the field with the edited value it will not take effect. Maybe that was what happened when you edited the group and mask?

I did set up a few tests trying to print to the console, some of which didn’t return any result. Like I said I used the same code the second time around–and then those same tests did print something (well at least that’s how I remember it happening), but there were no errors that showed up in the console on either attempt. I have noticed the enter-before-saving-thing that you mentioned, I’m not sure, it’s quite possible I missed something tiny like that. There’s just been a few weird things that make me wonder what’s going on e.g. the other day I added an .otf file to a font file and tried to use it to display some text. My game stopped working. Thankfully there was an error message with this one: something about access being denied to the font. I did my usual trick of deleting the new thing and then using the same stuff again. And then it worked. Now granted I’ve very new at this, so maybe I’m missing something when I do this stuff and not missing that stuff the second time around. I might just have to work on my patience and pay closer attention. Anyway thanks for listening to my rant. I’m just slightly struggling at the moment, but I’ll keep chipping away :fist: Cheers