After a few discussions with you guy's I'm had a good think about the information I'm trying to send to the remote clients, the server and now understand the 'you can get better compression by just knowing your data'
One example of what I was thinking about was my tanks turret angle \ pitch as represented on the remote clients screens.
I was thinking about various implementation's of a low accuricy 360 degree's \ 90 degree's method but realised that the remote clients probably don't even need this kind of accuracy and my numbers don't have to align with the standard 360 degree's circle rule.
I thought that just dividing my circle in to say 256 angles that best represented my tanks local angle. This way I could pack the angle in to 8 bits and the pitch could probably even be represented by 16 angles with 4 bits. The remote clients could then just interpolate the turret angles during movement but resting places(no change recieved) will always be one of my real values.
Is this the right idea? Storing a turret angle update in 12 bits? In this way the server could update a client with the turret angles of 15 other tanks in a collated packet in a mere 23 bytes. As knowing the 'exact' angle of an enemy turret isn't critical this could be collected on the server and sent off in batches say every ~200 ms etc to help keep the highway clear for the critical updates.
I guess this method could be used for many 'small number things' like scores etc, where whole int's aren't really needed if the upper bound of the number is know to be small. Say the score has a limit of 256, each player could be represented by 8 bits making full score updates for 32 players 32 bytes. Even this could be run with delta's however.
I this is the right idea I guess I sould learn how to use classes. This seem's like the perfect place to use them, ie, to hide the specific implementation of bit ordering from the game code. I should just call network.TurretOrientation and give it the current float turret pitch and float turret angle and let it work out the bit ordering stuff
(I've never used classes before...)
Am I on the right track? Is this what you real game developer's do it? Is this even the 'right' way of doing it?
Edited by - gimp on 4/23/00 12:28:16 AM
Sadly the ''game'' right now is having the infrastructure written so isn''t much to look at.
Right now all it does is render up a polygonal based mesh and place a camera in it that conforms to some basic physics like accelleration and decelleration \ inertia.
The hardest part is that for 17 years I''ve been a basic\vb programmer, 4 months ago I learn a bit of C, 2 weeks ago I started learning C++
I''ve only entertained the idea of making my own game for about 3 weeks tops...
Currently I working on converting the input system to use the lockstep method that Brad Pickering suggested, loading the hovertank classes and weapons from config files and video mode setting from config files.
The networking code is being worked on, mostly in the form of classes and defines so i can organised my thoughts..
The hardest part is that I have to keep dropping in to microsoft.public.vc.language to ask people about things like converting basic_strins to floats\int etc, etc, basic stuff. I know HOW to make the game but I''m having to learn the language as I go along...