don.shinski

Ludum Dare 54

Profits in Proportion - Scoring

Thought I'd write a post on how scoring works in my LD54 entry, Profits in Proportion.

Current implementation

Color 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 implementation
  1. Depending on the target painting dark areas can have a higher-than-desired effect on the score.

  2. Pixel art aesthetic subjectivity is not accounted for in the computation.

  3. Any color is almost always better than leaving the canvas white.

Example of point 1

As seen in this example, players are rewarded more for laying a dark foundation than painting the subject.

darkemtoo/emgood003.png

Potential improvements point 1 - dark areas can have a higher-than-desired effect

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. negativelog.png

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 subjectivity

I would be interested to hear suggestions for this one! Potentially crowdsourced?

point 3 - color > nothing

This may be less of an issue if points 1 and 2 are addressed more satisfactorily.