Skip to content
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

Server Browser Revamp #3933

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Fernando-A-Rocha
Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha commented Jan 8, 2025

Warning

Work in Progress

Context

Follow up of #3761

In preparation for #2104, #998 and #759

Details

This PR updates the ASE query response of type r (used for the ingame server browser) to now include up to 20 server "rules" (e.g. server description, tags, languages, etc) in a new query type QueryNewBrowser().

The method CQueryReceiver::GetServerResponse() was also changed to parse this new provided data.

These key-value pairs are now set in an unordered_map rules in SQueryInfo within CServerListItem::ParseQuery().

The client server browser can still parse old query data (without rules), so this doesn't "break backwards compatibility".

I am documenting the server rules that servers should set, to be displayed by the revamped server browser here:

https://wiki.multitheftauto.com/wiki/Server_Browser_Rules

Choices

Q: Why edit an ASE query type, and not just use the full query type to obtain ALL information?

A: The full query is not lightweight and responds with information that won't be used by the server browser.

Q: Why edit query type r and not create a new query type with a different letter like n?

A: That seemed unnecessary. If r isn't used anywhere other than the IG server browser, it's safe to modify it.

Q: Why not edit QueryLight() which was being used by the IG server browser?

A: In ASE.cpp I chose to not update QueryLight() because this is used in CMasterServerAnnouncer to post server data to MTA masterlist.

User Interface Revamp

Currently waiting on a Server Browser design proposal

Testing

Place these rules in mtaserver.conf. They are applied automatically on server boot. The ASE service sends them when queried.

<rule name="description" value="Custom cars and maps! Join various minigames from racing to drifting" />
<rule name="languages" value="en_US" />
<rule name="tags" value="freeroam, minigames, race, pvp, drifting" />
<rule name="website_url" value="https://example-website.com" />
<rule name="social_url_1" value="https://discord.com/invite/example" />
<rule name="social_url_2" value="https://youtube.com/@exampleChannel" />
<rule name="social_url_3" value="https://facebook.com/examplePage" />

Launch your server. Go ingame, open the server browser and find your server. Watch F8 console:

Important

These console messages are temporary, they are just for testing the features.

Parsing rules for server: Default MTA Server
  Rule: description = Custom cars and maps! Join various minigames from racing to drifting
  Rule: languages = en_US
  Rule: social_url_1 = https://discord.com/invite/example
  Rule: social_url_2 = https://youtube.com/@exampleChannel
  Rule: social_url_3 = https://facebook.com/examplePage
  Rule: tags = freeroam, minigames, race, pvp, drifting
  Rule: website_url = https://example-website.com
Finished parsing rules

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 8, 2025

Status

Waiting on Server browser UI design proposal

@T-MaxWiese-T
Copy link

T-MaxWiese-T commented Jan 8, 2025

Status

Waiting on Server browser UI design proposal

A design proposal:
Screenshot (11)
That would be the simplest and most straightforward design.
But you could go further and add the possibility to filter the languages and tags, for example by using comboboxes to select the language and the tag.
Regarding tags, I think they should be standardized, because individual things can already be written in the description or the server name.

@Fernando-A-Rocha
Copy link
Contributor Author

We should discuss the server browser design in the dev discord #main-menu-revamp

@derxgbb
Copy link

derxgbb commented Jan 8, 2025

wouldn't it be a better option in 2025 to make a new design of MTA menu guis with CEF? Of course not all at once, start with the server browser

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 8, 2025

wouldn't it be a better option in 2025 to make a new design of MTA menu guis with CEF? Of course not all at once, start with the server browser

Remake all MTA menus at once is a lot of work, it's best to change the menus 1 by 1 as they are separate.

Starting with the server browser, yes, it's better to remake it from scratch, and it is what I am working on right now.

As for the technology, I will stick to CEGUI coz it works and we can make modern UI with it if we try hard enough.

CEGUI update is coming soon, for better functionality.

CEF is not viable due to its buggy nature, being on DX9.

Other UI libraries could be viable, but nobody has added one yet. I don't see it happening in the near future. I'm not skilled enough to add one, nor do I see any interest from MTA Maintainers in making that happen. We can stick with the current libraries.

@derxgbb
Copy link

derxgbb commented Jan 8, 2025

My problem with CEGUI that you can't really change the font-size and it looks too outdated in 2025. People with bad eyes must use a lower (not native) resolution to play because tiny font-size is too small for them. Not to speak of higher resolution players whose menus are too tiny, there is no scaling at all.
That's why I said it would be the best to go with CEF as it gives these options.

About CEGUI update: I've seen that it has been already tried a few times but these PRs got abandoned after a while because of the complexity and much effort it takes to update, or replace (there was a PR to replace CEGUI)

@T-MaxWiese-T
Copy link

Starting with the server browser, yes, it's better to remake it from scratch, and it is what I am working on right now.

What exactly do you mean by "remake it from scratch"? What do you want to change?

CEGUI update is coming soon, for better functionality.

How do you know that? The author @Lpsd has said he is demotivated and hasn't updated his CEGUI branch in quite some time and since it's been dragging on for years, it doesn't look like anything is going to change.

@Fernando-A-Rocha
Copy link
Contributor Author

We can change CEGUI text size tho.. I can try make something that scales to your resolution.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 8, 2025

Starting with the server browser, yes, it's better to remake it from scratch, and it is what I am working on right now.

What exactly do you mean by "remake it from scratch"? What do you want to change?

The entire server browser UI. Make it modern, more adaptable to your resolution, and add features.

CEGUI update is coming soon, for better functionality.

How do you know that? The author @Lpsd has said he is demotivated and hasn't updated his CEGUI branch in quite some time and since it's been dragging on for years, it doesn't look like anything is going to change.

I am not certain it will happen. I just hope CEGUI gets updated, but it's not too important.

@derxgbb
Copy link

derxgbb commented Jan 8, 2025

The reason why most servers started and start to abandon CEGUI is the lack of customization and its awful look. You can create much better UIs with webdesign (that's also a reason why modern applications since 2014 are developed as a desktop webapp)

I don't want to order you or something, I just say my opinion. After all it is you who develop it and if your personal liking is to stick to CEGUI then we will stick to that.
Players might want a more modern fresh look of ui in MTA but we don't know how many of them.

Even if you can somehow change the fontsize and make it scale-able to higher resolutons that wouldn't solve the problem with ingame CEGUI elements.

CEGUI update is very unlikely to happen.

There are some downside of CEF as well with using a bit more memory than CEGUI. At some point CEF could be replaced with webview if possible

CEF is not viable due to its buggy nature, being on DX9.

I don't see this as a real problem, you can still create wonderful UIs with it, the CEGUI has way more problem

@G-Moris
Copy link
Contributor

G-Moris commented Jan 8, 2025

The reason why most servers started and start to abandon CEGUI is the lack of customization and its awful look. You can create much better UIs with webdesign (that's also a reason why modern applications since 2014 are developed as a desktop webapp)

I don't want to order you or something, I just say my opinion. After all it is you who develop it and if your personal liking is to stick to CEGUI then we will stick to that. Players might want a more modern fresh look of ui in MTA but we don't know how many of them.

Even if you can somehow change the fontsize and make it scale-able to higher resolutons that wouldn't solve the problem with ingame CEGUI elements.

CEGUI update is very unlikely to happen.

There are some downside of CEF as well with using a bit more memory than CEGUI. At some point CEF could be replaced with webview if possible

CEF is not viable due to its buggy nature, being on DX9.

I don't see this as a real problem, you can still create wonderful UIs with it, the CEGUI has way more problem

How long does the interface take to load on CEF?

@Dutchman101
Copy link
Member

Starting with the server browser, yes, it's better to remake it from scratch, and it is what I am working on right now.

Please be aware that this entire thing requires more than contributor discussion on dev discord. I'd advise against investing your time into it until the team sanctioned a re-design/your other work to modify server browser. Wherever this PR or your concept goes, it's not to be merged by anyone with write access, but a team member.

Few core/major presentation elements of the game are entirely team discretion. This includes server list.
Also, it must be made sure that toplist/age-acquired ranked servers won't be affected in their position or (mental) visibility and player attraction.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 13, 2025

I'll be on the lookout for messages of Team members regarding the design proposal on Discord. I won't move forward with any coding until one of you guys has made clear what is going to be expected and eventually accepted.

The code presented in this PR is a foundation that continues the work implemented by #3761.

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 13, 2025

Top list and other server ranking / automatic positioning won't disappear. It will be perfectly implementable in the new design which also features a horizontal list where servers can be ordered from top to bottom.

@Fernando-A-Rocha
Copy link
Contributor Author

The design I am talking about: https://discord.com/channels/801330706252038164/801403406845476864/1326988995284045876
(MTA Dev Discord #main-menu-revamp)
by @romancenoire

@THEGizmoOfficial
Copy link

The design I am talking about: https://discord.com/channels/801330706252038164/801403406845476864/1326988995284045876 (MTA Dev Discord #main-menu-revamp) by @romancenoire

I hope it will come to fruition because, to be honest, this proposal is brilliant and considering how old MTA is, it would be a good idea to modernize the graphic design a bit.

@derxgbb
Copy link

derxgbb commented Jan 14, 2025

maybe a pic on main discord could be shared so everyone could see the concept

@Fernando-A-Rocha
Copy link
Contributor Author

maybe a pic on main discord could be shared so everyone could see the concept

Actually, this is genius

@ MTA Staff

If you guys have difficulty choosing a final design, you could:
A. Post in main discord announcements asking what people prefer. E.g. a poll with different design proposals
B. Post the best design proposal there and ask if people like it the way it is or they would do something different. Maybe a Google forms is too much, it could be done within Discord as they now have surveys feature.

😄

@G-Moris
Copy link
Contributor

G-Moris commented Jan 14, 2025

The design I am talking about: https://discord.com/channels/801330706252038164/801403406845476864/1326988995284045876 (MTA Dev Discord #main-menu-revamp) by @romancenoire

I'm blocked in MTA Dev Discord, can you forward it here?

@Fernando-A-Rocha
Copy link
Contributor Author

Fernando-A-Rocha commented Jan 14, 2025

Lopsi has given some ideas on how to make this with CEGUI, using custom skin assets that will get loaded into the theme automatically, essentially expanding CEGUI!!
@romancenoire is making the necessary designs. He can post here once there is something new 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants