A question about how we color custom foods, and an idea.
-
- Joined: Thu Sep 24, 2015 8:43 am
- Byond Username: Smoopadoop
A question about how we color custom foods, and an idea.
When you put a food item into a custom burger, a new layer appears in the burger, and the color of the layer reflects the food used.
How is this color generated? Is it an average of the colors used in the food's sprite? Is the color assigned to each food within the code, like with reagent colors?
I have a few ideas about making animated sprites without the effort of animating every single clothing item. (I swear I'll finish the animations one day!)
The idea is, simply, to have a few 'template' clothings to put on top of the animated human, and color them based on what the player is wearing.
This means that if custom foods are colored by averaging the color of the foods used in them, can't we use the same code with clothing?
i.e. A player wearing a captain's hardsuit begins a walking animation. The animation chosen is a generic 'armored' sprite, a placeholder until a proper animated sprite for the captain's hardsuit is added.
The generic armored walking animation is then colored with an average of all the colors on the captain's suit, which comes out as the captain's recognizable signature blue.
Ofc, talk about animations fits better in Spriting&Mapping, but I'm here to ask about that color code before I go further into animating.
How is this color generated? Is it an average of the colors used in the food's sprite? Is the color assigned to each food within the code, like with reagent colors?
I have a few ideas about making animated sprites without the effort of animating every single clothing item. (I swear I'll finish the animations one day!)
The idea is, simply, to have a few 'template' clothings to put on top of the animated human, and color them based on what the player is wearing.
This means that if custom foods are colored by averaging the color of the foods used in them, can't we use the same code with clothing?
i.e. A player wearing a captain's hardsuit begins a walking animation. The animation chosen is a generic 'armored' sprite, a placeholder until a proper animated sprite for the captain's hardsuit is added.
The generic armored walking animation is then colored with an average of all the colors on the captain's suit, which comes out as the captain's recognizable signature blue.
Ofc, talk about animations fits better in Spriting&Mapping, but I'm here to ask about that color code before I go further into animating.
Mains:
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
-
- Joined: Wed Jul 27, 2016 5:21 pm
- Byond Username: Swindly
Re: A question about how we color custom foods, and an idea.
Yes. Each food has a filling_color variable that stores the color used when added to custom foods here.Smoopadoop wrote:Is the color assigned to each food within the code, like with reagent colors?
- Alipheese
- Joined: Sun May 01, 2016 12:56 pm
- Byond Username: Daturix
- Github Username: Daturix
Re: A question about how we color custom foods, and an idea.
The foods custom item color is a set color thats coded in.
-
- Joined: Thu Sep 24, 2015 8:43 am
- Byond Username: Smoopadoop
Re: A question about how we color custom foods, and an idea.
well then fuck
Mains:
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
- Alipheese
- Joined: Sun May 01, 2016 12:56 pm
- Byond Username: Daturix
- Github Username: Daturix
Re: A question about how we color custom foods, and an idea.
Could just make the animations use basic selected color for variants. So a blue jumpsuit for said animation with the color set to blue for one or orange for the other.
-
- Joined: Thu Sep 24, 2015 8:43 am
- Byond Username: Smoopadoop
Re: A question about how we color custom foods, and an idea.
True, but I didn't want to go through every single clothing item and give it a colour, which is why I wanted to try and automate it.
How else would I be able to select the correct colour, though? There must be some way.
IS there a way to generate an average colour based off of an item's sprite? Can byond analyze the colours of .dmis?
Maybe I could use keywords. If the name contain's "captain's", it'd select dark blue. If any colour name is in a clothing item, it'd choose that colour. Same with clothing types.
Are there any other ways you can think of?
How else would I be able to select the correct colour, though? There must be some way.
IS there a way to generate an average colour based off of an item's sprite? Can byond analyze the colours of .dmis?
Maybe I could use keywords. If the name contain's "captain's", it'd select dark blue. If any colour name is in a clothing item, it'd choose that colour. Same with clothing types.
Are there any other ways you can think of?
Mains:
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
-
- Joined: Wed Jul 27, 2016 5:21 pm
- Byond Username: Swindly
Re: A question about how we color custom foods, and an idea.
Use the item_color variable clothes already have?
- Alipheese
- Joined: Sun May 01, 2016 12:56 pm
- Byond Username: Daturix
- Github Username: Daturix
Re: A question about how we color custom foods, and an idea.
Best bet here.Swindly wrote:Use the item_color variable clothes already have?
What youre trying to do doesn't exist to my knowledge and complicates the entire thing more than it needs to be.
-
- Joined: Thu Sep 24, 2015 8:43 am
- Byond Username: Smoopadoop
Re: A question about how we color custom foods, and an idea.
Jesus it didnt occur to me that things would already have colour vars inbuilt
Mains:
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
- Uristqwerty
- Github User
- Joined: Tue Mar 17, 2015 12:44 am
- Byond Username: Uristqwerty
- Github Username: Uristqwerty
Re: A question about how we color custom foods, and an idea.
It is possible to read pixels from an icon, but I doubt it would be worth the performance cost, and there are too many edge cases to handle (animations, movies, color var, underlays, overlays, alpha, directional states?)
Besides, when the colours average to something bland, a human can recognize notable colours and pick a more appealing result. Trying to encode the relevant logic in an automatic system would vastly increase the complexity and further impact server performance.
If it doesn't already do it, I think the best solution is just to detect when a colour hasn't been set, use a sane default for the rest of the round, and log/notify devs that the item type in question is missing data.
Besides, when the colours average to something bland, a human can recognize notable colours and pick a more appealing result. Trying to encode the relevant logic in an automatic system would vastly increase the complexity and further impact server performance.
If it doesn't already do it, I think the best solution is just to detect when a colour hasn't been set, use a sane default for the rest of the round, and log/notify devs that the item type in question is missing data.
An Urist from early baystation. Has submitted a few small additions to /tg/station over the years, but is far from the most notable Urist on this codebase.
-
- Joined: Thu Sep 24, 2015 8:43 am
- Byond Username: Smoopadoop
Re: A question about how we color custom foods, and an idea.
yeah honestly this is what I was thinkingUristqwerty wrote:all that shit
machine-made colours would look shit, and if something's missing then tell me to make another animation
now time to try and get motivated to keep making them
Mains:
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
David Bellic the Scientist (usually)
Guy Fieri the Cook (not anymore)
- iamgoofball
- Github User
- Joined: Fri Apr 18, 2014 5:50 pm
- Byond Username: Iamgoofball
- Github Username: Iamgoofball
Re: A question about how we color custom foods, and an idea.
yeah listen i'll just make it pick a color by taking the average color of the sprite
Who is online
Users browsing this forum: No registered users