Inside3D!
     

Can't stop spinning
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Wed Feb 03, 2010 5:29 pm    Post subject: Can't stop spinning Reply with quote

I'm having a problem with movement in my engine. It seems that when I'm moving around and shoot, I will sometimes get stuck going in the direction that I was moving when I fired. The only way I can stop it is to hold down on the key that makes me move the opposite direction and then press the key that is the direction I'm currently moving.

Could someone point me to what source files I would need to work with to fix this? I'm using the original WinQuake source on linux with the software renderer. I haven't done much to it except remove windows specific code and the OpenGL renderer.

Here's a link to a demo somewhat better explains what I'm having trouble with. http://omploader.org/vM2Z0cQ/spin.dem
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Wed Feb 03, 2010 6:13 pm    Post subject: Reply with quote

Are you playing in windowed mode?
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Wed Feb 03, 2010 6:13 pm    Post subject: Reply with quote

iv actually had similar issues with something i messed up in .qc before. if your doing any .qc modifications to test your engine with. be sure to check that too.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Wed Feb 03, 2010 6:16 pm    Post subject: Reply with quote

I fixed that a while ago, but my code is different of course. What's happening is that you're using the mouse for movement (guess), and mouse_oldbuttonstate (or equivalent) is not getting cleared properly. Not certain where in the Linux code this is though.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Wed Feb 03, 2010 6:27 pm    Post subject: Reply with quote

r00k wrote:
Are you playing in windowed mode?

I should have mentioned that. I'm using
Code:
./quake.x11 -mem 64 -window -width 800 -height 600
to play. It happens at other resolutions also.
ceriux wrote:
iv actually had similar issues with something i messed up in .qc before. if your doing any .qc modifications to test your engine with. be sure to check that too.
I'm not doing anything with QuakeC.
mh wrote:
I fixed that a while ago, but my code is different of course. What's happening is that you're using the mouse for movement (guess), and mouse_oldbuttonstate (or equivalent) is not getting cleared properly. Not certain where in the Linux code this is though.
I'm not using the mouse either, as the old code doesn't seem work with new versions of X.org. I using just the keyboard.
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 2:57 am    Post subject: Reply with quote

Add -nomouse to the command line, see if problem persists ...
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Thu Feb 04, 2010 3:08 am    Post subject: Reply with quote

The problem persists.
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 3:19 am    Post subject: Reply with quote

Look at cl_input.c and in_(whatever ... it's not in_win.c on Linux and I don't think it's called in_linux.c either).

You'd think the +turnleft or +turnright keys are somehow being triggered. One solution for sure is to edit config.cfg and change any bind to something else.

Notice I said "change" ... remember that default.cfg in pak0.pak is executed first and it does have a default key. For the +turnleft and +turnright keys to be neutralized "for sure" you'd need to make sure they are bound to something else in autoexec.cfg or config.cfg.

If +turnleft or +turnright isn't referenced by any key I don't see how the problem can persist.

If the problem does persist, have it Con_Printf some stuff to the console to see when and where it is getting triggered.

Good luck and have fun! Shouldn't be too hard to solve, really.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Thu Feb 04, 2010 3:27 am    Post subject: Reply with quote

Oh yeah ...

Type -turnleft in the console
Type -turnright in the console
Type +turnleft in the console
Type +turnright in the console

One of those will solve your problem the "wrong" way, but it will solve your problem.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
goldenboy



Joined: 05 Sep 2008
Posts: 310
Location: Kiel

PostPosted: Thu Feb 04, 2010 9:00 pm    Post subject: Reply with quote

The keep-moving thing happens to me too sometimes, in Fitz and also DP.

Another thing is that in some engines, you spin uncontrollably.

Still another is that sometimes, the mouse gets locked between "invisible barriers" so you can only look into a certain direction. DOOM engines love to do this. Q4 does this, too.

I think all these only happened to me when using SDL though. SDL is *incredibly* buggy, on Linux at least (which is why I always prefer a clean GLX renderer - alas, SDL is the cheap method to do crossplatform these days). Some Q2 engines are unusable due to this.

Never encountered this stuff in software though.

Linux here, too.
_________________
ReMakeQuake
The Realm of Blog Magic
Back to top
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Thu Feb 04, 2010 9:07 pm    Post subject: Reply with quote

goldenboy wrote:

Still another is that sometimes, the mouse gets locked between "invisible barriers" so you can only look into a certain direction. DOOM engines love to do this. Q4 does this, too.
.


Lets play the random card:

Have your checked your FPU to be correct? that looks like float/vector problems, and quake don't use quaternions111111!!ONE ONE.

</random>.
Back to top
View user's profile Send private message
goldenboy



Joined: 05 Sep 2008
Posts: 310
Location: Kiel

PostPosted: Thu Feb 04, 2010 11:19 pm    Post subject: Reply with quote

Well, it happens on two very different machines. Usually either pausing and continuing, or restarting the engine a couple times will fix the "angle lock" thing. The "continual spinning" problem is not repairable in any way that I know of - you have to switch engine. The "keep running forward" problem is mostly fixed by messing around with running in different directions, shooting and jumping for a while... of course, that sucks and I then usually restart the level.

There is no computer, no OS and no game engine that doesn't suck.
_________________
ReMakeQuake
The Realm of Blog Magic
Back to top
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Fri Feb 05, 2010 1:48 pm    Post subject: Reply with quote

goldenboy wrote:
Well, it happens on two very different machines. Usually either pausing and continuing, or restarting the engine a couple times will fix the "angle lock" thing. The "continual spinning" problem is not repairable in any way that I know of - you have to switch engine. The "keep running forward" problem is mostly fixed by messing around with running in different directions, shooting and jumping for a while... of course, that sucks and I then usually restart the level.

There is no computer, no OS and no game engine that doesn't suck.


Try a different type of mouse. Maybe is your favorite model mouse driver, or things.

</random again>
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Feb 05, 2010 2:29 pm    Post subject: Reply with quote

I get this a lot with my keyboard. It just doesn't send the key release event, and I have to re-press it to stop moving. Moving in the other direction just temporarily stops motion, as then both directions are pressed.
At the end of the day, keyboards cannot always detect which keys are actually being pressed at any one time, the same goes for when they are released too. Pretty much all keyboards suffer from this problem in some area of the keyboard, but most are specially designed now to avoid the issue near commonly pressed keys.
For programmers: The effect could probably be reduced by forcibly releasing the opposing key, but not fixed.
For users: start using cursor keys and the wasd keys instead. For a quake specific solution, bind a key to "-forward;-back;-left;-right;-turnleft;-turnright;-attack;-jump;-klook" basically -everything you may have pressed.
Also, make sure you have no binds set for upper case letters (read the binds in your config file).

Also, I mention this as its almost related: A couple of engines+games result in lots of really fast insane spinning when running windowed with a corner of the window off the top of the screen. DP is one example. :P
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
dreadlorde



Joined: 24 Nov 2009
Posts: 86

PostPosted: Fri Feb 05, 2010 7:27 pm    Post subject: Reply with quote

Ok, I'm going to try all of these suggestions this weekend hopefully. I'll report back then.
_________________
Ken Thompson wrote:
One of my most productive days was throwing away 1000 lines of code.

Get off my lawn!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group