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.

Newcomers DBPro Corner / Very fast (1000+) movement causes camera to become unstable

Author
Message
Straxus
14
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 11th Mar 2011 10:24
Working on the warp drive for my space game. Normal movement all seems fine, though when I try anything in the thousands for the movement(warp)speed the camera veiw starts to become unstable. Even if I stop the object the camera movement continues to be very jumpy.
Seems to start roughly arround 1000 movement.
As the game will involve ship moving over AU (Astronomical Units) in a single solar system (and not between solar systems) I would really like to keep the full veiw while in and out of warp instead of a silly loading screen when warping between positions.
Controls are listed at beginning of code in REM statements, though most important to see what I am talking about is 1 for warp acceleration and mouse movement for camera veiw.
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 11th Mar 2011 22:33
Have you tried to use 3 move 500 commands before the sync instead of one 1500

Srry about my english im from sweeden
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th Mar 2011 22:46
I call that effect "the jitters" and it happens when objects move to far away from 0,0,0 in any direction.

Unfortunately you can't just take off in a given direction and move 5,000,000 units. You lose all precision in positioning.

One solution that has been used is allow the player to move a certain distance, and when they reach that, move them back to 0,0,0, but also move everything else the same amount giving them the illusion that they are still moving.

Another solution is to keep the player at 0,0,0 and move everything else around them.

Straxus
14
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 12th Mar 2011 00:14
Thanks for the info guys! I will try each of the methods.

Quote: "Another solution is to keep the player at 0,0,0 and move everything else around them."

If I were making a multiplayer game is there a way to still attempt this solution?
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 12th Mar 2011 09:53
Quote: "If I were making a multiplayer game is there a way to still attempt this solution? "


probably not

Srry about my english im from sweeden
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Mar 2011 14:45
Definitely yes.

For example, your 'world' can be made up of sectors held in integer values, and your objects have an assigned sector and a coordinate within that sector.

When displaying locally, you adjust the sector coordinates of every object so that your position is at sector 0/0/0, and then use the adjusted sector coordinate + the local coordinate to create a new coordinate for all objects within view.

It's a fair amount of work, but it will limit this 'instability' you mention.

Straxus
14
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 13th Mar 2011 02:07 Edited at: 14th Mar 2011 12:51
OK, this gives me hope again for my project!
I did some searching after reading your reply and so far not finding anything that helps me get started in the direction you mentioned. I understand what you are saying completely, just clueless as how to begin to approach it in DBP.
Tried a few ideas that had no success.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 14th Mar 2011 05:18
Start small with just some cubes to move around. Work out the intereactions between server and client that way. It will be faster and easier to visualize what's going on without having to worry about actual models yet.

IanM is right. Decide how big your virtual world will be, and divide it into sectors big enough to hold what you want in them, but not so big that you run into the jitter problem.

Maybe draw it out on paper to visualize it. It will come to you.

Straxus
14
Years of Service
User Offline
Joined: 6th Oct 2009
Location: Beaverton, Oregon
Posted: 18th Mar 2011 09:03
Thanks guys!
You pointed me in the right direction and I figured out how to reposition the world arround player object. Got smooth camera anywhere in the game universe now. The nightmare was getting anything that moved on it's own (npc objects, celestial objects orbiting each other) to stay in right area. Though eventually got it.
Will post my results after I get arround to making my code look more presentable.

Login to post a reply

Server time is: 2024-09-29 02:29:14
Your offset time is: 2024-09-29 02:29:14