-
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.
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.