In my oppinion a normal bullet/laser/rocket needs only following informations to be synchronized:
- Position: x0, y0, z
- Direction: dx0, dy0, dz0 (or a quaterion, whatever you use)
- Velocity: v0
- Acceleration: a (if needed eg. for rockets)
If you got granades, that physicaly interact, the situation is a little diffrent, since the correct physical properties (position, reflection, velocity) can depend on the framerate of the client(s) - depending on the physics engine implementation. Now you will have to choices:
1. The server tells where the granade will detonate and deal damage to the surrounding objects. Don't care about where the client realy draws the granade. Worst Case: A granade will seem to by far away but actualy is nearer.
2. More synchronization work for a bouncing granade
Point2: You could think about only sending informations of the granade only if it's position,direction or velocity changes (synchronize on change). If you would like to have granades like in Quake, which bounce on the floor and loose movement energy so their bouncing and the hops get smaller you can decide to not send all bouncings, since with small movmenent energy also the inaccurancy of the granade will become smaller.
Hope this helps a little,
patrick
Sending bullet positions?
Quote:
- Direction: dx0, dy0, dz0 (or a quaterion, whatever you use)
- Velocity: v0
- Acceleration: a0
Actually, if you know the type of the bullet, then the acceleration can be a function of the type and time since launch, so you don't need to send that. For directly and velocity, you just need to send a velocity vector with magnitude == speed; orient the bullet mesh in the direction of travel, and with world up. Thus, five values reduced to three!
enum Bool { True, False, FileNotFound };
In my game, I had mostly rapid-fire weapons. So the server just let everyone know when a player started and stopped firing. No information about the projectiles whatsoever was sent over the network. It was just assumed that the clients' displays would be good enough that the visual would match any corresponding health decreases.
It worked very well.
It worked very well.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement