Just an idea, for prioritization:
Compute a "perception index", based on data change (I'm assuming the client will eventually extrapolate using a constant acceleration model).
Code: Select all
PerceptionIndex =
(Wa * DeltaAccel + Wv * DeltaV + Wp * DeltaP)/(Wdm * Distance)
+ Wf * numShotsFired / (Wdf * Distance)
+ Wt * (isTarget?1:0) / (Wdt * Distance)
Where
Wa = Acceleration Weight
Wv = Velocity Weight
Wp = Position Weight
Wdm = Distance for movement weight
Wdf = Distance for shots weight
Wdt = Distance for targetting weight
But, most importantly,
DeltaAccel is difference in last reported acceleration value
DeltaV is difference in predicted velocity (based on constant acceleration extrapolation from last reported acceleration)
DeltaP is difference in predicted position (based on same model)
See the idea?
This model could be used to prioritize updates both to and from the server. How both ways?
The server would use this value to prioritize updates in an internal queue - simple. I could try doing that if I had a grip of how server code works... who knows... but I post just in case someone takes the idea and does it first.
The server would inform in each update packet of the player's current "priority", which is the maximum priority as seen from other players. So... if there's a player A, B and C, and B has A as priority 1 (low) and B has A as priority 10 (high), A would receive 10 as its own priority.
Then, the server would choose, based on priorities, how to allocate incoming bandwidth. Cool huh? High-priority units would be given more bandwidth, and lower-priority units less bandwidth, and the bandwidth gets translated to update frequencies, and the update fequencies get transmitted to the clients as a command, like UPDATEME_THIS_OFTEN or something. That way, the server manages bandwidth dynamically and efficiently for optimal perceived responses.
Cool idea, right?
Who wants to tell me how to implement it?
Like... where is the client loop? The server loop? Where do I find things?
I'd love some help, because I don't have that much free time, and digging through source code isn't a very productive way of spending it if I don't get to do something with the code by the time time runs out.
(wow... rantish paragraph).
Hm... I posted here because Matt posted about this stuff and it prompted me to take a smallish look at the code (and I didn't get much, except that clients update once in a while without much sophistication). But perhaps I should mail it to the dev list.... hm...