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 / mouse position to point in 3d and how do i extract info from a string??

Author
Message
zootan
14
Years of Service
User Offline
Joined: 12th Apr 2010
Location:
Posted: 12th Aug 2011 07:08
1/ i want to point my spaceship where the cursor "points", so i need to convert the 2d cursor position into a realative 3d point in space , ive looked at the pick and screen commands but im confused, can anyone help? My game is using another method to rotate and turn the ship for now but only because this way has me stuck.
2/ my online 2 player game uses integer packets and float packets to communicate but i want it to send all info in 1 string which would be a list of variables and their values ,say i use a string likethis for all position data "pox#0,poy#0,poz#0,rotx#90,roty#90,rotz#90"
how do i compile the string and decompile it when recieved?
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Aug 2011 17:35
Question 1 is not quite my department, someone else will have to answer that one You will have to give us more info though, like how are you controlling the camera? Is it a top down thing where you are looking at the objects from the top? Does the camera ever move? How are you controlling the objects? Do you have a landscape they move on? Are they in empty space? etc.

Question 2... I see you're trying to compress it all into just one packet, but doing that with a string is extremely inefficient. You're actually expanding the amount of data...

If you are using DBC : Write all of your data to a memblock. Something like this:



If you are using DBP : You can do the same as in the DBC example, or you can install Multisync (run a forum search). That already has the whole "put everything in one packet" thing integrated:



Hope that clears up some stuff for you

TheComet

zootan
14
Years of Service
User Offline
Joined: 12th Apr 2010
Location:
Posted: 13th Aug 2011 07:20 Edited at: 13th Aug 2011 07:25
i have a zooming / orbiting camera ,fixed to an offset limb of the player model, mousewheel offsets the limb(also as you zoom "into" the ship it locks into a cockpit view )otherwise camera always points at player model, mousemove orbits the camera. its in space,no terrain to worry about . ... ill make a lill demo...

there a room to play in this is just the ship controls , not the net game!
the main reason i wish to send all info in one message is because of dropped packages messing the results of the net int and net floats,which results in a jittery player 2

Login to post a reply

Server time is: 2024-11-22 19:11:50
Your offset time is: 2024-11-22 19:11:50