-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework the matchmaker lobby (autolobby) #6479
Conversation
Are there any mods that might affect lobby in a way that needs special considerations / testing? |
A UI mod does not work/apply during the lobby. The only thing that can adjust the lobby are featured mods. That would be co-op and Nomads. But neither of them touch the autolobby file 😄 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new design for the autolobby overall. Getting the communication stuff out of the way paves a way for an easier time making improvements like the ones in kyro's lobby that people were a fan of before we unfortunately had to disable it.
By the way remember to use the ReusedLayoutFor
.
`AutolobbyMessages.lua` now document what messages exist and how/when they are accepted. To prevent too much coupling with the controller we simplified the handler to just be a wrapper to a function inside the lobby.
When running locally the peer Ids line up nicely. However, in practice the peerIds can be all over the place and can not be easily mapped to a number. Therefore we manually keep track of them and map them to a number so that we can visualize it.
This prevents all connections being established at roughly the same time.
This reverts commit 92ab7f4.
It requires more testing. Eventually it should likely be the host that informs a client to rejoin.
Some text I wrote on Discord about this pull request: It is a connection matrix. Supreme Commander is peer-to-peer. Given that Supreme Commander is peer-to-peer it means every player needs a connection to every other player. The matrix represents that. The matrix is asynchronous - which is a difficult topic - but at its core the matrix can be different for all players. Diagonal of the matrixThe diagonal represents the status of each player (anomynous). The status is local to that player and it is made visual via a color:
I decided not to ship with the purple status because it was too experimental. Hopefully in the near future though the rejoin functionality can fix lobbies being 'stuck' and not launching at all. The issue is very similar to people rejoining in a custom lobby - sometimes two players just don't connect and by rejoining it is fixed. The purple status would be the same, but then programmatically. The diagonal also blinks occasionally. That means the local client received a message from that particular client. Usually this is the launch status being broadcasted to all clients. Note that one entry on the diagonal never blinks: that's the local client (you!) Everything but the diagonalEverything but the diagonal indicates whether the local client is aware of the player on the X axis to have a connection to the player on the Y axis. In its core its shows you who is connected to who. If it's dark grey, two players are not yet connected. If it brightens up then they are connected. If an entire row/column suddenly turns grey again it means a player likely left, especially if the status is not 'purple'. What is its purpose?For the average user it is just something that blinks. You can decipher whether the game may or may not connect. It is to be expanded on. It wasn't supposed to be the only thing visible, in the proof of concept there was also a preview of the map. See also #6479 for more details. However, for the developer it is very useful. It shows the internal status of the lobby. And because of that it helps a great deal with understanding what is going on while testing. The new data can also be used to better decipher who's being a bad actor when the game does not start. For that, see also #1028. That way we have a better metric to punish (time out) a player that is constantly failing to join the lobby. In general the matchmaker lobby has been worked up from the ground up to make it more maintainable. We can now actually add and extend features. It's flexible setup even allows us to support new type of queues in the future, such as an AI vs Human queue. There's much more work involved to that then just the in-game lobby, but it at least won't be a deal breaker either :slight_smile: . |
Description of the proposed changes
Reworks the matchmaker lobby from the bottom up with a focus on documentation and a better maintainable code structure. Introduces a similar setup to the MVC pattern. The pattern is simplified. This is an automated lobby and therefore the view never has to communicate back to the controller.
Controller/Model
See also:
lua\ui\lobby\autolobby\AutolobbyController.lua
lua\ui\lobby\autolobby\AutolobbyMessageHandlers.lua
Is responsible for the functionality of the matchmaker lobby. This involves creating the initial state and syncing this state between players.
View (interface)
See also:
lua\ui\lobby\autolobby\AutolobbyMapPreview.lua
lua\ui\lobby\autolobby\AutolobbyInterface.lua
Responsible for the interface of the user. Note that the interface has support for a basic version of hot reload. You can make changes to the interface and it will try to re-initialize in real time. There is no need to restart the application.
The map preview is created from the ground up too with performance (allocations) in mind.
Testing done on the proposed changes
With thanks to the script made by @lL1l1 in #6474 you can run the changes locally and inspect the result. The game launches. The host shares the settings. And once everyone is connected we launch the game.
Rejoin functionality at 1482163
autolobby-08.mp4
d41177b
autolobby-06.mp4
320f9f4
autolobby.mp4
Additional context
The interface of the matchmaker lobby has support for a basic 'hot reload' functionality. Assuming that you programmatically blocked the launch you can make changes to the interface, save the file, and the game will automatically try to re-initialize the interface. There's a snippet of comments for at the top of
lua\ui\lobby\autolobby\AutolobbyInterface.lua
that explains in more detail about how it works.Checklist
Issues
Resolved with: e9670d3
Resolved with: 5823e21
Existing features
MakeValidPlayerName
)GpgNetSend
in the old autolobby. In paritcular theLaunchStatus
,GameState
,Disconnected
andPlayerOption
keys that are sent.New features
New features to be discussed
Cancelled features
PreGamedata
as defined in the regular lobby.We either have this feature, or prefetching. We can't have both. Since you can not choose your UI mods regardless, it is probably best to just use whatever is in the prefs file at that moment and use prefetching instead.