Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Is this about right? (Bit packing)

This topic is 6932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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? Thanks Chris Edited by - gimp on 4/23/00 12:28:16 AM

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Looks good too me 8^) It''s a good idea to uses classes to abstract the various layers of your code. Is there a web site we can check out your game?


Share this post

Link to post
Share on other sites
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...


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!