Author Topic: I've begun networking in D Lix  (Read 11642 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
I've begun networking in D Lix
« on: September 08, 2016, 02:02:02 AM »
Hi,

this topic is outdated: Lix 0.8 and onwards has networked multiplayer, and we've played some nice sessions already in September 2017. Get a recent Lix from the Lix homepage.



I have begun developing the networking in D Lix. Networked multiplayer is the cheese feature, Rubix and NaOH have joined LF after playing Lix multiplayer in C++ Lix. We must have multiplayer in D Lix.

Game rules: Each player has lixes in their own color. You may assign skills only to lixes of your own color. There is an exit with your color, try to get many lixes into that exit. You get a point for each lix in your exit, no matter whose lixes they were. Screenshot of multiplayer in C++ Lix.

Technical background: Each player runs Lix on their own computer, and connects to a server. When a player assigns a skill to their lix, the server relays this event to everybody else. The game calls high-level networking functions like "send assignment", "choose level", "send chat message".

I have written an abstraction layer that exposes these high-level functions. The abstraction layer sits between the game and enet, a C networking library. I get my hands dirty here, read from bare ubyte*, count precise lengths of data structures, cast data types around.

The networking layer is standalone: It doesn't include anything from the remaining game. Therefore, I can test the abstraction layer outside of the game.

How far am I: The abstraction layer has most features and is well-debugged. My next step is to write the lobby. The lobby will be a graphical user interface inside Lix, it will connect you to the server, offer a text field to chat, and buttons to choose colors and levels.

-- Simon
« Last Edit: October 04, 2017, 11:38:30 AM by Simon »

Offline NaOH

  • Posts: 191
    • View Profile
Re: I've begun networking in D Lix
« Reply #1 on: September 08, 2016, 02:30:09 AM »
Yayayay, multiplayer!

Some time ago, we were discussing lobbies and privilege levels. Being able to kick/force-observe inactive players would be very helpful. Did that conversation go anywhere?

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #2 on: September 08, 2016, 03:52:31 AM »
Several feature ideas float around:
  • Special privileges for a room owner.
  • Handicap. Force a spawn position on an unblanced map, start with fewer lix and skills.
  • Race mode, where it times your first save, or maybe your n-th save. The objective is to be fastest.
  • Survival mode, where there are no exits, and it times the death of your last lix. The objective is to outlive all opponents.
  • Avoid making too many special game modes. Clones had 5 or 6? I don't remember them all. The most important were Corral (normal game, save more than anyone else), Star Clone (save a neutral clone faster than anyone else), and CTF (bring the flag into your exit, but the clone who picks up the flag can't be assigned).
I'd like to look at them after the networking has the main features from C++ Lix: Desync-free, observer mode, and teams. Until then, the hack solution for missing room privileges is to start a fresh room.

-- Simon
« Last Edit: September 08, 2016, 04:20:52 AM by Simon »

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: I've begun networking in D Lix
« Reply #3 on: September 08, 2016, 06:27:14 AM »
Avoid making too many special game modes. Clones had 5 or 6? I don't remember them all.<snip>

For reference, the only other two Clones modes supported for MP (since Quantum Loop is strictly SP IIRC) is "Quantum Quarrel" which is basically a Worms-style kill-them-all (player with last alive clone wins) and "Multiverse Match" which is not "really" multiplayer--each player gets a copy of the otherwise basically SP map, and races to solve it the fastest (or save the most, I don't remember exactly), with no intended interactions between the copies (unless there are design errors in the level enabling such).

[edit: I just noticed "Quantum Quarrel" is exactly your "Survival mode" proposal :XD:]
« Last Edit: September 08, 2016, 06:51:40 AM by ccexplore »

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #4 on: September 08, 2016, 07:10:16 AM »
Cool, you have done so good on the rebuild of this.
Im starting my practicum next week, gonna be nice to have some free time again, I can be more vocal around here again im sure :)

Offline Proxima

  • Posts: 4562
    • View Profile
Re: I've begun networking in D Lix
« Reply #5 on: September 08, 2016, 11:20:42 AM »
"Multiverse Match" which is not "really" multiplayer--each player gets a copy of the otherwise basically SP map, and races to solve it the fastest (or save the most, I don't remember exactly), with no intended interactions between the copies (unless there are design errors in the level enabling such).

In C++ Lix, I made a 2P version of "Box Set" that works like that :lix-cool: It was great fun.

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #6 on: September 08, 2016, 02:29:32 PM »
An attack and Defense automatic mode would be cool.  When the first round ends, the game then prepares you for the reversed role game, instead of just doing the manual way.   
Final score between the rounds is displayed afterwards.

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #7 on: September 08, 2016, 02:42:43 PM »
For old times sake:  Here's some of our multiplayer replay videos in C++ Lix




Ghetto Wars (2v2 Team Match)
https://www.youtube.com/watch?v=Hhcv7InnP0M


Wise Decisions (5 player FFA)
https://www.youtube.com/watch?v=x7ye01tQJSM


NaOH's Arc (1v1 Attack & Defense)
https://www.youtube.com/watch?v=ASwAV8jnONw


Tower Defense 22934 (2v2 Team Match)
https://www.youtube.com/watch?v=H0I4IsRG6U8


The Safety Dance (4 Player FFA)
https://www.youtube.com/watch?v=MDnczhwEPL8

Offline Minim

  • Posts: 1724
    • View Profile
Re: I've begun networking in D Lix
« Reply #8 on: September 08, 2016, 03:43:37 PM »
Love those videos, and the music in them too! The 'NaOH's Arc' video is hilarious, especially how that poor green Lix was treated when trying to bash her way home. :D
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #9 on: September 08, 2016, 03:48:02 PM »
:D  Totally

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #10 on: September 21, 2016, 04:26:17 PM »


Chat works. Room switching works.

Level sending and receiving works in the command-line test client, but lacks GUI support entirely. I'll have to provide a level browser similar to the singleplayer browser, and display the received level.

Peer list doesn't yet display player colors. Starting games isn't implemented at all, neither in the GUI nor in the backend. There isn't anything exciting to test yet. :-)

-- Simon

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #11 on: November 07, 2016, 08:04:41 PM »


I wrote the multiplayer score graph. The large bar shows your score. The small bar shows your potential score, were you to save all your remaining lix, without stealing any.

The colors are autogenerated. Some shadings are too light, others too dark. But this bug is minor. I should focus on a minimal working networking game first.



This is the old bar graph from C++ Lix.

Proxima suggests to show player names during the game. With 4 or more people, the bar graph is already crowded. Maybe show a larger table on (mouse hovers over the small bar graph)? Maybe show the leading player in the info panel to the left?

-- Simon

Offline Proxima

  • Posts: 4562
    • View Profile
Re: I've begun networking in D Lix
« Reply #12 on: November 07, 2016, 09:25:43 PM »
Hmm, interesting question. It's not important to have player names continuously visible, it would just be nice to be able to check who's who, so probably best would be if mouseover made the names appear, or replaced the graph with a rectangle with a lix of each colour and the player's name underneath.

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #13 on: November 07, 2016, 10:08:57 PM »
Good start with the bar graph.
I think that maybe the name could be in black, unviewable, but as the bar starts moving over, it is 'lighting up' the name behind.  You'll soon see who each player is.

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #14 on: December 19, 2016, 11:21:35 AM »


Green squares measure github activity -- for me, most are commits to D Lix. Then I began speedrunning in September 2016. <_<

I'll bring along the desktop machine to my parents over the holidays. The internet there is too slow to stream video. I'll try to get back into Lix development. Maybe the networking mode is good enough for community testing in January.

-- Simon

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #15 on: December 19, 2016, 04:34:24 PM »
wow yea u did work a lot on it continously!

Offline NaOH

  • Posts: 191
    • View Profile
Re: I've begun networking in D Lix
« Reply #16 on: December 19, 2016, 05:51:09 PM »
Wow, that solid chunk between December and the end of March is really something. :lem-shocked:

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #17 on: December 29, 2016, 12:21:19 PM »


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

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #18 on: January 17, 2017, 05:30:08 AM »


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
« Last Edit: January 17, 2017, 05:46:00 AM by Simon »

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix
« Reply #19 on: January 18, 2017, 03:31:38 PM »
I really like the idea of keeping names out of view until you hover over it.  Much less clutter.

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #20 on: March 06, 2017, 03:43:13 PM »
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

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #21 on: March 10, 2017, 04:28:06 AM »
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

Offline RubiX

  • Posts: 430
  • Amiga <3 The memories
    • View Profile
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #22 on: March 11, 2017, 04:20:50 AM »
Might be at my sisters place, but if not i'll certainly hope to be able to test also.

Offline NaOH

  • Posts: 191
    • View Profile
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #23 on: March 13, 2017, 07:24:08 AM »
sure! :lix-smile:

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #24 on: March 13, 2017, 12:09:40 PM »
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).
« Last Edit: March 13, 2017, 03:54:36 PM by namida »
My Lemmings 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)

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #25 on: March 16, 2017, 12:10:01 AM »
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
« Last Edit: March 18, 2017, 09:20:19 AM by Simon »

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #26 on: March 16, 2017, 11:09:35 PM »
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 Lemmings 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)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #27 on: March 17, 2017, 12:35:07 AM »
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.

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix. First test on 2017-03-19
« Reply #28 on: March 17, 2017, 01:41:33 AM »
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
« Last Edit: March 18, 2017, 09:21:04 AM by Simon »

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: I've begun networking in D Lix
« Reply #29 on: March 20, 2017, 06:33:24 AM »
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

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: I've begun networking in D Lix
« Reply #30 on: March 20, 2017, 11:29:47 PM »
Agonizing, because I can't repro the bug for my life, yet it hits them both frequently.

Interesting, so no repro even when playing back a replay? (do those exists for multiplayer?)

If it hits them frequently, then at least it's easy enough to repro for them that maybe some strategic extra debug logging on a special build may help.  Good luck!