Randomize skin color

Discussions of the design and development of in-game content.

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Randomize skin color

Post by Gangrenous » Wed Apr 12, 2017 12:31 pm

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);
	}
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Randomize skin color

Post by Jabantiz » Wed Apr 12, 2017 4:35 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Randomize skin color

Post by John Adams » Thu Apr 13, 2017 7:32 am

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.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Randomize skin color

Post by Gangrenous » Sat Apr 15, 2017 7:12 am

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.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Randomize skin color

Post by Gangrenous » Sat Apr 15, 2017 12:17 pm

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);
Resident Dirty Hippy

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Randomize skin color

Post by John Adams » Mon Apr 17, 2017 1:45 pm

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...... :twisted:

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests