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

playermodels: Unique Playermodels at round start #1487

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

Conversation

Exonen2
Copy link

@Exonen2 Exonen2 commented Mar 20, 2024

At Round Start, if the option is activated, each player gets assigned a different playermodel from the pool.

Every Player gets a different model assigned at round start.
En Label added for unique model
De Label added for unique model
just fixed a short error on my side
fixed the spaces...
@TimGoll
Copy link
Member

TimGoll commented Mar 21, 2024

You know that this is already a thing in TTT2? :D

@Exonen2
Copy link
Author

Exonen2 commented Mar 21, 2024

You know that this is already a thing in TTT2? :D

Huh? Maybe I am blind lol...

Doesn't the current "model_per_Round" assign the same model to everyone at round start?

The Changes im proposing is that at round start everyone gets assigned a different model.

@TimGoll
Copy link
Member

TimGoll commented Mar 21, 2024

Oh sorry, then nevermind! I'll review it later today, thank you

Fixed the Inconsistent use of tabs and spaces for indentation and  Trailing whitespaces
@Histalek Histalek added the type/enhancement Enhancement or simple change to existing functionality label Mar 27, 2024
Copy link
Member

@TimGoll TimGoll left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, it kind of got lost in my todo list.

I'd like to change this a bit. Your implementation now results in three modes:

  • random identical playermodel on map chanage
  • random identical playermodel on round change
  • random unique playermodel on round change

Imho it would be better to keep the two old modes as is (new model assignment on round or map change) and just modify your convar so it affects both modes. If your convar is enabled, a random unique player model is selected no matter the selection mode.

Does that make sense to you? I think this would be better and cleaner.

gamemodes/terrortown/gamemode/server/sv_main.lua Outdated Show resolved Hide resolved
@Exonen2
Copy link
Author

Exonen2 commented Apr 9, 2024

Sorry for the late review, it kind of got lost in my todo list.

I'd like to change this a bit. Your implementation now results in three modes:

  • random identical playermodel on map chanage
  • random identical playermodel on round change
  • random unique playermodel on round change

Imho it would be better to keep the two old modes as is (new model assignment on round or map change) and just modify your convar so it affects both modes. If your convar is enabled, a random unique player model is selected no matter the selection mode.

Does that make sense to you? I think this would be better and cleaner.

I was sadly quite busy the last 2 weeks but should be able to get to it soon.
But I think I get the gist of what you are saying.

@TimGoll
Copy link
Member

TimGoll commented Apr 9, 2024

No worries, I'm out of town as well. The proposed changes should probably be pretty easy for you

@TimGoll
Copy link
Member

TimGoll commented Jun 2, 2024

Maybe someone else takes a look at this as I reworked this a lot compared to the initial PR

Copy link
Member

@Histalek Histalek left a comment

Choose a reason for hiding this comment

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

What exactly is the goal of this change?

  • diversify the selectable playermodels. So that not everyone looks the same (but allow duplicates)
  • give a hard guarantee that any two players won't have the same model. So that you can instantly recognize a specific player (besides identity-swapper shenanigans etc.)

Because currently the implementation does the former and the settings implies the latter.
We need to consolidate this

Comment on lines +961 to +973
if cvSelectUniqueModelPerPlayer:GetBool() then
local plys = player.GetAll()
for i = 1, #plys do
plys[i].defaultModel = playermodels.GetRandomPlayerModel()
end
else
local plys = player.GetAll()
for i = 1, #plys do
plys[i].defaultModel = nil
end

self.playermodel = playermodels.GetRandomPlayerModel()
end
Copy link
Member

Choose a reason for hiding this comment

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

@TimGoll
Can we find out what addons etc. write to .defaultModel? Because until now we (ttt2) never wrote to it and only read it.

If we start writing to and even resetting(!) it that might be a problem. Even more so now that the default behaviour is changed here.

Don't get me wrong this could all be completely fine, but i have no idea where any value for .defaultModel would have come from. Certainly not from ttt2

Copy link
Member

Choose a reason for hiding this comment

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

I had the same thoughts, however I'm unable to find any use of that variable in our whole code base. My test server also has loads of addons and I didn't encounter any issues. My suspicion is that this is a very old part of the code that is no longer used. But I could also introduce a new variable for that.

Copy link
Member

Choose a reason for hiding this comment

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

.defaultModel is used twice in our codebase.

First occurrence in plymeta:SetModel(mdlName) as a fallback if the given mdlName is not a valid model.

Second occurrence which calls the function in the first occurrence with ply.defaultModel or GAMEMODE.playermodel. Which is somewhat stupid in itself ...

If we can reasonably believe that this does not break playermodelselector addons i'm fine with merging this. streamlining the playermodel handling can come later.

Copy link
Member

Choose a reason for hiding this comment

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

I meant that it is set nowhere. But you are right. I might ask some EPMS users on discord to test this branch

Copy link
Member

Choose a reason for hiding this comment

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

image

seems to work

@TimGoll
Copy link
Member

TimGoll commented Jun 4, 2024

What exactly is the goal of this change?

The former. I guess the wording in the UI is then a bit unfitting. Unique models are more complex and are probably not worth it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement or simple change to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants