Would any like to test my game?

Started by
4 comments, last by BlackScar 24 years ago
Hi! I just added mouse support to my 3D Engine and it is a bit flaky. It doesn''t have the feel as quake or UT does. Heres the code I use for my mouse look, it''s very basic : g_lpMDIDevice->GetDeviceState( sizeof(DIMOUSESTATE), &dims ); if (dims.lY > 0) user.xrot -= 0.8f; if (dims.lY < 0) user.xrot += 0.8f; if (dims.lX > 0) user.yrot -= 2.0f; if (dims.lX < 0) user.yrot += 2.0f; And then I use user.yrot and user.xrot for the world rotation. But it just doesn''t have the good feel as those other games have. Can anyone give me some pointers on how to make it feel alot better? Here''s the executable for you to try out : http://members.xoom.com/Blackscar/mygame.zip Thanks alot to try it out! Justin Eslinger
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
Advertisement
Without downloading your source code I can already tell you how to get the "Quake Feal". If you notice, Quake with arrow movement, Quake does not immediately stop. It slows down. You can achieve this by using a friction variable. You get the direction variable and subtract the dir by the friction every frame. With the mouse you should do mouse filtering. By looking at your code and since I did download your game, I noticed that the mouse movement was not variable. You need to do the following:

//Did you switch your x and y?
user.xrot = user.xrot + dims.lY;
user.yrot = user.yrot + dims.lX;

It is very annoying to move the mouse and it does not turn according to the speed that the user moved the mouse. Also, when doing any code that involves timing, ALWAYS MULTIPLY BY A SCENE TIMING VARIABLE!

// Example2
user.xrot = user.xrot + (dims.lY * SceneTimer);
user.yrot = user.yrot + (dims.lX * SceneTimer);

To get the SceneTimer variable just do this

-Pseudo Code-
Do
Scenetimer = TimerFunction - LastTime
LastTime = TimerFunction

...Render
Loop

Since I do not know C/C++, my code is not optimized to its max potential. I hope this helped.
Ahhh! I see!
Thanks alot! I will try this out!

Justin Eslinger
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
No, that doesn''t work

Does anyone know how quake does it?

Or does anyone know how to set the mouse cursor in VC++?
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
There is a friction type thing in Quake and UT, but VERY little. It slides a very little after you stop moving the mouse, in Your demo, you need it much FASTER, and use a make a little bit of a slide, Ive avoided this for now by just using Keyboard. Also, I dont use OpenGL(Sorry), but the mouse routine you use, do you get a high resouloution from it, That could be the problem?, (also, try make it start out slow, and then speed it up with acceleration, Q3 does that), later,
Oh, woops, do what nes8bit said, didnt read that, also, nes8bit, your C/C++ code is optimized to its max potenceil,(your just adding/multiplying variables)

This topic is closed to new replies.

Advertisement