I've begun networking in D Lix

Started by Simon, September 08, 2016, 02:02:02 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

RubiX

wow yea u did work a lot on it continously!

NaOH

Wow, that solid chunk between December and the end of March is really something. :lem-shocked:

Simon



This is D Lix, playing a replay from C++ Lix. Hatches and goals are distributed according the replay's player permutation.

Several bugs still in: Wrong icon, albeit in correct color, on top of exits. Some exits aren't assigned any color, if your lixes enter such an exit, they're removed from play, but nobody gets points. No tape recorder buttons shown during replay. Lix in info panel is a garden lix, but should be blue instead. Can't start a networked game, only look at replays.

I'd rather not release anything with such bugs. You can't play networked anyway. The cut-off arrows in the screenshot are regular screen tearing, not a bug in Lix.

Re solid chunk: The github streak from 2015-12-24 to 2016-04-01 lasted exactly 100 days. :lix-evil: Shortly after, github stopped displaying streaks.

-- Simon

Simon

#18


Slow progress, this box is the only result from the past 2 weeks. I'm getting multiplayer replays in shape. I haven't played any networked games yet, this replay was an old C++ Lix replay.

<SimonNa> my sleep cycle is busted again, I'm not awake enough for a stream, but can't sleep either. Programming might be more suitable. JJ is harder than writing code <_<

Starting a game from the lobby is next. During play, there are some UI design problems left over from C++ Lix: How to display names? I'm considering to keep the score graph name-free, but when hovering the mouse cursor over the score graph, the game prints names and score numbers above the graph, into the playing area.

-- Simon

RubiX

I really like the idea of keeping names out of view until you hover over it.  Much less clutter.

Simon

I played a test game with geoo 3 days ago. Bugs and missing features:
  • Starting games is OK, but I haven't written code for end of game yet. The network connection times out after one game.
  • Server doesn't send time-syncing packets yet. Players will time-shift against each other due to network lag and FPS.
  • You can cancel other people's replay actions by clicking into air, like in singleplayer. This desyncs the replays.
  • geoo experienced outdated terrain graphics on correct physics, even in singleplayer. Not good.
But we were able to play a meaningful opening with interaction. :lix-grin:

The game server on lixgame.com is only up whenever I test. In theory, anybody can build the source, host their own server, and play bugged games there. In practice, I want to fix the descyncing and other heavy infrastructure bugs, then announce test games on IRC in a couple weeks.

-- Simon

Simon

I wrote more client-side handling today: You can't cancel anybody's replay assignments during networked play. After a game, you land back in the lobby/room dialog, you can start right another game from there. I'm not yet done with sending time-syncing packets, but I expect to have that within a week.

I'd like to test this next week! Don't expect rock-solid games yet, there will be bugs and missing features, but I want to see whether this is playable. :lix-grin:

Who is up for a smoke test on Sunday, 2017-03-19 at 18:00 UTC?

-- Simon

RubiX

Might be at my sisters place, but if not i'll certainly hope to be able to test also.


namida

I can't promise I'll be available at that time, but I'll be happy to join in the testing if I am. :) I can test both Windows and Linux builds (though Linux would be via a VM, since I'm not entirely sure where my Linux laptop is at the moment).
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Simon

Okay, cool, networking session on 2017-03-19 18:00 UTC, join IRC quakenet.org #lix around then. I'll release earlier that day. Edit: Lix 0.6.28 released.

Planned design of the time syncing: The server counts physics updates (PUs) since game start. Every couple seconds, the server sends to each client the number of PUs since game start. The client adds his connection's lag to that value, then speeds up or slows down physics slightly to match the lag-adjusted PU.

The desired effect is that everybody tries to be at the same PU during the same UTC-datetime. Does the design accomplish that, or should we account for lag somehow differently?

-- Simon

namida

How was it accounted for in C++ Lix? Despite playing on laggy connections sometimes, I don't recall encountering anything beyond the normal symptoms of lag there (in particular, no desyncs, I think?).
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

Yeah, are we saying this planned design is new from how C++ Lix accomplished the desired effect? (or maybe it never did?)  What are the alternatives (if any) that have been considered?  It's been a long while so I don't remember any details.

Anyway, conceptually it sounds reasonable.  Client uses the info and timing of the server's PU data to estimate how much its current local count of physics update is lagging/leading, then modify the speed accordingly to try to compensate.  The important thing is to actually try it out to make sure it plays out okay, like the player doesn't notice any a lot of frequent and possibly abrupt fluctuations in speed.

For testing out effects of longer lags it may be useful to try a VPN.

Simon

C++ Lix has this same basic design: Server sends syncing info, client adds lag, client adjusts speed to approach this sum. But the C++ Lix client was stupid in some details, it didn't bother to re-adjust the speed once it has caught up, but happily overshot until the next server sync.

I wrote the D impl yesterday, improving on this:
  • Server sends milliseconds, not PUs, because milliseconds are more precise. Client still adds lag normally.
  • Server syncs rapidly during early game, especially before first lix spawns. Then syncs less frequently later.
  • Client remembers how many frames it must ultimately skip/insert between PUs, and stops adjusting before the next syncing packet arrives.
I've never considered anything else yet. <_<

Will see how it feels after the test. We won't do 6+ people yet, which produced lots of felt lag (might have been network or local computation) in C++ Lix.

Get Lix 0.6.28 to join the test on 2017-03-19 at 18:00 UTC.

-- Simon

Simon

We had a test yesterday.

Lots of bugs and missing features! NaOH has the same bug as geoo with outdated terrain graphics, but correct physics. Agonizing, because I can't repro the bug for my life, yet it hits them both frequently. We filed 9 bugs in total. :8:()[:

I want to hack on the bugs, and get back on reallife. I can't tell when we should test again. Next Sunday is too early, some issues will take time and are important.

Nonetheless, I'll leave the server running, for whoever wants to play buggy games. :-]

-- Simon