Hi everybody.

English:

Iam currently working on my player movement code for my project and i want to code most of it by myself.
Its a "Horror-Adventure" in first person view.
The player should move and strafe with the arrow keys and look around with the mouse. At the moment, overall its working quite good, but looking around with the mouse isnt working correctly yet. If I move the mouse slowly, everything works fine and smooth. But if I move the mouse fast, the player turns slowly and not smooth. For example: I move the mouse slowy for 1-2 inches, the player turns about 180deg. I move the mouse fast for 3-4 inches, the player turns just about 40deg (Problem with the sampling rate?). Toggle the mouse acceleration on/off in windows, doesnt have effect. In commercial games, everything is working fine for me with this mouse, so this shouldnt be a hardware problem. How can I solve this problem? Is there an alternative for the mouse_force commands? I already tried the mouse_sync command, but it doesnt worked.

My code (cutted):

my.pan -= p_sens * mouse_force.x * time_step; // Mouse movement changing the players pan
camera.pan = player.pan;
camera.tilt += p_sens * mouse_force.y * time_step; // Mouse movement changing the players tilt
if(camera.tilt > 70 )
camera.tilt = 70;
if(camera.tilt < -70 )
camera.tilt = -70;

"p_sens" is a variable with pre-defined value 8

I appreciate for any help.

German:

Ich arbeite gerade an der Steuerung für mein Projekt und möchte dabei möglichst vieles selbst schreiben. Es handelt sich um eine "Horror-Adventure" aus der First-Person Sicht. Der Spieler soll mit den Pfeiltasten laufen/strafen können und sich mit der Maus umschauen. Es funktioniert soweit auch ganz gut, nur das Umschauen klappt nicht 100% wie ich mir das wünsche: Wenn ich die Maus langsam bewege, läuft das Umschauen schön flüssig und in guter Geschwindigkeit ab. Bei schnellen Bewegungen geht das Umschauen nur ganz langsam und ruckelig.
Bewege ich die Maus langsam um die 2-3cm, dreht der Spieler sich um gute 180°, wenn ich die Bewegung schneller und weiter führe, gerade mal um ca 30° (Problem mit der Abtastrate?). Mausbeschleunigung AN/AUS in Windows macht auch keinen Unterschied. In anderen, kommerziellen Spielen, habe ich damit keine Probleme, es liegt also nicht an meiner Maus selbst.
Wie kann man das besser lösen? Gibt es eine Alternative zu den mouse_force Befehlen? Den mouse_sync Befehl habe ich bereits ausprobiert, hat allerdings nichts gebracht.

Meine Variante lautet (Ausschnitt):

my.pan -= p_sens * mouse_force.x * time_step; // Mausbewegung verändert PAN des Players (my)
camera.pan = player.pan;
camera.tilt += p_sens * mouse_force.y * time_step; // Mausbewegung verändert TILT
if(camera.tilt > 70 )
camera.tilt = 70;
if(camera.tilt < -70 )
camera.tilt = -70;

"p_sens" habe ich als Variable mit dem Wert 8 festgelegt.

Wäre dankbar für jegliche Hilfe!

Last edited by KingdaKa; 03/22/10 17:14.