iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://github.com/ddnet/ddnet/pull/9284
Clean up nameplates by SollyBunny · Pull Request #9284 · ddnet/ddnet · GitHub
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

Clean up nameplates #9284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

SollyBunny
Copy link
Contributor

@SollyBunny SollyBunny commented Nov 26, 2024

Checklist

  • Tested the change ingame
  • Provided screenshots if it is a visual change
  • Tested in combination with possibly related configuration options
  • Written a unit test (especially base/) or added coverage to integration test
  • Considered possible null pointers and out of bounds array indexing
  • Changed no physics that affect existing maps
  • Tested the change with ASan+UBSan or valgrind's memcheck (optional)

Stuff changed

  • Combine friend icon, id and name onto single line
  • Combine hook strength icon and id onto single line
  • Allow nameplate sizes to go to -50 (0 is too big)
  • Moved scoreboard config from nameplates to HUD
  • Added headers for strength indicator and directions, they now show regardless of nameplate on/off
  • Seperated nameplate options unaffected by "Show nameplates" into other headers

Screenshots

image

image

image

@SollyBunny
Copy link
Contributor Author

SollyBunny commented Nov 26, 2024

Holdon, don't look yet
I can't fix the transparency not being set correctly on outlines for TextRender()->Text()

src/base/system.cpp Fixed Show resolved Hide resolved
@SollyBunny SollyBunny force-pushed the nameplate_fixes branch 3 times, most recently from ff9c74c to 27129e9 Compare November 26, 2024 20:09
src/base/system.cpp Fixed Show resolved Hide resolved
src/base/system.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@furo321 furo321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combine hook strength icon and id onto single line, now uses clan size

This should not be scaled by the clan size, that's just confusing.

Allow nameplate size to go to -50 (0 is too big)

This feels really niche, I don't think that 0 is too big. I tried -50 and the nameplates are microscopic.

src/engine/shared/config_variables.h Outdated Show resolved Hide resolved
datasrc/content.py Show resolved Hide resolved
@@ -35,6 +35,8 @@ struct SPlayerNamePlate
char m_aClan[MAX_CLAN_LENGTH];
STextContainerIndex m_ClanTextContainerIndex;
float m_ClanTextFontSize;

float m_Zoom, m_ZoomClan;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, the goal is that the text is supposed to look "high quality" while zoomed in? I tried zooming a bit in game and the text quality is changing back and forth while doing it, which looks super weird and leads to lag spikes on low zooms.

It will also become desynced if you use zoom.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was laggy when I made it scale by the zoom level, but when I changed it to the target zoom it stopped being laggy. I think this should be a thing, but the current implementation must, from your experience, be wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this and now everything is rendered at the same zoom level. I don't like it but atleast its consistent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks a lot better.

@SollyBunny
Copy link
Contributor Author

@furo321

[Hook strength] should not be scaled by the clan size, that's just confusing.

Other than making a new variable to control it, I didn't know what else to use. Since it appears above the clan using the name size looked off, and I wanted it to scale rather than it being as big as it was

[0 to -50 nameplate sizes] feels really niche, I don't think that 0 is too small. I tried -50 and the nameplates are microscopic.

Me and someone in the TClient server wanted to have smaller nameplates, I thought why not let it be microscopic since 1. it's still visible 2. why not let the user do it, its kinda funny 3. the change is visible in the preview

@furo321
Copy link
Contributor

furo321 commented Nov 27, 2024

Other than making a new variable to control it, I didn't know what else to use. Since it appears above the clan using the name size looked off, and I wanted it to scale rather than it being as big as it was

Then make a new variable. Using the clan size variable is confusing due to the name of it, and clan visibility is also optional.

src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.h Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
@SollyBunny SollyBunny force-pushed the nameplate_fixes branch 2 times, most recently from 070d0bf to c3ca2b4 Compare November 27, 2024 23:31
Copy link
Contributor

@furo321 furo321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently name plates are always rendered for yourself, which should only be the case if cl_nameplates_own is enabled.

MACRO_CONFIG_INT(ClNameplatesOwn, cl_nameplates_own, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show own name plate (useful for demo recording)")
MACRO_CONFIG_INT(ClNameplatesFriendMark, cl_nameplates_friendmark, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show friend mark (♥) in name plates")
MACRO_CONFIG_INT(ClNameplatesStrong, cl_nameplates_strong, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show strong/weak in name plates (0 - off, 1 - icons, 2 - icons + numbers)")
MACRO_CONFIG_INT(ClNameplatesStrongSize, cl_nameplates_strong_size, 30, -50, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Size of strong/weak state icons and numbers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value should be 50, to match the old default size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default size is too large since normally you are only looking at if it's green or red

src/engine/client/client.cpp Outdated Show resolved Hide resolved
src/game/client/components/controls.cpp Outdated Show resolved Hide resolved
src/game/client/components/menus_settings.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.h Outdated Show resolved Hide resolved
src/game/client/components/nameplates.h Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
if(OtherTeam)
Data.Alpha *= (float)g_Config.m_ClShowOthersAlpha / 100.0f;
}
// if (Data.Alpha <= 0.05f) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I meant to uncomment that and then also ask you about this.
It will attempt to render nameplates which are fully transparent which is a waste of time. I didn't know if I should just do == 0.0f or have a threshold

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The textrender already skips rendering transparent quads so I think this is unnecessary optimization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it does alot of work other than rendering

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compile in release mode and do some benchmarks if you think it matters.

src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved
src/game/client/components/nameplates.cpp Outdated Show resolved Hide resolved

void CNameplates::RenderNameplate(SNameplate &NamePlate, SRenderNameplatedata Data)
{
// if (Data.Alpha <= 0.05f) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

@SollyBunny SollyBunny force-pushed the nameplate_fixes branch 8 times, most recently from 1c3f5de to b7cb166 Compare November 30, 2024 13:51
Copy link
Member

@Robyt3 Robyt3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we render the preview nameplates at the same size as the ingame nameplates? Looks like the preview nameplates are larger than the ingame nameplates, probably because the ingame screen size is different than the UI screen size.

screenshot_2024-11-30_20-10-57

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.

4 participants