So I have this 2 player game with a TCP connection between. Then I have an ObjectInputStream/ObjectOutputStream between them to handle data and sends/recieves every 33ms (~30fps). They transfer well but I often change objects, so I get serialization problems. To solve this i reset the outputstream which *works*, but creates a massive delay if I reset the stream every tick. Instead I can reset it every 20 tick or so which removes the latency but creates an seemlingly laggy player on the screen, since it only gets its position each ~0.5s :crying:
So how do I solve this? or rather, how does big games that handle alot of data do (example, CS, LoL etc..)? I only send custom objects with different variables, since every image already exists on both ends.
tl;dr: ObjectOutputStream.reset() with fast tick creates network lag, slow tick creates delay.
Help! Massive lag with Object Streams / how does big games handle data transfer?
Started by Master Kenth, May 06 2011 08:52 AM
1 reply to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









