-
Notifications
You must be signed in to change notification settings - Fork 34
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
[BUG] Wrong ethnicities assigned #226
Comments
Same problem, half my youth intake is white Nigerians, effectively breaks the entire program. |
I have written the code to fix the issue, does someone want it? (It's not compiled into a program, you have to run it from the console) |
I'm seeing this issue too - it would be great to get this fixed. Don't think it will change in any following update to FM until at least FM25 |
@Maradonna90 @Ayal1 Just want to check if there's a possibility for a fix to this? |
If you know how to compile the source code into the exe file, I could create it, but I have no knowledge of this myself. My version works well when started from a console. |
Seeing the same. It's definitely the most recent FM patch. The same behaviour occurs in FMRTE. |
@6ellard Not sure if I'm able to compile the source code into an exe file, but I'm interested in the code you created so I can at least run it locally in a console. Would it be possible to share this in a pull request or some other way? And this will then work accross multiple saves as you mentioned in your first comment? Thanks in advance! |
Hmmm I am very unfamiliar in how github works, so it seems you would need to explain step by step how I can upload my code here, or point to a good alternative. As per across saves: each player will have the same face in a singular save, no matter how often you "generate" it anew. But across saves, you will need to manage your config files, the same ID may be a different ethnicity. |
Describe the bug
Some regens start having completely wrong ethnicities in a large multi-year save (currently ~ 320.000 regens) using the preserve function in the editor
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All players should have the right ethnicities applied
Screenshots
Desktop (please complete the following information):
Windows
Attachments
Images
Solution:
As I have just recently had a youth intake with faces preapplied, I realised what is going on: FM keeps the ids for regens which have retired, and they can pop up randomly in a different nation in the save. Hence the program thinks the faces are assigned, the ID has been used, but in reality, this has been assigned to a different player.
I would have two suggestion, a more basic one and a more involved one, but one which should also solve some other issues and make the program more streamlined.
When running the preserve order, build in a second loop that leaves the number in the face graphic file alone, but switches the directory and file name prefix to the correct ethnicity the player would get assigned if the program would see him the first time.
A radical suggestion: The program should not generate random numbers at all, but get this information from the player's id (as it should already be a random number). The program only needs to know how many total faces there are for each of the ethnicities, which ethnicity the player should get and the player's id - so you still have the bit of the program find the ethnicity of the player as usual, but do not generate a random number to go with it.
Instead, you perform a Euclidian division https://en.wikipedia.org/wiki/Euclidean_division on the player's id with the number of faces of the player's ethnicity, and the leftover number will become the face's number that is assigned to a player.
You get rid of the preserve, generate, overwrite options as they are superfluous. You just have the individual profiles belonging to different saves.
The method scales for any number of faces in the directories, circumvents the issue of other ethnicity regens getting stuck with a previous incarnation's picture and you get to reduce the complexity of the code. The player's regen ID will always assign him the same face without having to generate and manage a second set of random numbers yourself.
What needs to be looked into for this to work however, is whether the regen IDs are indeed distributed evenly (at least on the scale of the face numbers, e. g. up to 5 or 6 last digits) as is my assumption for the suggestion to work.
The text was updated successfully, but these errors were encountered: