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 support for server-side skins #7297

Open
Kaffeine opened this issue Oct 4, 2023 · 4 comments
Open

Mod Support: Add support for server-side skins #7297

Kaffeine opened this issue Oct 4, 2023 · 4 comments
Labels
enhancement Provides an enhancement to the game. meta-discussion Discussion about the project itself, direction, (code) design, etc network Network related.

Comments

@Kaffeine
Copy link
Contributor

Kaffeine commented Oct 4, 2023

Some mods (e.g. ZOMB, War3, and Infclass) would benefit from custom skins supplied by the server (the mods already have their own skins but the players have to download them separately).

It is typical for other games (e.g. Team Fortress) to use different skins (and models) to distinguish player classes. The same is wanted for DDNet so a mod can set certain skin to a character and the players can see what the class is (e.g. medic, engineer, or maybe small zombie, armored zombie, etc).

heinrich5991 commented Aug 21, 2023
Perhaps we could make the client accept skin files from the server?

@Kaffeine Kaffeine changed the title Mod Support: Add server-side skins Mod Support: Add support for server-side skins Oct 4, 2023
@heinrich5991
Copy link
Member

Sounds good.

Particular questions for the protocol: How do we communicate server-side skins? How do they work with demos?

@VoxelDoesCode
Copy link
Contributor

VoxelDoesCode commented Oct 4, 2023

I guess they would be stored alongside the map info? Not sure how this would effect the file size.

@Kaffeine
Copy link
Contributor Author

Kaffeine commented Oct 4, 2023

How do they work with demos?

That is a good question but probably it is not a blocker (as we don't save custom skins in the demos right now).

I see a some options and tend to prefer the one which needs less code. To name a few:

Option 1

Make it possible for a game server to be a preferred alternative source for the skins (along with DDNet Skin database) and use the skins 'normally' (IOW just by name).
What we'd need to do is to use a generic assets download protocol to download the skin to $USERDIR/skins. Probably we'd also have to add GameInfo flag such as SERVER_SIDE_SKINS to announce the skins support AND make it clear that the mod needs more than just vanilla skins (to also solve this issue).

Pros:

  • Easier than other options

Cons:

  • Different mods can use the same name for different skins, leading to wrong/confusion character appearance

Option 2

  1. Add an extra field for the skin to DDNetPlayer or some new DDNetClientInfo if you'd say it fits better.
  2. The field should contain a hash id (probably sha256) of the skin asset.
  3. Then maybe that generic assets download protocol 'll accept asset SHA256 to download any type of assets, and it would be the client responsibility to put it into the correct directory.

Pros:

  • No skin name collisions / confusion
  • Clear indication that the skin should be downloaded from the game server rather than from Skin Database
  • That indication also can be used to save the custom skins in demos

Cons:

  • More code
  • We'd need to do something to also support UHQ skins

@VoxelDoesCode
Copy link
Contributor

I mean there's a possibility for sha256 support (As hinted in #5654), so once that goes through we could borrow some code from the sha256 code in that for general server images?

@Robyt3 Robyt3 added enhancement Provides an enhancement to the game. network Network related. meta-discussion Discussion about the project itself, direction, (code) design, etc labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Provides an enhancement to the game. meta-discussion Discussion about the project itself, direction, (code) design, etc network Network related.
Projects
None yet
Development

No branches or pull requests

4 participants