Skip to content

GUI Server List#2017

Draft
bagggage wants to merge 6 commits into
PixelGuys:masterfrom
bagggage:server-list
Draft

GUI Server List#2017
bagggage wants to merge 6 commits into
PixelGuys:masterfrom
bagggage:server-list

Conversation

@bagggage

@bagggage bagggage commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

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.

image_2025-10-15_16-35-38 image_2025-10-15_16-44-51 image_2025-10-15_16-42-27 image_2025-10-15_16-43-33

@bagggage bagggage force-pushed the server-list branch 2 times, most recently from 73c26e8 to 04d5756 Compare October 15, 2025 15:02
@copygirl

Copy link
Copy Markdown
Contributor

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?

@bagggage

Copy link
Copy Markdown
Contributor Author

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.

@IntegratedQuantum

Copy link
Copy Markdown
Member

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.

@ikabod-kee

Copy link
Copy Markdown
Collaborator

And of course, a direct connect option and option to hide the IPs

@bagggage

bagggage commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

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:

image image

If we go with windows, we could have two buttons in the menu, something like "Multiplayer" and "LAN":

image

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.

@IntegratedQuantum

Copy link
Copy Markdown
Member

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.

@bagggage

bagggage commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

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.

@bagggage

Copy link
Copy Markdown
Contributor Author

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:
image_2025-10-17_01-26-38

Play with Friends:
image_2025-10-17_01-26-56

image_2025-10-17_01-27-23

@BoySanic BoySanic moved this to WIP/not ready for review in PRs to review Nov 3, 2025
@IntegratedQuantum

Copy link
Copy Markdown
Member

What are the reasons to implement it with a selectable list, instead of using the same style as the save selection?

@SafeShows

Copy link
Copy Markdown

For the GUI why don't we do something like Factorio does?

image

but instead of having two browsers we just have one

image

And then have a place in settings where users can add the server registries for the server browser

@SafeShows

Copy link
Copy Markdown

So here's how it would look with the games UI style
MP menu

this is just a rough mockup

@tillpp

tillpp commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: WIP/not ready for review

Development

Successfully merging this pull request may close these issues.

Server List

7 participants