GUI Server List
Fixes #1992 (not yet, but will be).
At the moment, a client-side server list has been implemented, which is stored in server_list.zig.zon. The user can add and remove a server from the list via the GUI by opening the "Multiplayer" window from the main menu. To connect to a server, you need to select it from the list and press "Join". Currently, the user manually specifies the server's name and its address.
This approach can be changed and extended to add support for automatically fetching the server list from remote sources. It might also be worth implementing pinging of the servers in the list so that the user can assess the availability and quality of the connection to the server.
The not entirely obvious (?) text-prompt "Please send your IP to the host of the game and enter the host's IP below." and the display of the client's public IP address have been removed; now connection is initialized only in the join function (please let me know what this was needed for if it was indeed useful).
The GUI implementation depends on #2008 and #2016.
This looks to remove the ability to connect directly without adding an entry to this server list, is that correct? A direct connect option would still be nice.
The not entirely obvious (?) text-prompt "Please send your IP to the host of the game and enter the host's IP below." and the display of the client's public IP address have been removed
The purpose of this is to allow for NAT punch-through to work, without requiring port forwarding. It's a bit confusing and could need UX improvement, but it should not be removed.
Also, what about #1929 / #1933?
The purpose of this is to allow for NAT punch-through to work, without requiring port forwarding. It's a bit confusing and could need UX improvement, but it should not be removed.
Thank you for the explanation. I'll leave it as it was for now, and if there is a better way to handle this, I will do it later.
As for the direct connection by host address and the address obfuscation, I'm going to work on both of those. I will commit an updated version soon.
The purpose of this is to allow for NAT punch-through to work, without requiring port forwarding. It's a bit confusing and could need UX improvement, but it should not be removed.
I think we should have two separate windows, one for joining public servers and one for playing with friends.
And of course, a direct connect option and option to hide the IPs
I think we should have two separate windows, one for joining public servers and one for playing with friends.
For a while, I've been trying to figure out the best way to handle these two separate windows. The most suitable approach for me seems to be using two tabs, but... we don't have tabs. So, I created "tabs" using buttons:
If we go with windows, we could have two buttons in the menu, something like "Multiplayer" and "LAN":
But in fact, the name "LAN" isn't quite accurate, since we're not talking about a local network, but about playing with friends. And "Multiplayer" is too broad - it essentially includes playing with friends as well. So, we need more appropriate names, and then I think it will be just right.
If we go with windows, we could have two buttons in the menu, something like "Multiplayer" and "LAN":
I think that's easier. Using tabs makes the window more cluttered.
I would call them Join a Server and Play with Friends
Another option would also be to make a submenu. This could also allow for other far future options like playing via steam or discord APIs instead of sharing the IP manually.
Another option would also be to make a submenu.
I thought about that too, but it would add an extra level of nesting, and the user would have to click through several windows every time before he can connect.
I think a good solution would be to have two separate windows. Features like playing via Steam or Discord could then be added inside the "Play with Friends" window, where we could implement buttons that, for example, open a friends list from Steam or something similar.
Almost done. I've implemented two separate windows and added obfuscation #2029, but it needs refinement – a corresponding "streamer mode" should be added and made toggleable via settings. Also, the addresses in the "Invite Players" window available to the host need to be hidden.
For now, I've moved the server connection logic from the window code into main.game (but if a better place is found for it, I'd be happy to hear suggestions) so it's accessible to all windows and isn't duplicated. Some code and commit history cleanup is still needed, but the history is currently necessary for quick testing cycles of different options to allow rollbacks, so I'll handle that later, at least once the other dependent PRs are resolved: #2008, #2016, #2029.
Join a Server:
Play with Friends:
What are the reasons to implement it with a selectable list, instead of using the same style as the save selection?
For the GUI why don't we do something like Factorio does?
but instead of having two browsers we just have one
And then have a place in settings where users can add the server registries for the server browser
So here's how it would look with the games UI style
this is just a rough mockup
For the GUI why don't we do something like Factorio does?
lol, factorio was the origin of the "everything is a window" idea in the first place xD