TheDirectShift

Member
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

103 Neutral

About TheDirectShift

  • Rank
    Newbie
  1. Lag in TCP/IP lockstep model RTS game

    well, Within a localhost connection, the speed is 30 fps, and with a LAN, it drops to 10... I downloaded Wireshark, and shit, it's a mess! I didn't understand anything! looks like I'm going to need a tutorial... I understood your explanation of runtimeexception, thanks! it was very detailed! I'm considering the option hplus0603 gives me, I hope that works! I must redesign the send/receive system...oh well.... I'm going to post news as long as I finish the new protocol. thanks for helping!
  2. Lag in TCP/IP lockstep model RTS game

    Well, whats happens is that when trying the game with a lan connection, the FPS get down to lie 10, with little burst of lag every 4 seconds, with a duration of half a second. I don't know how to use Wireshark, but I'm sure it's not a traffic problem... The Information contains two methods with 20 lines each, and the matrix of 5x6 integers. I will have in mind your advice of just sending one object. What's the difference in your words, between using runtime exception and normal exception??   thanks for your advice!
  3. Hi to everyone! I have been dealing with this problem for weeks and I can't find the root of it. I'm working on a RTS game, it uses lockstep to communicate. At the moment it's just 2 players.   I'm going to show you the code of sending/receiving. Information is an object containing a matrix of 5x6 integers. settcpnodelay is done outside.   there is only one Thread               SleepABit();             ReceiveData();                        ScheduleDutys();             UpdateAllUnits();             SendData();                   DrawGraphics();             step = StepLookAhead(step,1);       private void ReceiveData()     {         try{                 if(whoisthis == 1) //for server                {                     indata1 = new ObjectInputStream(sk.getInputStream());                                         info_other1 = (Information) indata1.readObject();                     ProcessInformation(info_other1); //process client info                                         ProcessInformation(info); //process own info                                                         }                 else //for client                {                     indata1 = new ObjectInputStream(sk.getInputStream());                     indata2 = new ObjectInputStream(sk.getInputStream());                                         info_other1 = (Information) indata1.readObject();                     info_other2 = (Information) indata2.readObject();                                         ProcessInformation(info_other1);                     ProcessInformation(info_other2);                                                         }                }catch(IOException ioe){} catch(ClassNotFoundException css){System.out.println("nothing to do here");}         }       private void SendData()     {                           try{               if(whoisthis == 2) //this is client              {                 outdata1 = new ObjectOutputStream(sk.getOutputStream());                                 outdata1.writeObject(info);                 info.CleanInformation();                                     info_other1.CleanInformation();                 info_other2.CleanInformation();                                               }               else //this is server              {                   outdata1 = new ObjectOutputStream(sk.getOutputStream());                   outdata2 = new ObjectOutputStream(sk.getOutputStream());                                     outdata1.writeObject(info); //send server info                                   info.CleanInformation();                                        outdata2.writeObject(info_other1); //send client info                  info_other1.CleanInformation();                                 }                           }catch(IOException ioe){}     }     I know the problem is there, in one of those codes, because when I try it in localhost mode, it works excellent, but when it comes to playing with another player through LAN...it lags, and I really don't know why.     So, I hope you can help me here, thanks ! bye!