2-player game, client and server at localhost

2005-07-30 Thread Michael Rybak
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do computations, the only data transfered is user mouse/kbd input. It works synchronously, but somehow, when I

Re: 2-player game, client and server at localhost

2005-07-30 Thread Peter Hansen
Michael Rybak wrote: > I'm writing a 2-players game that should support network mode. I'm now > testing it on 1 PC since I don't have 2. I directly use sockets, and > both client and server do computations, the only data transfered is > user mouse/kbd input. > > It works synchronously, but

Re: 2-player game, client and server at localhost

2005-08-02 Thread Christopher Subich
Michael Rybak wrote: > That's the problem - "or a player input comes in". As I've explained, > this happens a dozen of times per second :(. I've even tried not > checking for player's input after every frame, but do it 3 times more > rare (if framecount % 3 == 0 : process_players_input()). Well, I

Re: 2-player game, client and server at localhost

2005-08-02 Thread Christopher Subich
Michael Rybak wrote: > CS> There's the key. How are you processing network input, specifically > CS> retrieving it from the socket? > > A "sock" class has a socket with 0.1 timeout, and every time I > want anything, I call it's read_command() method until it returns > anything. read_command(

Re: 2-player game, client and server at localhost

2005-08-03 Thread Christopher Subich
Michael Rybak wrote: > As stated above, that's how I'm trying it right now. Still, if doing > it turn-base, I would have to create a new thread every time. >I have some other questions though - please see below. No, you should never need to create a new thread upon receiving input. What you

Re[2]: 2-player game, client and server at localhost

2005-07-31 Thread Michael Rybak
Thank you very much for your response, and may I point out some details: >> It works synchronously, but somehow, when I play in client window, >> both client and server have 17 fps, while when playing in server >> window, server has 44 fps while client has 5, and due to forced >>

Re[4]: 2-player game, client and server at localhost

2005-08-01 Thread Michael Rybak
Again, thank you very much for your help. DLB> The server should basically handle the multiple client DLB> connection logic, and determination of interactions between movable DLB> objects -- collision detection, for example (and I don't mean in the DLB> terms of graphics rendering but in t

Re[6]: 2-player game, client and server at localhost

2005-08-02 Thread Michael Rybak
sorry for emailing privately, pressed the wrong "reply" button >> Each player controls a snake, which is 2 to 12 balls connected to each >> other with ropes; by mouse motions you move the snake's head, and the >> rest of the body moves adhering normal physics. The objective/gameplay DLB>

Re[2]: 2-player game, client and server at localhost

2005-08-02 Thread Michael Rybak
CS> Michael Rybak wrote: >> That's the problem - "or a player input comes in". As I've explained, >> this happens a dozen of times per second :(. I've even tried not >> checking for player's input after every frame, but do it 3 times more >> rare (if framecount % 3 == 0 : process_players_input()).

Re[4]: 2-player game, client and server at localhost

2005-08-03 Thread Michael Rybak
I was a bit unhappy to read this, because what you describe here is just what I've tried yesterday in my test-game with 2 balls, so if I've pointed that out, you wouldn't have to say I DLB> don't understand threading either, it appears. :'( Thank you very much for putting so much effort in making