Strange AS3 Input Queue Thing?

6 posts

Flag Post

Ok, I’ve been getting what I thought were just performance issues with my project regarding input delays and such. I’ve got a pretty graphics heavy game, but I can generally run at about 30fps without much of a hitch.

The problem is that, when walking around the world, flash will start to get really unresponsive and seems to queue input events for almost a second. It creates some really weird problems such as processing a keyDown event on time, but not getting to a keyUp event for a second or longer, making the character just keep ambling along while the player has his hands off the keyboard.

I thought this was just some performance issue that I would get to later, but I found today that my mac-equipped compatriots don’t get the same issues, and the game remains pretty responsive throughout. I’m the only one with a PC, so it’s hard to tell what’s going on.

If anyone has run into similar problems or has any tips, I would really appreciate it.

 
Flag Post

As an addendum, I have found that playing though a web browser seems to resolve the problem… So I actually seem to have worse performance in the standalone CS3 player :(

 
Flag Post

There’s a secret about the CS3 player: it sucks.

Since your game works well in the browser it’s probably a SC3 player problem, but just to make sure, try to run it in the standalone player. If it still jammes, most likely it’s a code problem. Otherwise, you’re ok.

 
Flag Post

In my gme I have a similar problem with how I coded how the player dies when x situation is met, for some reason if he dies on the ground he’ll just keep walking right or left until you make him jump or change directions and then when he hits the ground after jumping, that’s when he actually dies.

So yeah, sounds like a code problem to me, just registering Key.isDown’s shouldn’t do it, but are you sure your game isn’t going through a lot of extemporaneous steps when little is happening on screen? If you’re making monsters move or other sprites are processing information while off screen I imagine that would chunk the crap out of any player.

 
Flag Post

Well, the weird thing is that it isn’t directly related to the processing going on in flash. I can just hit the left and right keys really fast, which would make the character just look like he’s spinning around, and instead of an instant response it will slowly respond to each button down event over a period of about 10 seconds turning one way and walking for a bit before turning the other way, etc. While it is very slowly responding to the events, the framerate stays above 30 and all the other non-player characters continue to animate and run around as usual.

It does not seem to be a problem when I run the game in firefox, so I’m not going to worry about it. It’s just puzzling.

 
Flag Post

May i just say with the firefox thing – I gotta say test it on IE as well cos I have tried many games that work perfectly on one but not the other…