hard to activate a walkable switch

Started by Realguigui, January 28, 2017, 06:34:05 PM

Previous topic - Next topic
Hello.

I think the activation of walkable switch needs too much accurency. Also, the activation zone seems to be offset toward down.
Is there a simple solution to resolve this ?

Switch NOT ACTIVATED


Switch ACTIVATED

I think some of your sprites, probably the switch (or the hero otherwise) may have the wrong origin coordinates.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

I use the two sprites of Solarus DX.
The switch sprite origin point : 0,0.
the hero (tunic2) origin point : 12,21.

Try to set the origin point of the switch sprite to 8,13.

I 'm adding a switch on a map of solarus dx and the result is the same.


Quote from: Christopho on January 28, 2017, 09:28:01 PM
Try to set the origin point of the switch sprite to 8,13.
it's worst, the bounding box is completly offset:

January 28, 2017, 11:33:06 PM #5 Last Edit: January 28, 2017, 11:35:40 PM by Diarandor
It seems that the correct origin for zsdx is (0, 0), so that was not the problem, I think. I don't know yet what the problem is. Are you using both the last version of the game zsdx and the last version of the engine?

Another remark: after you modify the origin of the sprite, the refreshing button of the open map will not show the changes; you can either close/reopen the map, or double click in the switch entity and click "ok", that will show the updated origin for the switch sprite. Make sure you refresh the map to see how the changes are for that origin point.

Another question: is the size of your switch sprite 16x16?
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."


Quote from: Diarandor on January 28, 2017, 11:33:06 PM
It seems that the correct origin for zsdx is (0, 0), so that was not the problem, I think. I don't know yet what the problem is. Are you using both the last version of the game zsdx and the last version of the engine?

Another remark: after you modify the origin of the sprite, the refreshing button of the open map will not show the changes; you can either close/reopen the map, or double click in the switch entity and click "ok", that will show the updated origin for the switch sprite. Make sure you refresh the map to see how the changes are for that origin point.

Another question: is the size of your switch sprite 16x16?

I answer yes to all your questions.

I think there is no bug, but I realized that there was a "problem" when I made a room with a switch that launches a moving platform and the hero has to hurry To join it. To succeed, it is best to activate the switch from the side and this is difficult, much more than from the top.
I really invite you to test by yourself.

Quote from: Realguigui on January 29, 2017, 12:15:04 AM
I answer yes to all your questions.

I think there is no bug, but I realized that there was a "problem" when I made a room with a switch that launches a moving platform and the hero has to hurry To join it. To succeed, it is best to activate the switch from the side and this is difficult, much more than from the top.
I really invite you to test by yourself.

Yes, I believe you are completely right. I had a similar problem (or even worse) because with the sprite I made for Eldran (a custom hero), the pixels of the feet are in a lower position than for Link's sprite, which makes this much more noticeable. Actually I modified his origin to (12, 23) to decrease this effect. With my custom switches (custom entities) I decreased this effect even more, maybe because I use a different sprite.

I could be wrong but, in my opinion, the problem is not with the engine, since it checks the distances between the center of both bounding boxes, and that is done correctly. The problem is actually the switch image, which is drawn with a bad "angle of perspective" (at least, for the way the engine handles the bounding boxes); when the hero and the switch bounding boxes are centered/aligned one above the other the hero "does not seem" to the player to be centered over it. An "easy" solution would be to redraw the switch sprite, to make its angle perspective better when both bounding boxes are aligned, i.e., draw the small circular part of the switch lower (and smaller if necessary).
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

I drew some switches which are a bit different to the one in ALTTP, and these look nice when the hero activates them (the hero does not seem "shifted" when he activates them). I will share them in some time, but not yet since I am still testing and making changes.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."