• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Mac OSX Collision bug

D1Project

Member
Hello,

Since the latest patch for Mac, I'm having collision issues.
In one case, the ship I control was colliding with enemies about 200 pixels away to the left.
In another, bullets were destroyed before it got to the enemy. Maybe it was colliding with a collision mask that was out of position.

I don't think this is linked to my code because this doesn't happen every time.
When I run the project sometimes collisions are as expected, but sometimes they bug.

Thanks
 
M

MarceloP

Guest
Create a test project and let us know. If the bug is really something in the direction that you're pointing here, please tell us your Runtime version.

Usually a complex project has too many variables and things that may be causing this behaviour. Please, try to confirm it the simplest scenario possible, so that we can think in possible solutions or ask you to file a bug report.
 

D1Project

Member
Hello @MarceloP,

Thanks for the reply.
I tried to reproduce the bug on a simple project but couldn't...
But it's true that I'm going through parent objects, replace sprite on the fly, with variables, etc.

In debug mode, I can see that the bug happens on the collision event between the player object and the enemy object.
At that moment, the two object positions are clearly not touching and neither are their bbox.

Screen Shot 2018-06-13 at 22.53.48.png

Screen Shot 2018-06-13 at 22.51.51.png

Screen Shot 2018-06-13 at 22.53.09.png

Screen Shot 2018-06-13 at 22.53.27.png
 
Last edited:

D1Project

Member
I reproduced the bug with a simple project.
It has to do with game_restart().

If the Player is Persistent and you use game_restart(), the game restarts and place the Player at its start position.
This is what is expected.
But objects still collide at the position the Player was before the restart even if the Player is elsewhere.
In this case, the same Player object can trigger collisions at 2 different positions at the same time.

If you restart twice both previous positions will still trigger collisions.
If you restart three times, the three previous positions will still trigger collisions.
Etc.
 
M

MarceloP

Guest
Well, that is pretty unexpected. I'm not familiar with game_restar(), but with a quick lookup I've concluded that this may be something you should file a bug report...
A suggestion for the bug reporting example that you may build to submit the ticket is to also put on the object's draw something like: "draw_rectagle(bbox_left, bbox_top, bbox_right, bbox_bottom, true);" so that you can check after the calling of game_restart() if the collision mask was moved as well, or if only the object was and, for some reason the mask didn't.

One suggestion/workaround would be to use room_goto(room) if your very first room is the one you're at, and forcefully moving the object to the starting point. Or, after game_restart(), checking the bbox's of the object and try something like changing it's sprite forth and back with an empty sprite to see if the mask corrects itself (maybe even the object by one pixel to see if it is fixed). All of that you'd do on the "Room Start event", so that it would happen before all your collisions code.

Not sure if any of this will help you, but I do think you should report it, as it seems an unexpected/buggy behaviour...
Well played xD
 
Last edited by a moderator:

D1Project

Member
Hello @MarceloP,

Thank you.
I've tried everything you wrote, but still the same.
Now maybe I didn't implement them properly.
When doing draw_rectangle(), the rectangle is at the correct position, but there are still collisions on the Player's previous positions before the game_restart().
There is only one rectangle even if there are 2 or more collision positions for the Player.

The issue has been reported.

Have a nice day
 
Top