Jump to content
  • Advertisement

uri8700

Member
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

100 Neutral

About uri8700

  • Rank
    Member
  1. uri8700

    Latency affecting frame rate

    WOW!!!! I commented out the set socket buffer to zero code and it fixed it, well kinda. It seems that it was a bad idea. And Nagle's or no Nagle's doesn't seem to have much impact on performance, weird as it seems. So much for theory vs. practice. Weird stuff. THANKS
  2. uri8700

    Latency affecting frame rate

    I did some traffic capturing with Wireshark, and it seems that my ~15 byte data packets are getting aggregated to ~80 byte TCP packets and sent ~5 times/second even though I disabled Nagle's and set the send buffer to 0. I'm really stumped by this. I disabled Nagle's and the send buffer by doing: Socket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); WSAAsyncSelect(Socket, hwnd, WM_SOCKET, (FD_CLOSE|FD_READ)); int flag = 1; setsockopt(Socket, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); int sendbuff = 0; setsockopt(Socket, SOL_SOCKET, SO_SNDBUF, (char *) &sendbuff, sizeof(int)); ... connect(Socket,(LPSOCKADDR)(&SockAddr),sizeof(SockAddr)); Is anything wrong with this code? Why is TCP still aggregating my data packets instead of sending them off immediately?
  3. uri8700

    Latency affecting frame rate

    OK, I'm not talking about framerate, i'm talking about network update ticks. It should be possible to get 30 ticks/second using TCP even on a high-latency link, right? If you disable Nagle's and the send buffer, that is. But I'm getting 6 ticks per second. Why is the server waiting for ack before sending another packet (i'm guessing that this is the problem)?
  4. uri8700

    TCP question

    My networking & rendering are tightly knit, via the data object that keeps object position, gets updated by the network and gets redrawn much quicker than network-updated. What paces the whole thing is the rate at which the network updates the object, and somehow latency slows that down to ~5-6 times per second, instead of 30 or so.
  5. uri8700

    Latency affecting frame rate

    Client recv()s: Using windows event system (async socket) Client send()s: Client samples keyboard 30 times a second and send()s commands
  6. Hello When I test my 3d game over a 170ms latency connection, frame rate goes down to unplayable levels. Why would latency even affect frame rate? It's supposed to affect only the response time for the first packet. Somehow, latency affects every packet of the stream seperately. Maybe it's because I'm using TCP. I disabled Nagle's and set the winsock send buffer to 0, but still, each packet gets delayed. Thanks
  7. uri8700

    TCP question

    @frob: LOL maybe I'll try the bongo drums method to improve latency But seriously now, I'm having big problems with latency. When I run it on loopback it's perfect, but when I try it on a 170ms latency broadband WAN, I get tons of trouble. Most obviously, animation becomes jumpy and totally not smooth. Why is it? is it because I'm using TCP? I would have thought high latency only causes a delayed response time for the first packet, but then it's supposed to be smooth cause there's a stream of packets keeping it going. But it seems as if the client waits the 170ms for every packet seperately.
  8. uri8700

    My game server is eating my CPU

    hplus, can you give an example algorithm similar to EJH's using select() instead of Sleep() and the clock? His algorithm is more or less like mine.
  9. uri8700

    TCP question

    Thanks, you saved me tons of trouble by pointing me in this direction. Now I see that it *is* necessary to send each data packet in its own TCP packet, otherwise timing gets thrown off. So for a real-time game with movement orders and object positions being sent in a flux of 20-byte packets, you'd have to set the TCP_NODELAY option, to disable nagle's. Is it also necessary to set SO_SNDBUF to 0 and disable Winsock buffering? it seems so, otherwise you still get disrupted timing from buffering.
  10. uri8700

    My game server is eating my CPU

    OK, can anybody suggest a method other than Sleep() for regulating server ticks?
  11. uri8700

    TCP question

    Hi all If I send 60,000 data packets of 20 bytes each using send() and TCP, how much header overhead am I gonna get? I mean, I hope not every send() warrants its own TCP packet with a full header, does TCP aggregate send()s and waits for data to pile up before forming a packet? How long does it wait before sending a packet if no more data is sent()? Thanks
  12. uri8700

    My game server is eating my CPU

    Thanks you all for your suggestions. I'm doing a Sleep(33) on every thread to regulate to 30 recv()s per second, apparently non-blocking ones. What is IOCP? I'm running locally using the loopback interface. Now I can support 10-15 users, and the limiting factor is probably client use of CPU (unlike before when the server was the hog). I'll have to find another machine to do a more realistic test. But it's already much better thanks
  13. uri8700

    My game server is eating my CPU

    I'll take a look at the FAQ, thanks. But my sockets are already non-blocking. The server checks for update every 1/60 second, when it gets an instruction (key_was_pressed) it calculates object's new position and sends an update to all players.
  14. Hi I made a multiplayer 3d game and the server eats up way too much CPU. On a quad-core 3Ghz machine it only supports 5 players before things get realllll slooooooowwww. The server is multithreaded, one thread per player and checks the line for input 60 times a second. Does this make sense? Is my design somehow flawed? Does anybody know how I can up the number of players? I can't check the line less often coz then player movement is disrupted. Thanks
  15. Hi I'm writing a c++ audio player. How do I play Shoutcast/Icecast streams using DirectShow? Do I need to install a filter? plz link to tut/post code thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!