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 Professional Discussion / getting specified data... thingy..

Author
Message
Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 26th May 2003 15:32
hi all!

well I*m sure this question has been asked befor
but I'm trying to make my first multiplayer game in
DBP.. it's a 3d game.... and my question is
if I write send net message ineger 0,object position x(1) + object position z(1)

and then when I get the net message
position=net message integer()

I want to separate the two integers
so I can get position object 1,the ineger x value,0,the integer z value


but it won't work why?


I have also tried sending two net message's att the same tine one with the x value and one with the z value

I't works kinda ok.. but the player just keep flicking around on the screen... so
pls!! does any one have like a good exampel of how to move 2 cubes on a matrix in multiplayer mode or does any one know a good solution to my problem

I know VisualBasic and in there I would write something like

if instr(1,positionvalues,"W") then
bla bla bla... every thing between W and H = x position and wveru thing between H and L = z position

so the string that I would send would look something like this

W500H150L

hmm this post got pretty messy but any whay pls help me!? desperat
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th May 2003 15:53
If you want to get more than one character from a string, from a fixed location, you can use my string plug-in.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 26th May 2003 21:01
well not exacly I just would like for someone to explain how to send and get the x and z positons of a character in a 3d game muliplayer

it seems no one want's to answer that I read the whole forum and no answers anywhere... *puhh*

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th May 2003 22:01
put into a memblock... send the memblock
else the sync will be off
and make sure you send the data at sent intervals, there is no point in sending data at all if the machine isn't ready to recieve it.

a major part of getting realtime online networking going is syncronising the data transfer and data string, the best way to make sure the structure is in tact is to use a memblock and just send that... you first send a few dummy bytes of data to make sure both the server and client are communicating with each other properly.

once that sync i established you then use a game timer to send data at given intervals - probably best to use the Timer()

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 27th May 2003 06:27
well I tried that now.. and it's allso my first time using memblocks
but I just get the error message "can't determine parameter type" on the memblocks... it complains about the

net message memblock 1 and net message memblock 2

any ide why?

Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 27th May 2003 07:36 Edited at: 27th May 2003 07:37
Hi again well to make things more easier for you to understand
what's wrong here is the code in beta staium verry messy!



Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 27th May 2003 09:40
well if you look att the multiplayer exampel
on the dbp cd it handels the x and y pos of the mouse
so if i make it to hande the x z pos of a model insted it would look
x=50 z=100

start ------
send net message integer 0,object position x(1)+(object position z(1)*640)

Paus --------
the obove means.. 100 * 640 = 64000 + 50 = 64050
now stop me if I'm wrong but the integer that i just sent equals 64050
Continue ---------


get net message
while net message exists()=1
PositionValue = net message integer()

OtherZ=PositionValue/640
OtherX=PositionValue-(OtherZ*640)
position object 62,OtherX,0,OtherZ
get net message
endwhile
Stop -----
now this meanas OtherZ = 64050 / 640 = 100.07812
and the OtherX means 100.07812 * 640 = 64050 - 64050 = 0


you see this inacurate in the demo!
the Z value should be 100 but it's 100.07812

and how the can the X pos work at all?... it's set to 0??

but still it work's quite good in the X Y 2d multiplayer program
but when I change it to X Z 3d game it get's screewed up! totaly
why will not this work propporly in 3d? can't be cus it's inacurate
cus it's inacurate in the 2d demo as well and it works quite fine there... please I have tried to deal with this boplem for two days without allmost no sleep :-s and I can't seem to figgure it out....

all I want to do is to make a simple multiplayergame where two boxes
are moving around on a matrix.. moveing only in the X and Z angels not inte Y...

regards Mathias

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th May 2003 10:31
You have incorrect assumptions about how the maths is working.

Because you are working in integers, all of your results will also be integers.

64050/640 = 100 (no decimal place!) so there is your Z.
64050-(640*100) => 64050-64000 => 50, so there is your X.
Tiasen
23
Years of Service
User Offline
Joined: 26th May 2003
Location:
Posted: 27th May 2003 11:15
Ok swell then! but why doesn't it work propporlie in the 3d world?

the character kinda flicks back and fourth al the time...
is it becous I don't send the position and recive them at the same time I mean like with a timer or somethin?
cus I send the integers every time I press the walking buttons
and the reciver checks for net messages al the time! is this cousing a problem?
any way thank's allot!

Login to post a reply

Server time is: 2026-07-11 04:23:44
Your offset time is: 2026-07-11 04:23:44