Event Handling

Options
gio_abelix
gio_abelix ✭✭
edited March 2011 in Native
i have simulation loop with 0.01 seconds interval and i'm sending events from this simulation loop, they can't deliver :( if simulation loop is with 0.2 or 0.19, or 0.18 seconds interval it's work - i can get this event on the other side. what is this problem anyon knows? :?:

Comments

  • Tobias
    Options
    It might be too much data to transfer.
    Or you need to call Service() / SendOutgoingCommands() more often. Only if you call this, a UDP package is filled and sent. If you produce more data in your simulation loop than what goes out, your outgoing queue will fill up.

    I'm not sure what you are working on, but sending something every 10ms sounds like too many updates. Usually you want to send 5 to 20 times a second and interpolate the rest. That way, you won't eat up your bandwidth with minimal updates. How much could the values you send change in 10ms?
  • gio_abelix
    Options
    so, i have character and i move it in realtime simulation loop, and from this simulation loop I'm using opRaisEvent:
    NSMutableDictionary* ev = [[NSMutableDictionary alloc] init];
    	//
    	[ev setObject:[NSValue valueWithBytes:&x objCType:@encode(int)] forKey:[KeyObject withByteValue:STATUS_PLAYER_POSITION_X]];
    	[ev setObject:[NSValue valueWithBytes:&y objCType:@encode(int)] forKey:[KeyObject withByteValue:STATUS_PLAYER_POSITION_Y]];
    	//
    	[litePeer opRaiseEvent :mode :ev :EVENT_MOVE :0];
    	[ev release];
    	sentCount++;