I've begun networking in D Lix

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

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

NaOH

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?

Simon

#2
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

ccexplore

#3
Quote from: Simon on September 08, 2016, 03:52:31 AMAvoid 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:]

RubiX

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 :)

Proxima

Quote from: ccexplore on September 08, 2016, 06:27:14 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.

RubiX

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.

RubiX

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

Minim

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

RubiX


Simon



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

Simon



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

Proxima

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.

RubiX

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.

Simon



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