Game Development Community

Joystick Event Buffer Overflow?

by Chris Jorgensen · in Torque Game Builder · 05/31/2006 (12:04 am) · 3 replies

Hi all,

I'm working on my first game project. I just added josytick support. It's been working great but every once in a while it gives me "Joystick event buffer overflow!" and then the game runs choppy.

Has anyone encountered this and know of a solution?

Thanks,

Chris

#1
05/31/2006 (2:15 pm)
What version of TGB are you running?
#2
05/31/2006 (10:21 pm)
I have whatever version comes in the Beta2_TorqueGameBuilder_1_1.zip file you download when you purchase the game. I have heard about newer releases from Torque, but I don't know how to get them!

Anyway, problem is with a thrustmaster dual analog controller. Anyone encounter this?
#3
06/02/2006 (10:09 am)
I thought I'd put my progress on the issue here since it sounds like everyone else was just as stumped as me at the problem. I did two major things that significantly reduced the chances of the error, which leads me to believe it might have been a side-effect of something else.

In my game I have two ships, both joystick controlled. I could crash the game if I rapidly tapped the fire button over and over. So to reduce this problem, I time-limited the fire rate to be much slower, and made sure that if the lasers (being fired) hit anything, that they'd disappear (onCollision = KILL). This helped things quite a bit. But my game was still crashing if I just flew around for about 12 minutes.

So I looked at which functions get called a lot. Of course, the "thrust" function was one of the top candidates, since it always self-schedules such that it keeps going as long as the "go" button is being pushed. It was scheduled to repeat every 5 milliseconds. (I beleive schedule(X...) means X is in milliseconds.) I changed that to 500. Sure enough, the effect looks the same, the game still plays fine, and I was able to go up to 20 minutes of play without any crash before I turned it off.

Given this context, has anyone else experience major slow-down thanks to either of these things I fixed?