Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Mouse looking problems

Author
Message
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 29th Oct 2005 01:26
Does anyone else know why with a sync rate below 40, mouse looking (as in for an FPS game) is generally smooth, but yet, set it to 0, and as soon as the frame rate goes above 50 the mousemove-() (both x and y) become unresponsive, and movement becomes very jumpy (but not laggy)?

Does anyone else have this problem? (or even know what I'm going on about?) Would the mouse-looking code be needed here?

...maybe one day I'll finish a project
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Oct 2005 14:27
you might try smoothing the code by using:

camang-# = curveangle(camang-#, camera angle-#, 5)

(ofcourse, x and y at the -)

It works fine with me...

Immunity and Annihalation makes Immunihalation...
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 29th Oct 2005 18:51
I'm already using:
yrotate camera curveangle(CameraAngleY#,OldCamAngleY#,2.5)
xrotate camera curveangle(CameraAngleX#,OldCamAngleX#,2.5)

I'm actually thinking the problem is a little earlier in the loop...

if scopeon=0 then CameraAngleY# = wrapvalue(CameraAngleY#+mousemovex())
if scopeon=1 then CameraAngleY# = wrapvalue(CameraAngleY#+mousemovex()*0.1)
if scopeon=0 then CameraAngleX# = wrapvalue(CameraAngleX#+mousemovey())
if scopeon=1 then CameraAngleX# = wrapvalue(CameraAngleX#+mousemovey()*0.1)

due to me being "nooby" and not writing comments, I forget why I even put this code in now...

...maybe one day I'll finish a project
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2005 19:03
try this....

yrotate camera wrapvalue(camera angle y()+mousemovex())

and the same with x..

or to make it smoother



^untested - but that's roughly what I do, crammed into one line


SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 29th Oct 2005 19:14
wrapvalue -> curveangle -> wrapvalue?

Looks very confusing - I'll see what happens when I put that in...

...maybe one day I'll finish a project
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Oct 2005 21:14
a wrapvalue around the curveangle is unnecessary since it wraps an angle automaticly.

Is it possible for us to get to see the whole code?

Immunity and Annihalation makes Immunihalation...
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 29th Oct 2005 21:25 Edited at: 29th Oct 2005 21:27
It's somewhat unstructured - I've tried to tidy it up a bit, but I can't promise it'll be tidy enough...



...maybe one day I'll finish a project
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Oct 2005 21:50
What's the problem?

I ran it on 100 fps, and it works fine.

If you mean that the mouse is shaking, that is perfectly normal. Because it moves and you reset it to the center at the end.
(Try "hide mouse")

Grtz

Sven

Immunity and Annihalation makes Immunihalation...
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 30th Oct 2005 12:32
hide mouse is before the loop even starts, but if positioning the mouse at the end of the loop was causing me problems I'll be too embarrassed to post here again... (so I'll take that out, and pray it doesn't fix it)

position mouse was initially because I have an auto-hiding start menu, when auto hide is enabled, you can sometimes move to where it should be, and it would appear in the middle of the game, so to stop that happening (I'm sure you can figure out my idea...)

...maybe one day I'll finish a project
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 31st Oct 2005 11:06
Actually, I don't see the problem.

I know my english isn't top-quality but what I understood was that you're using a start menu that hides itself until you reach a certain area with the mouse. So you keep positioning you're mouse to prevent this.
I hided the mouse, run it at 100 fps(1024x768x16) and I really don't see anything abnormal. Just a smooth working fps system...

Immunity and Annihalation makes Immunihalation...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 31st Oct 2005 11:33
Sven, your English is superb

Login to post a reply

Server time is: 2025-05-22 13:21:33
Your offset time is: 2025-05-22 13:21:33