Re: Glitchy interaction with "falling" platforms
OK, I just experianced a very wierd bug. I got rid of some of the faklling platforms in the first area, then got rid of all the platforms in the second area, went back to the first and got rid of them all and they all wokred fine, then as I started walking on the second area's falling platforms they suddenly came back right then and there, and then the screen went black and I could see the falling platforms in mid-falling, then they disappeared, and the game slowed down my entire computer and to 2 munites to go away after I ended it's process... :eek:
EDIT: OK the framerate goes way down after going back and forth between frames, and I was walking to the left on the first area, then suddenly I was in the second area!
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by LB
OK, I just experianced a very wierd bug. I got rid of some of the faklling platforms in the first area, then got rid of all the platforms in the second area, went back to the first and got rid of them all and they all wokred fine, then as I started walking on the second area's falling platforms they suddenly came back right then and there, and then the screen went black and I could see the falling platforms in mid-falling, then they disappeared, and the game slowed down my entire computer and to 2 munites to go away after I ended it's process... :eek:
That's really odd. Hmmm... I dunno. I'd like to start designing levels soon so maybe I can start off without the falling platforms.
My moving platforms are all quite sensitive in their nature, that is, the way their sensors interact and stuff.
Generally, the platforms work fine when they are separated. It's when they are connect to form a "bridge" that they start to get really glitchy with the player.
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by DantronLesotho
I am at work so I can't download the file, but when the platforms leave the bottom of the screen, what happens to them? Are they destroyed? Or do they just move past the boundary?
Do the sensors also get replaced in the same manner?
Well here is what I think is happening. The sensors are attached to the platforms by detecting an overlap. When the sensor is overlapping the platform, it "snaps" itself to the proper place. As the platform falls away, the sensor is still overlapping so it constantly snaps itself to the platform as it falls.
The platforms have an origY variable that stores their original Y position, and no matter how far it falls off the screen, when you leave the area, there is an event that tells those platforms to instantly return to their original coordinates. I think what is happening is that this is causing the sensors to become "detached" from the platforms due to the fact that the platform is being repositioned and there is no longer an overlap, and therefore nothing for the sensor to snap to.
Another option would be to add an origY variable to the sensors as well. However, the problem with this is that the sensors are used for other kinda of moving platforms as well, and adding such a code would mess those up.
Anyway, I've been working on this for a long time today, so I'm going to take a break... and maybe a nap.
Thanks for all of your help so far, guys!
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by LB
EDIT: OK the framerate goes way down after going back and forth between frames, and I was walking to the left on the first area, then suddenly I was in the second area!
That is because there is a problem with the way the sensors are supposed to re-attach themselves to the platforms. They're not just being added to the platforms that had previously fallen. They're adding themselves to ALL of them, and throwing that many active objects into the game like that bogs everything down.
Re: Glitchy interaction with "falling" platforms
Why not just use a detector on the play that interacts specifically with the falling platforms? What was the reason you couldn't do this again?
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by LB
Why not just use a detector on the play that interacts specifically with the falling platforms? What was the reason you couldn't do this again?
I already do have a sensor on the player for that.
Re: Glitchy interaction with "falling" platforms
Then why do you need any sensors at all on the falling platforms??
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by LB
Then why do you need any sensors at all on the falling platforms??
Because the platform graphic is not the right size to properly interact with the player. The sensor is thinner, and if I were to omit the sensor and have the player interact directly with the platform itself, I would be restricted to creating platforms of a very specific size, and I don't want that.
Re: Glitchy interaction with "falling" platforms
You could change the size of the sensor? Add another sensor to the player and make them on either side? Find a work around that doesn't use so many sensors. The less objects the better.
Re: Glitchy interaction with "falling" platforms
Quote:
Originally Posted by LB
You could change the size of the sensor? Add another sensor to the player and make them on either side?
I don't get what you're trying to suggest... I don't have any problem with the sensors... or the number of sensors I use, for that matter.
I might just give the falling platforms their own sensors, in fact, instead of using the same sensors I use for the other types of platforms. I don't know yet.