Game not work properly in release mode (SOLVED)

Hi, When I package my game Bundle > Windows application (not tick into the Release mode) the mouse click to game object work fine. But if in Release mode, some of click does not.
How can I debug if I’m in the Release mode.
I use the module “goput.lua”

Update: I found out that the game object was create by factory had a strange ID. That’s why click not work but I don’t have a solution yet.

local d = factory.create("#factory", .....)
goput.add(msg.url(nil, d, "sprite"), nil, on_click)


d ----------------> return not an id like hash[#instance0] but like hash[324f02f2012ab...(unknown)]
so:       msg.url(nil, id, "sprite") ---------------> return main:/(null)#(null)

Please help. Thanks

Guessing you are not hashing something properly / address issue

1 Like

I don’t know but from now how do I put these hash into msg.url function

The thing that differs in release mode is that we throw away all the reverse-hash info to save memory. If you ever do things like local s = str(my_hash), that won’t work in release mode. We would have no means to know which string my_hash originated from. The above code you posted works fine as it’s in the end creating hashes, not strings. I have no idea what goput.lua is or what it does, but you can check that it never tries to get the string-values from hashes. Otherwise it might be the case that you do this in a different part of your code.

4 Likes

Hi. If you are using the goput.lua script from my quick’n’dirty “click on game object” example then there was a bug in that code. I took the full url and did a tostring() of it as key to the sprites table. This will obviously not work for the reason Ragnar mentioned. A url consists of three parts: socket, path and fragment where both path and fragment are hashes. I have updated the module and taken this into account.

4 Likes

Thanks so much for your support britzl.:smiley:

2 Likes

O h, I understand now. I’m really like Defold engine. Thank you for a great software. Thanks Ragnar Svensson

4 Likes

when i get collision onmessage other id is like /collection47/banner in debug mode. but in release mode other id is like table: 0x01f701541fe0.

can you please help me

When you build your game in release mode we no longer do hash to string lookups when we print hashes. Your should not rely on the string representation of a hash and instead only compare hash values.

Are you having some problem with this that we can help you with?