Game Development Community

How do you transfer variables between client/Server

by Wesley Hopson · in Technical Issues · 10/14/2008 (11:33 pm) · 7 replies

Hi I could really use some help on this I can't seem to get my variables to reliably contain the values i assign them. It is really driving me nuts here because I am very sure it has to do with the values just not getting transmitted properly between the client and server. For the life of me i cannot figure out how to use the bitstream class thier just is not clear documentation anywhere that i can find. At least as near as i can figure it is the bitstream class that handles this sorta thing.

Any help in trying to understand this thing would be greatly helpful i am near the end of my rope on this. It just drives me bonkers to think the only thing that is keeping my code from working is the fact that my values seem to randomly not want to hold thier values when they feel like it. I am just not gonna be able to get anywhere what so ever on any coding until i can understand how the heck to properly transfer variable values between client and server.

BTW I am trying to make a single player game here so I don't need anything fancy just something that works.

#1
10/23/2008 (7:40 pm)
So no help on this at all?
#2
10/23/2008 (10:08 pm)
Use commandtoClient() and commandtoServer()
#3
10/27/2008 (12:29 pm)
Thank you for the reply it is nice to know someone bothered to try and help. but I am not asking about script here. I am asking about the engine code.

Also since i said i am making a single player only game commandToClient() and commandToserver() are not even really nesscary for my script.
#4
10/27/2008 (1:51 pm)
Hey wesley,
more details would be helpful,
but i suspect you might profit from reading about ghosting.
check out http://tdn.garagegames.com/wiki/Torque/Networking/Ghosting
and also http://elenzil.com/gg/tutorials/happysquiggle/happyFunSquiggleBall.html
#5
10/27/2008 (2:17 pm)
Wesley,
you need to pack the value of a variable from one side(client or server) into the stream using one of the bitstream write methods such as writeFlag, or writeInt
and then unpack the data from the stream symmetrically(if you used writeInt on one side you must use readInt on the other, and done in the same order relative to the other values packed), with the bitstream read methods such as readFlag or readInt and assign the methods return value to your variable.
#6
11/07/2008 (10:47 am)
@John that is more along the lines of what i have been trying to do. I seem to be having trouble getting the write and read methods for the bitstream class to work right. Mostly i really do not understand how they functionaly work. But anyway I finally got a hold of a copy Edward F. Maurina III's latest book that should help me figure out how to properly use the bitstream class. I found his first book incredibly useful and well written so i should'nt have any major problems.

@Orion Elenzil your happySquiggle tutorial looks freaking awsome I can't wait to try it out of course as soon as i get a chance. I can think of quite a few things those little squiggles might be used for with just a tiny bit of tweaking.

Do you have other tutorials or resources like that?
#7
11/07/2008 (11:02 am)
Sorry, that's all i got!