Jump to content
SubSpace Forum Network

Recommended Posts

Posted

According to the do-*BAD WORD*-entation and code I'ves looked at (Mostly MERVbot and !@#$%^&*ociated docs), a powerball packet involves position, velocity, and timestamp. However, even for a stopped ball, the packet contains non-zero data for velocity. This velocity appears to be in the direction of movement prior to stopping. So I am !@#$%^&*uming that the stopped powerball position is based on the coefficient of friction for the ball (does anyone know what this value is?) and !@#$%^&*umes the position based on the timestamp.

 

Basically what I'm asking is:

 

1. What's the coefficient of friction for the ball (or is it a setting somewhere)?

2. What is the meaning of the timestamp in the powerball packet, or more specifically, how is position calculated from velocity and the timestamp?

 

My guess for #2 is P(t) = P + V * deltaT, where deltaT is the difference between the current estimated server timestamp and the timestamp on the powerball packet.

Posted
The ball packet contains the id of the player carrying the ball (if applicable), when the ball was shot (if applicable), and it's vector (if applicable). The client must calculate at any given time where the ball is based on the friction setting of the arena. I do not know the math behind this.
Posted

The relevant setting is a per-ship setting, SoccerBallFriction

I don't know its units and/or how it's used.

Your guess about calculating position is probably wrong. I very much doubt that the client calculates the position from the origin of the ball packet each tick. It's more likely that each tick T it does

P(T) = P(T-1) + P(1)

and stores P(T) to use as P(T-1) next tick. The reason being that the ball bounces, and the client has to do intersection tests with each possible tile position, and if appropriate, collision response. If you calculated position from the origin, and the ball has low or 0 friction, it might have to do 1000s of tests/responses every tick, which wouldn't be reasonable. Using the above formula, you only have to test/respond to the tiles that you've crossed in the last 10ms rather than, potentially, the last 3min.

I don't know about stopped balls having nonzero vel.

 

-numpf

Posted
I think he means that once a ball has come to a stop, the ball packets still have non-zero dx,dy. This is because the ball packet contains the original shooting vector until the ball is picked up again. The client needs to determine the current speed/location of the ball.
Guest
This topic is now closed to further replies.
×
×
  • Create New...