Page 1 of 1
Randomize skin color
Posted: Wed Apr 12, 2017 12:31 pm
by Gangrenous
Hey Jab, I have been working on my editor and I now have the bitmask on my editor working so I can just click checkboxes and save the random appearances. Question though, I notice on occasion the skin color on the Spawns is just horrid. Is it like this on live? Occasionally I see a Spawn with a skin color that is just not realistic. There definitely seems to be some range variation issues. Skin color should not have the range as lets say hair color.
Or maybe the collector did not read something correctly and skin color should had rarely been randomized.
Code: Select all
if (flags & RANDOMIZE_SKIN_COLOR) {
npc->features.skin_color.red = MakeRandomInt(min_val, max_val);
npc->features.skin_color.green = MakeRandomInt(min_val, max_val);
npc->features.skin_color.blue = MakeRandomInt(min_val, max_val);
LogWrite(NPC__DEBUG, 5, "NPCs", "Randomizing Skin Color - R: %i, G: %i, B: %i", npc->features.eye_color.red, npc->features.eye_color.green, npc->features.eye_color.blue);
}
Re: Randomize skin color
Posted: Wed Apr 12, 2017 4:35 pm
by Jabantiz
No it is not like that on live and it not a packet collect thing this is just our code basically picking a random color which can result in pink trolls or other weird color combinations.
The ideal solution would be to use the color pallets that you can use in the character creator but it would need to be a per race table and no one has had the time to compile all the color options for all the races.
Re: Randomize skin color
Posted: Thu Apr 13, 2017 7:32 am
by John Adams
FYI, the randomize code was partly mine. I think Scatman gave me the basic functionality, and I did the skin generator - and admittedly, completely half-ass. What it really needs are boundaries for each race, how pink do you want your trolls, etc. It was more work than I had time for, but you can also turn off skin color randomize completely to avoid this.
Re: Randomize skin color
Posted: Sat Apr 15, 2017 7:12 am
by Gangrenous
I will work on the function this week. I would think I could just push the ranges on creating characters and get the values this way.
Re: Randomize skin color
Posted: Sat Apr 15, 2017 12:17 pm
by Gangrenous
My thinking here, I am no color professional. If you swing the wheel to its extents on the side and corners and center...should that get all the variations? Frogs where easy, they basically swing the full extent (255,255,255) to (0,0,0)
Well about my above paragraph, you can scratch that idea. If you do it with a min and max RGB value and run through their color wheel, you can still get the crazy green values and stuff.
Code: Select all
case BARBARIAN:
npc->features.skin_color.red = MakeRandomInt(44,246);
npc->features.skin_color.green = MakeRandomInt(34,249);
npc->features.skin_color.blue = MakeRandomInt(21,246);
Those are legit ranges when you create a barbarian. But with that range you can still do some crazy shit, like lime green. I am open for ideas.
Also, just say this. Typo right?
LogWrite(NPC__DEBUG, 5, "NPCs", "Randomizing Skin Color - R: %i, G: %i, B: %i", npc->features.eye_color.red, npc->features.eye_color.green, npc->features.eye_color.blue);
Re: Randomize skin color
Posted: Mon Apr 17, 2017 1:45 pm
by John Adams
One thing I did different in the Vanguard data parser was I captured the min value and max value for each attribute, so when the world loaded the attribute, it had a "known in the world" min/max value and the randomizer did not exceed those values. Granted, it would be a nightmare to re-parse all the EQ2 data at this point, but if Jabantiz is bored......
This method basically mimics what you came up with above, for the BARBARIAN switch case. So for EQ2, it' probably makes more sense to just figure out the bounds and hardcode boundaries in the randomizer.