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

Mod Support: Add a way for the server to know the skin-related client options #7055

Closed
Kaffeine opened this issue Aug 21, 2023 · 3 comments
Closed
Labels
needs-discussion Requires a discussion before implementing/closing the issue/feature.

Comments

@Kaffeine
Copy link
Contributor

Kaffeine commented Aug 21, 2023

Hi devs. I maintain a mod with player classes and the mod uses skins and colors to distinguish them. Maybe you've heard about Left 4 Dead or Team Fortress games; the mod I'm doing also has some Smoker, Spider, Boomer as well as Engineer, Soldier, Sniper classes (22 in total).

The set of available skins is a huge limiting factor, and right now the mod uses only standard teeworlds skins and nothing else, because if a skin is disabled, the fallback to default skin would ruin the gameplay.

If the server could know whether the client has 'Vanilla skins only' option ON, it can snap the most suitable skins.

E.g. for "vanilla only" and non-ddnet clients the game uses this skin for Ghost class.

image

For my custom infclass client it uses ghost skin by whis (ghost can be "invisible" and in that case I render it semitransparent, which has an issue with alpha blending but meh, it is better than nothing).

image

It is so unfortunate that I can't enable ghost skin for ghost classes for ddnet, because there is a number of players with that "vanilla skins only" option checked on.

I'm proposing to add some ClientPreferences (somehow similar to ServerCapabilities but those are not "Capabilities" in the strong sense) with version and flags. Something like that:

void CClient::SendPreferences(int Conn)
{
	CMsgPacker Msg(NETMSG_CLIENT_PREFERENCES, true);
	Msg.AddInt(CLIENTPREF_CURVERSION);
	int Flags = 0;
	if(Config()->m_ClVanillaSkinsOnly)
	{
		Flags |= CLIENTPREFFLAG_VANILLA_SKINS_ONLY;
	}
	Msg.AddInt(Flags);
	SendMsg(Conn, &Msg, MSGFLAG_VITAL);
}

I'd also like to have the client preferred language (can be null) here in ClientPreferences but it is a different topic.

@heinrich5991
Copy link
Member

It seems to me that inferring which skins are available is brittle. Perhaps we could make the client accept skin files from the server? Maybe only fallback skin files?

@Kaffeine
Copy link
Contributor Author

Server side skins would be an awesome superior solution. The only drawback is that I have no idea how to implement it.

@heinrich5991 heinrich5991 added the needs-discussion Requires a discussion before implementing/closing the issue/feature. label Aug 23, 2023
@Kaffeine Kaffeine changed the title ModSupport: Add a way for the server to know the skin-related client options Mod Support: Add a way for the server to know the skin-related client options Sep 5, 2023
@Kaffeine
Copy link
Contributor Author

Kaffeine commented Oct 4, 2023

Closed in favor of #7297 (server-side skins)

@Kaffeine Kaffeine closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion Requires a discussion before implementing/closing the issue/feature.
Projects
None yet
Development

No branches or pull requests

2 participants