I've got a GNet based game running beautifully over my local network, but terribly over the web. According to activity monitor, its only requiring 10-15k/second (well within my connection capabilities) up and down - but things are lagged by 30 seconds to a minute!
Here's the way I'm doing things:
All level objects are GNetObjects that aren't updated - so on first connection, tons of GNetObjects are synced - but then not changed (so that you download the state of the world from the server, but it doesn't cost additional bandwidth afaik) This works fine - I get the worldstate instantly and the level appears.
The client creates a GNetObject for its keypresses, etc - which the host detects immediately (works)
The host creates two characters with GNetObjects for itself and teh client. The hosts character seems rather lagged when moving (10-15 seconds) while the clients cahracter can lag anywhere from 30 seconds to 2 minutes. Or completely spas out.
GNetSync is called at the end of every frame, both machines were running around 60fps. I think that means, on the client, 60x a second it was sending its keystate, and on the server, 60x a second, it was sending the position and animation states of 2 characters. This is relatively tiny amounts of data...
Also, at one point, it broke into the debugger with a message about unexpected error in ENet - before I could examine the execution tree, it crashed and debugger disappeared (routinely this happens with GNet projects for me).
How do you do GNet stuff?
Am I better off finding another networking library, because unless I'm misusing GNet, it's unsuitable for internet connections (everything works flawlessly on LAN)?
Here's the way I'm doing things:
All level objects are GNetObjects that aren't updated - so on first connection, tons of GNetObjects are synced - but then not changed (so that you download the state of the world from the server, but it doesn't cost additional bandwidth afaik) This works fine - I get the worldstate instantly and the level appears.
The client creates a GNetObject for its keypresses, etc - which the host detects immediately (works)
The host creates two characters with GNetObjects for itself and teh client. The hosts character seems rather lagged when moving (10-15 seconds) while the clients cahracter can lag anywhere from 30 seconds to 2 minutes. Or completely spas out.
GNetSync is called at the end of every frame, both machines were running around 60fps. I think that means, on the client, 60x a second it was sending its keystate, and on the server, 60x a second, it was sending the position and animation states of 2 characters. This is relatively tiny amounts of data...
Also, at one point, it broke into the debugger with a message about unexpected error in ENet - before I could examine the execution tree, it crashed and debugger disappeared (routinely this happens with GNet projects for me).
How do you do GNet stuff?
Am I better off finding another networking library, because unless I'm misusing GNet, it's unsuitable for internet connections (everything works flawlessly on LAN)?