Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
479 stars 77 forks source link

Player avatars #798

Open Flamefire opened 6 years ago

Flamefire commented 6 years ago

The original had avatars for each nation. We still display them at the statistics screen but use the same for every player of the same nation. We could make the choice completely free by adding it to the match-making screen and not tie it to a nation at all.

Do we want that? How could the UI look like? (space is rather limited for an image)

Ccing @Spikeone (maybe you have an idea)

KaioKen-J commented 6 years ago

Even tho this isnt necessary, it would be a neat addition. Space does look very limited sadly, maybe if you shorten each tile a bit, especialy the playername one, you could squeeze in the picture like shown here? https://i.imgur.com/rlhBsgH.png

If not at least make the roman player play as Octavianus and not Brutus ^^

Flow86 commented 6 years ago

we could even integrate the player avatars from the website (lobby only)

Flamefire commented 6 years ago

Possible. But that means getting data from the website. I don't think that would be wise as it greatly complicates things. Then rather read a custom avatar from an image in the players folder.

Spikeone commented 6 years ago

Well, also ingame avatars are quite nice for pacts and stuff. You can see them ingame in any statistics window and maybe when using diplomacy. I don't think one should use them for the lobby as there is no benefit in my opinion.

Spikeone commented 6 years ago

also see #125 - still closing the old ticket as it is in german.

Flow86 commented 4 years ago

we can get the user avatar only for lobby players. if one is cached locally then, use it for the rest of the games too? if none is available, use one of the default S2 ones (perhaps random?)

Spikeone commented 4 years ago

@Flow86 @Flamefire Not really sure what you mean by "cached locally" but we could add it next to the name option in the options screen. We could also add a for example CUSTOM_PLAYER.png which everyone could edit for themselves, sending it to other players could be done by naming it with it's hash or something like that (maybe thats the cache you mean).

Flow86 commented 4 years ago

Yes: show it on settings:

Then we need to implement it to compress & transfer it to all players on a multiplayer game. Also cache them perhaps so we don't need to retransfer them every time (i.e hash username+mod-date, etc)

updating the board avatar from inside the game should not be supported.

theBasstian commented 3 years ago

How about a SetAvatar() ? Would it be that complicated ? I could really get use of that for specific characters in story-driven missions ...

Spikeone commented 3 years ago

@theBasstian guess you are talking about this one: #1181

tehKaiN commented 2 years ago

I'm willing to give this one a try - is there consensus on how this thing should work? I've hacked together ability to select portrait index 0-2 from those corresponding to currently selected nation, but now I've discovered this issue and I see an idea that selecting avatar could be unconstrained by nation and/or to add ability for getting avatars from the website (perhaps from gravatar service?).

I'd advise starting small - either scrapping online avatars completely, or expose a field in BasePlayerInfo which accepts e-mail/url for avatar, with ability to write specially-formatted string which allows using builtin ones (e.g. local:vikings-2 for viking no. 2). This would provide room for growth for nation-specific avatar, as well as allow implementing SetPortrait lua fn so that it accepts 2 parameters - nation type and image index.

Also, I think that using online avatars only for lobby would be confusing, because in-game statistics window would use completely different ones. Consistency is better because one can memorize portrait-nickname relations in lobby, and then properly identify players on stats screen.

Spikeone commented 2 years ago

For now I'm not sure if players do really care about their avatars, do they? At least not in multiplayer.

For me this is more like a singleplayer setting (and thus the LUA function is required).

But adding this might be as simple as allowing the player to set his preferred avatar for each nation in the settings menu? Since I agree we don't need any fancy stuff that requires lots of efforts to implement but have little impact :)

tehKaiN commented 2 years ago

I'm fiddling around with lobby layout, it's a tight fit but I've managed to put it in (please don't mind the yellow text above mismatching the columns):

obraz

The portrait works like button and I guess clicking it will cycle through portraits. The problem is that each row has height of 30px, whereas the original image is 34x47px. There are 3 options here:

  1. resize images to 30px in height - this will probably butcher the pixel art, so I'd rather not do it.
  2. crop image vertically, so that only face part of portrait is visible - something like removing 5 lines from top and 12 from the bottom, or something like that. The margins would have to be configurable per-portrait, I think. Results in something like this: obraz. Removing background would be nice to keep things clean, but I guess it's a bit problematic because it's basically shipping part of original assets with the engine.
  3. resize rows to accommodate portraits nicely - this would need finding 17 * 8 = 115px of vertical space, considering 8-player limit. We can move chat a little bit downward and gain something like 60px, but we'd still need to reduce its size, which is kinda deal-breaking, I think.

So I think that the option 2. is most viable. Or perhaps you can come up with other ideas?

I'm still on the fence whether to make the portraits nation-specific or not. Limiting per-nation makes sense visually, because you having a Nubian chief run Roman colony is a bit odd, but then if there are 8 ppl who play romans, it'd be good to have 8 different portraits.

Spikeone commented 2 years ago

In my opinion it's a bit tedious to always set the portrait when starting the game - so I quite liked the idea of having a way to predefine it in the config.

Other than that, I don't think we need a preview of avatar in the hostscreen - it provides no information at all. Only the player himself should see his own portrait so he can change it (if you still want to implement it here instead of an option). For AIs/Dummies the portrait should be simply randomized. No need to set them at all. This way, you'd only need to change the local players row in the host screen, enlarging it (but beware of player swaps etc.).

Another option would be adding a button/dropdown to select the graphic for yourself and still not showing the portrait here.

So in conclusion, I'd not show a portrait here (simply because we don't have the space), give players either the ability to preconfigure their portraits (I personally prefer that way). If you dislike preconfiguring the portrait in the options, I'd rather go for a dropdown or something alike and still not show the portrait here.

Also keep in mind, that we currently kinda support 8 players (not 6) and did plan to allow 16 players :)

tehKaiN commented 2 years ago

I think there's a bit of value to gain if we still have them selectable in lobby. Of course we can add it to settings so that it's automatically preselected each game, but assuming netplay, some ppl can join with same avatars. This seems like a no big deal, but I think being able to change avatars to unique ones just before game starts has its own merits. My understanding is that Statistics window discerns players mainly by avatars and a small colored rectangle beneath them - I think having them unique there is better than just unique colors.

Also:

Only the player himself should see his own portrait so he can change it

The problem with this is that you can't see if other ppl have same avatar as you, so you can't deduplicate or intentionally reorder (same nation-themed portraits for same teams and other funky stuff) it at this point.

I'm not great UX designer though, so lemme know what is your final word on it and I'll just do it that way. ;)

tehKaiN commented 2 years ago

Getting there...

portrait_selection

Options will allow selecting default portrait and I'll try to squeeze in portrait selection in lobby for deduplication purposes. If small buttons with portrait fragments will look bad, I'll scrap them completely.

tehKaiN commented 2 years ago

I've added preliminary support for bitmap trimming inside image-based button. Does it look acceptable?

obraz

Flow86 commented 2 years ago

screenshot lgtm