{"author_link":"\/users\/don-shinski","author_name":"don.shinski","author_uid":"don-shinski","comments":[],"epoch":1696546830,"event":"LD54","format":"md","ldjam_node_id":381680,"likes":2,"metadata":{"p_key":"203610","p_author":"don.shinski","p_authorkey":"1077003","p_urlkey":"438197","p_title":"Profits in Proportion - Scoring","p_cat":"LDJam ","p_event":"LD54","p_time":"1696546830","p_likes":"2","p_comments":"0","p_status":"WAYBACK","us_key":"1077003","us_name":"don.shinski","us_username":"don-shinski","event_start":"1695945600","event_key":"117","event_name":"Ludum Dare 54"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD54","removed_author":false},"_superparent":371459,"_trust":3,"author":77003,"body":"Thought I'd write a post on how scoring works in my LD54 entry, [Profits in Proportion](https:\/\/ldjam.com\/events\/ludum-dare\/54\/profits-in-proportion).\n\n#### Current implementation\n\nColor channels of individual pixels are diffed resulting in a score. All pixel scores are then summed.\n\n```GDScript\nfunc _color_score(a: Color, b: Color) -> float:\n\treturn absf(a.r-b.r) + absf(a.g-b.g) + absf(a.b-b.b)\n```\nFirst, 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.\n\nThen, the score is computed with:\n```GDScript\nclamp((1 - (current_score\/baseline_score)), 0, 1) * painting_value\n```\n\nWhere the painting value is 150 in the ld compo version.\n\n#### Problems with the current implementation\n\n1. Depending on the target painting dark areas can have a higher-than-desired effect on the score.\n\n2. Pixel art aesthetic subjectivity is not accounted for in the computation.\n\n3. Any color is almost always better than leaving the canvas white.\n\n\n#### Example of point 1\nAs seen in this example, players are rewarded more for laying a dark foundation than painting the subject.\n\n![dark_too_good003.png](\/\/\/raw\/bcc\/21\/z\/5fd3e.png)\n\n#### Potential improvements\n\n##### point 1 - dark areas can have a higher-than-desired effect\nUse 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.\n![negativelog.png](\/\/\/raw\/bcc\/21\/z\/5fd3f.png)\n\nUse some [image metrics](https:\/\/docs.godotengine.org\/en\/4.1\/classes\/class_image.html#class-image-method-compute-image-metrics) such as root mean squared to augment or replace the log function idea.\n\nSegments of the painting (the subjects) could be given higher weights than less important segments, such as backgrounds.\n\n##### point 2 - aesthetic subjectivity\nI would be interested to hear suggestions for this one! Potentially crowdsourced?\n\n##### point 3 - color > nothing\nThis may be less of an issue if points 1 and 2 are addressed more satisfactorily.\n","comments":2,"comments-timestamp":"2023-10-06T11:22:25Z","created":"2023-10-05T22:25:45Z","files":[],"files-timestamp":0,"id":381680,"love":2,"love-timestamp":"2023-10-06T01:35:57Z","meta":[],"modified":"2023-10-06T11:22:25Z","name":"Profits in Proportion - Scoring","node-timestamp":"2023-10-05T23:07:15Z","parent":378215,"parents":[1,5,9,371459,378215],"path":"\/events\/ludum-dare\/54\/profits-in-proportion\/profits-in-proportion-scoring","published":"2023-10-05T23:00:30Z","scope":"public","slug":"profits-in-proportion-scoring","subsubtype":"","subtype":"","type":"post","version":1187405},"node_metadata":{"n_key":"381680","n_urlkey":"438197","n_parent":"378215","n_path":"\/events\/ludum-dare\/54\/profits-in-proportion\/profits-in-proportion-scoring","n_slug":"profits-in-proportion-scoring","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"77003","n_created":"1696544745","n_modified":"1696591345","n_version":"1187405","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/54\/profits-in-proportion\/profits-in-proportion-scoring","text":"Thought I'd write a post on how scoring works in my LD54 entry, [Profits in Proportion](https:\/\/ldjam.com\/events\/ludum-dare\/54\/profits-in-proportion).\n\n#### Current implementation\n\nColor channels of individual pixels are diffed resulting in a score. All pixel scores are then summed.\n\n```GDScript\nfunc _color_score(a: Color, b: Color) -> float:\n\treturn absf(a.r-b.r) + absf(a.g-b.g) + absf(a.b-b.b)\n```\nFirst, 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.\n\nThen, the score is computed with:\n```GDScript\nclamp((1 - (current_score\/baseline_score)), 0, 1) * painting_value\n```\n\nWhere the painting value is 150 in the ld compo version.\n\n#### Problems with the current implementation\n\n1. Depending on the target painting dark areas can have a higher-than-desired effect on the score.\n\n2. Pixel art aesthetic subjectivity is not accounted for in the computation.\n\n3. Any color is almost always better than leaving the canvas white.\n\n\n#### Example of point 1\nAs seen in this example, players are rewarded more for laying a dark foundation than painting the subject.\n\n![dark_too_good003.png](\/\/\/raw\/bcc\/21\/z\/5fd3e.png)\n\n#### Potential improvements\n\n##### point 1 - dark areas can have a higher-than-desired effect\nUse 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.\n![negativelog.png](\/\/\/raw\/bcc\/21\/z\/5fd3f.png)\n\nUse some [image metrics](https:\/\/docs.godotengine.org\/en\/4.1\/classes\/class_image.html#class-image-method-compute-image-metrics) such as root mean squared to augment or replace the log function idea.\n\nSegments of the painting (the subjects) could be given higher weights than less important segments, such as backgrounds.\n\n##### point 2 - aesthetic subjectivity\nI would be interested to hear suggestions for this one! Potentially crowdsourced?\n\n##### point 3 - color > nothing\nThis may be less of an issue if points 1 and 2 are addressed more satisfactorily.\n","title":"Profits in Proportion - Scoring","wayback_source":[]}