Skip to content

Add bot skin generation #3019

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

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

Conversation

Wall-core
Copy link
Contributor

Adds proper bot skin generation.

@gajet5
Copy link
Contributor

gajet5 commented Apr 24, 2025

I think this way is easier.
#3010

@Wall-core
Copy link
Contributor Author

that loop is unchecked and can theoretically loop infinitely. the best way to do it would be accessing CharSections dbc data from the cache but this is straightforward and does the job just as well.

@gajet5
Copy link
Contributor

gajet5 commented Apr 25, 2025

I'm sorry, but how can this loop be unchecked?

It uses the verification function.

bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create /*=false*/)

This verification function is used when creating a character.

How can this cycle run indefinitely?

@Wall-core
Copy link
Contributor Author

it randomly rolls a skin, attempts to validate it, and if it's not valid it re-runs the loop. it could fail to roll a valid skin infinitely, in theory.

@gajet5
Copy link
Contributor

gajet5 commented Apr 25, 2025

It sounds almost impossible.
The chance that the combination will be incorrect is small, only 1-2 values per certain race.
The cycle will run no more than 10 times.
This can be ignored.

@Wall-core
Copy link
Contributor Author

using a loop here isn't clean, it's unnecessary cycles when the data is static and can be hardcoded or pulled from the DBC storage. And there should never be any potential for infinite loops. Non-deterministic behavior leads to crashes.

@gajet5
Copy link
Contributor

gajet5 commented Apr 25, 2025

Well, that's your right to think so.
I don't see anything wrong with reducing the amount of code.

@Wall-core
Copy link
Contributor Author

Well, if you're interested in being the one to fix this issue, then you should look at how DBC data is stored. All the valid combinations exist already but aren't currently accessed by the bot generator. Write a function that does this and PR it so I can close mine.

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.

2 participants