Profits in Proportion - Scoring
Thought I'd write a post on how scoring works in my LD54 entry, Profits in Proportion.
Current implementationColor channels of individual pixels are diffed resulting in a score. All pixel scores are then summed.
GDScript
func _color_score(a: Color, b: Color) -> float:
return absf(a.r-b.r) + absf(a.g-b.g) + absf(a.b-b.b)
First, A baseline is computed by diffing the scaled-down target image and the starting canvas that is all white. The current score is based on the currently painted canvas.
Then, the score is computed with:
GDScript
clamp((1 - (current_score/baseline_score)), 0, 1) * painting_value
Where the painting value is 150 in the ld compo version.
Problems with the current implementationDepending on the target painting dark areas can have a higher-than-desired effect on the score.
Pixel art aesthetic subjectivity is not accounted for in the computation.
Any color is almost always better than leaving the canvas white.
As seen in this example, players are rewarded more for laying a dark foundation than painting the subject.

Use a log function to weight the pixel values, giving higher weight to values that are closer to the target than ones that are more distant.

Use some image metrics such as root mean squared to augment or replace the log function idea.
Segments of the painting (the subjects) could be given higher weights than less important segments, such as backgrounds.
point 2 - aesthetic subjectivityI would be interested to hear suggestions for this one! Potentially crowdsourced?
point 3 - color > nothingThis may be less of an issue if points 1 and 2 are addressed more satisfactorily.