Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

119 Neutral

About jimjamjahaa

  • Rank
  1. jimjamjahaa

    simple regex issue

    i feel stupid :)   (thanks!)
  2. I want to loop through all lines beginning with a number and break when the line does not begin with a number   i have the following (java) for (line = noCommentLines.get(lineIndex++) ; line.matches("^[0-9]") ; line = noCommentLines.get(lineIndex++)) { } the first value for line is "0 0" (this is some level loading code, and the lines will be positions of objects)   the loop breaks immediately rather than entering, so my regex must be wrong... but it seems ok to me... :(
  3. jimjamjahaa

    Max RTS players, casual drop-in

    For drop in play with deterministic lockstep you might be able to   - take a "full world snapshot" on the server  - begin sending the world snapshot to the new joiner (could take a "long" time with 1000s of units, maybe a few whole seconds ) - at the same time start buffering all new input that happened since the snapshot was taken - after the world snapshot has been sent start sending all the inputs that were missed - on the client side, after receiving the snapshot you start playing back inputs as fast as you can (with no rendering) in order to catch up with real time.  - continue business as usual   ??? just an idea   it occurs to me now that deterministic lockstep doesn't necessarily use a "server" really. just something that coordinates input. oh well
  4. Hi guys.   I am making a multiplayer platformer using UDP.    I stream input from my client to the server, and the server queues this input up and plays it back.    If the client input is not acknowledged by the server, the client resends the input on its next update.   This repeats until the input is acknowledged.   All very standard stuff.    My issue: Say the client lags or drops packets for for 500 ms, then resumes as normal. From the server's perspective no inputs arrive for 500 ms, then all 500ms worth of input arrives at once. The server then starts to play back the input.    All the client input is played back faithfully but 500ms later than it should be.    What's more, all the new input arriving from the client with no lag is being put at the back of the input queue, so even tho it arrives quickly it isn't used for at least 500ms, and this continues forever. It never "catches up" after the lag spike.    Now obviously i could set a maximum size for the input queue (somewhere between 1 and 2 update's worth?) and simply discard anything that doesn't fit in the queue. This would stop it looking delayed but then i run the risk of missing crucial input. I might miss a jump command, for example, which would make the game feel buggy.    So then i was thinking maybe we look through the input we're going to discard before discarding it and see if there are any jump commands... and then i thought this was getting a little complicated and maybe i should make a forum post... and here we are.    What would be your guys' advice on how to solve this?   Many thanks in advance for any replies
  5. Hey thanks so much for your reply.   I think i am getting confused between a few concepts, that's true. I've been reading so much lately! But also i am trying to achieve something slightly more with my design. I am trying to get the server to simulate every clients input for "sequence 1" at the same time. Imagine in your example scenario the server on frame 24 receives input from Client A @ sequence 3 and Client B @ sequence 1. The way you describe it these would be executed at the same time on the server. Tough luck for client B.    I was thinking of buffering input on the server side so that the slowest client has a chance to get its input sent. Then once the buffer is sufficiently full of inputs it can start simulating everyone's "sequence 1" at the same time and continue with a smooth simulation.   But now i am thinking that maybe this unnecessary, adding latency for the faster connections. I just don't know. 
  6. I am trying to make a multiplayer platformer with UDP...    Here is what i have so far (from reading various online resources):   Each frame, the client records the current input state and frame sequence number to an "input buffer". The input buffer is sent to the server via UDP each frame.    If/when the server receives this, the server will respond with an acknowledgement message telling the client that it has received inputs up to sequence number X.   If/when the client receives this acknowledgement message, the client will discard the beginning of its input buffer up to the sequence number that the server has acknowledged.    In this way the client streams all its input to the server in a reliable way over UDP, albeit sending some redundant information.    Now to the tricky part:   With lag it is guaranteed that the server receives input that is in the past. Lets say there is 100ms network delay and my game ticks every 16ms. This means about 6 frames will tick in the time it takes to send a message.    Lets say the client and server are synchronised and they are both currently on frame 50. The client sends its buffer containing input information for frames n...50. The server receives this 100ms later, by which time it is on frame 56 or so.    It doesn't make for a very good simulation if we play back this input on the server starting "now" aka frame 56, because the input was supposed to be representative of frames n...50 according to the client.    So i am guessing we need to record on the server the state of the entire world in a "world state buffer". This way when we receive input that was in the past we can rewind the world state to that exact frame, inject the input and play things back out in fast forward to get back to "now".    That doesn't seem too bad... right? I guess that is question number 1: am i on the right track here?   Now the really tricky part:   What happens when you have 2 clients with very different latencies. Lets say "Client A" is on a fast connection (30ms) and "Client B" is on a slow connection (200ms)   Lets say Client A jumps on Client B's head in order to kill him and get some points. Obviously his messages will get there in good time. Lets say Client B dodges this attack with just a few frames to spare. His messages will not get to the server for some time. It is possible that the server will simulate Client B's death, then some miliseconds later receive Client B's input buffer that contains input from a (relatively) long time in the past, rewind the game to a point before Client B had been killed, apply the input and Client B will now survive.    But we already simulated his death and sent that message out that he died.    I guess my second question is how do we avoid situations like this?    Sorry for the somewhat vague nature of this post. It's a really complex issue and it's really melting my brain.
  7. jimjamjahaa

    What to use for creating this type of game?

    Yes creating a game engine is a lot of work! 800$ seems reasonable... if there is a way i can test the android / iOS performance before sinking the money to deploy it that would be amazing. But regardless, quality reply! Thanks!
  8. I have a specific idea in mind for a game engine. I want to use a simplistic 3d model of the game world, projected orthogonally for scenes with a moving camera, or with perspective for static scenes, to create a lighting and shadow stencil which will be composited with a pre-rendered 2d image of the scene along with 3d rendered character models to create an effect similar to what you find in old ps1 era jRPGs (final fantasy 7 - 9, chrono cross etc.) but with much better lighting. I will eventually want to port it to android, ios and windows desktop computers. So basically i just would like advice on what tools you'd use for creating this. OpenGL from scratch? Some kind of existing framework or engine? 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!