Stellar Spark (04-25-2016)
Lets take SD as an example for the stats.
67 stats for player + 3 stats for the entity class.
So lets assume you have 50 players on your server.
Thats 50 * 70 (67 + 3) = 3500 stats, exported every tick for just the players.
Then you also have all the loaded objects (excluding the static objects) for all players, you can look at the classes for that and figure out the total stats for that, if you want. (EDIT: Quests are always loaded)
Now try to figure out why 3500 stats being send to the client, each tick, is a bad idea.
Last edited by BlackRayquaza; 04-25-2016 at 05:54 AM.
YEP cock
Stellar Spark (04-25-2016)
You can use some form of redundancy mitigation, such as exporting each stat alongside an ID (which I assume is a byte).
In this case, you'd have to add 8 bits to the usage of each and every stat, minus the ones that DON'T change. Probably between ticks, you're going to more often change in Experience, Fame, HP, and MP. (let's assume Fame, HP, and MP are int-32, and Experience is int-64)
Per tick, the average player in realm will then spend 3 * (32 + 8) + (64 + 8) = 192 bits in StatExporter bandwidth, as opposed to the usual 70 * 24 = 1680 (rough estimate) bits you'd have to send without redundancy mitigation.
This is about a 88% improvement in bandwidth usage.
Another option (which I plan to implement in Phoenix) is using ordered bits to determine object redundancy. This doesn't add any extra possible bits, but it is a lot more hack-ish considering you have to work with the rudimentary BitStream tools that C# has to offer.
BlackRayquaza (04-25-2016)
first in as3 you can speficy the order of bits little/big endian, since we have source client why not change it in client so server in c# no need to reverse bits so we can work better
the best would be make server in java since c# dont seems to know what network byte order means, and want to implement its own shit
and now who said you need to send all stats ?? this stupid, save a reference of sent stats, then implment a stat queue sytem when something change in server, you add to that queue(in player) the stat changed and its value
edit: best is to rewrite server from 0 i showed it to my teacher he said it is disaster lel
Last edited by ReySharlLel; 04-25-2016 at 08:44 AM.
Okay, so I played around with this a bit.
Here is: 1 Player in realm after 3500 ticks (350 secs)
3 Players in realm (different locations) after 4500 ticks (450 secs)
And 3 Players in realm (same location) after 7500 ticks (750 secs)
Conclusion: Shit networking.Code:[05:26:02] [Player] TickId: 7189, Ticks: 7462, Stats: 10000335, Average Stats/t: 1340
YEP cock