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 / sync problem? (I Dont know what causes it)

Author
Message
Dia
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 14th May 2006 15:21
Gday all,

First of all just a quick msg to say thanks for the help on these boards! Now to the problem....

I have put together a kind of reverse mouselook, where the player object is always center screen, and you can move the camera around it to look around (kinda WoW-ish view) I have the code below (hopefully, never tried to post code snippets before) and the whole idea is that mouselook is only active while the LMB is pressed.

The issue I have is that when the mouse button ISN'T pressed, the player model on screen moves in a very jerky manner, while as long as the mousebutton is pressed, the model moves silky smooth. Just wondering if anyone knows how to avoid/get around this problem?
Bahamut
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Brighton
Posted: 14th May 2006 17:13
Hmm, the source code didn't work-use code snippets. Having never posted code before, I'm not sure how this is done though, sorry.

Seeing as I can't see your code, I'm not sure what the problem is. I don't know how much help this will be, but use "print screen fps()" without the quotes to check that it's not a framerate issue.

Someone else will probably come up with the answer before I do, though because I've only just started posting here and still need mods to approve my posts. Not complaining though-I'm all for the system.

IceBound -No, really-We're quite good.
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 14th May 2006 19:32
i cannot see the code, maybe your positioning the camera / character within the Mouse code, instead of in the main loop. At any rate try putting your code inside snip... as bahamut said


[code ]Like this[/code ] <-- without the spaces

Dia
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 16th May 2006 11:39
okeydokey then, take 2....



note that the lifterx/y/z# variables are the player model location. In addition, I have not specified a sync rate, I am just using default (does it really matter?)

On further inspection, I have noticed the same sort of effect in most of the DB example code as well (where the models move in a jerky manner)

Is this because with a mouselook the display is constantly being updated? or is there something else I am missing?

cheers
Dia
20
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 16th May 2006 13:00
Further testing (well, I say testing, but it's really just cutting out bits and pieces to see what affects my unwanted flicker) has revealed that when I remove the 'if mouseclick()=1' condition to activate camera movement, and have mouselook active all the time, then the flicker goes away.

Does anyone know of another way to only have camera control when the LMB is pressed?

(btw I am assuming that the code snippet will be posted above this one, I cant see at the moment, still just a noob member, not trusted yet)

Login to post a reply

Server time is: 2025-05-25 01:44:19
Your offset time is: 2025-05-25 01:44:19