Jump to content
  • Advertisement

Archived

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

Mindcry

Game data to send and syncing...

This topic is 6506 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

I''m designing a small action game. And it will have network support. My problem isn''t writting the transfer stuff itself, i already earned enough experience with that. BUT i would like to discuss how to update the game and sync it. This game wouldn''t be a Dedicated Server/Client system. It''s more like, that everyone can open up a game, and others can join. So when we have 2 players with 8 moving objects: 2 for the players itself 6 computer controlled things (for example an enemy) transfering the x and y coords of every object every frame or even every second would be to much overhead. so i would like to have each computer controlled thing run on every computer and only sync the players itself... Any ideas suggesstions? "¨¨°º©o.,MiNdCRY,.o©º°¨¨" ------------------------------------------ http://mindcry.cjb.net ------------------------------------------

Share this post


Link to post
Share on other sites
Advertisement
Well, if you seed the random number generator with the same seed on each machine, I beleive they will all produce the same sequence of numbers.

But I wouldn''t be willing to let a game run for any number of minutes without ''sync'' what those npc guys are doing.

Games like WarCraft, AoE, etc. have hundreds of moving guys.
You can send a client update out as one packet
8 things is not much at all! It''s only 80 bytes!
(2 byte ID, 4byte x, 4 byte y) A modem can send 4575 bytes a second, so given a 28byte udp overhead, you can send 40 updates a second.

Share this post


Link to post
Share on other sites
Yes the sseed must work, at least i imagined it that way.

But how should i sync the game then?
When i have to send all the data all time?
Lets take your example: we have to send the 80bytes packet 30 times a second to up to 8 players.. you see it''s way to much for a internet gameplay... i don''t want to add a requirement for the game that i need a 2mbit connection

and when i only transfer velocity vectors, and only send new ones when it has changed, the game wouldn''T be synced on all computers...

thanks
Kevin

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes, you''ll have to use some form of movement prediction, cubic extrapolation, etc...

Basically, you''ll take the vector and velocity of their last couple moves, and determine where they are headed, then render along that path until you get the new position / delta information, where you''ll correct your prediction. You won''t get an update packet for every location, just enough to build the ''path'' that they''re moving on.

Share this post


Link to post
Share on other sites
Yes, you''ll have to use some form of movement prediction, cubic extrapolation, etc...

Basically, you''ll take the vector and velocity of their last couple moves, and determine where they are headed, then render along that path until you get the new position / delta information, where you''ll correct your prediction. You won''t get an update packet for every location, just enough to build the ''path'' that they''re moving on.

Share this post


Link to post
Share on other sites
But i may only have at max 20 objects or so, is it worth to write some movement prediction. This is only a small game, and not a 3d shooter or stuff..

Isn''t there another, more simple, way?

Ohh btw you can view the gamedocs etc. at www.mindcry.net -> projects->balloon combat (twice)...

Share this post


Link to post
Share on other sites
The accessment of how much and what type of movement prediction you should uses depends heavily on what type of a game you are writing.

For example, in a driving game, prediction would be very helpful.

If however, your game is a bumble bee sim, prediction won''t help much.

FYI -- I think starcraft predicts by simply sending a packet saying, "Marine should end up at 50, 25." Each computer than has an identical pathfinding algorthim and calculates their position like that. no other information is communicated unless the marine runs into some enemies. Then the computers sync up and one comp says, "Yes there are seige tanks within range of killing your marines. Does your state say the marines are nearby as well?" Then the two machines sync.

What I think Halflife does is if you shoot where the enemy is according to your local state (say you lost a packet), it still registers a hit. Many ppl have complained about this.

What specifically are the objects and how are they supposed to behave?

quote:
Original post by Mindcry

But i may only have at max 20 objects or so, is it worth to write some movement prediction. This is only a small game, and not a 3d shooter or stuff..

Isn''t there another, more simple, way?

Ohh btw you can view the gamedocs etc. at www.mindcry.net -> projects->balloon combat (twice)...



Share this post


Link to post
Share on other sites
Here is the link to the design document so you can see the exact game type:
http://www.cdx.sk/userwebs/zdrpg/files/balloon%20fight.doc

the playersarecontrolledvia joystick/keyboard so i don''t know a final destination like in starcraft, which so doesn''t fit for my game.

i first thought about sending only the velocity to each player when the velocity changes. And do the rest of the calculating on each pc, but wouldn''t it go out of sync, cause the packets will be deliverd on differenttimes, and so the velocity will change differently on each pc, what would end in different postiions of the players

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!