2 Attachment(s)
MMF Bug? - Bounce problem
I`m not sure if i stumbled across an MMF bug here. But my code is this simple that i don`t have another clue what is going on here.
I have some backdrops to bounce at. With a car. This car has a alphachanneled picture. Which gets rotated. Fine collision is ticked. And most of the times the car collides just with the visible part.
Sometimes when i drive with the car below one of the backdrops, the car bounces with the "air" though. The transparent part.
Here a short flash video to show what i mean:
http://reinerstileset.4players.de/ext/bouncewithair.swf
As you can see, there is a big gap between the car and the backdrop. It is overlapping the transparent part of the car though. So my guess is that there is something wrong with the fine collision and rotated images. And that i stumbled across a MMF Bug here.
I would be happy to hear that this is my fault though. And even happier with a workaround :)
Attached the file in question
Re: MMF Bug? - Bounce problem
Additional info. The point where the bounce bug happens is the point where the angle snaps from 360 to 0 and vice versa. So to provoke the bug drive close above a backdrop into right direction, and move the mouse a bit up and down.
Re: MMF Bug? - Bounce problem
Tiles, have you thought about whether or not the car bouncing off walls is truly crucial to your game? I don't personally know anything about your game and what your ultimate goal is, but unless the car bouncing is an important feature of the game, I would recommend changing it simply to stopping. This way you could avoid all the various tests you've been doing, and also use objects of any shape.
Just a suggestion.
Re: MMF Bug? - Bounce problem
Thanks for your input Jaffob. But honestly, would you really advice somebody who wants to make a jump n run just to run in one direction because two directions makes too much hassle? ;)
Well, i want to make a little topdown racing game for Flash. And i want it to make it as good as possible. And this means that i search for the best ways for what i want to achieve. Testing around for the best way is part of every development. That MMF or any other language provides lots of ways to fail is the everlasting tragic, but that`s the way it is. You have to search for the working solution in such a case.
I think of course about what i need for my game to work. Crashing into walls does not really work with total stop. A crashing car bounces back. And when you hit a wall from the side then it`s somehow input angle equal output angle. It does not really work with unrealistic bounce like the Bouncing Ball Movement that bounces in every direction but the one it should, and gets stuck in walls every now and then (I have even a somehow working example in my testcorner that does exactly that, and it simply doesn`t fit my needs). Best would be physics. Then i could probably also start to rotate the car in the bounce case. But Flash does not provide physics from what i know. So i want at least the same angle for bouncing in and out at walls. This is already the trade-off. First working method i had was too resource hungry. So i needed to dig further. That easy :)
Back to topic, i found a workaround for this bug here. The bug happens with the rotated image at being 0 and switching to 360 or vice versa. Since direction 0 and 360 is the not rotated image, i tested if i can limit the rotation of the image just from 1 to 359, and leave the initial direction unrotated. I don`t loose anything that way, and it works. The bug to collide with the air does not happen anymore.
The Bug must be something with the colision mask of the Image rotated from 360 to 0 or from 0 to 360 going offset or wrong rotated. And it could be something with the Movement Controller involved. Because i was not able to reproduce it in a fresh app. But the bug stays with copying the code over to new objects. This is as close as i could get.
Not that i have high hopes that this bug will be fixed. My example may still be too complex to really be useful for debug. A fix would probably come too late for my game anyways. But i have it at least documented as good as i was able to :)