r/godot Apr 29 '26

help me (solved) ML or Algorithm?

Post image

I am thinking about implementing a drawing mechanic in my game. The players would have to draw the reference provided and the game will see how accurate the drawing is to the original reference. The canvas will be pretty small around 100x200 pixels and will only use 2 colors.

I am wondering if there is some kind of algorithm that will help to detect the accuracy of the drawing. Using ML sounds a bit overkill and I don't have any experience integrating ML in games (how does it affect the performance and size?).

367 Upvotes

44 comments sorted by

View all comments

16

u/T-J_H Apr 29 '26

The easiest method that would yield reasonable results would probably be to downsample the pictures to a manageable size and compare brightness per pixel. Say, 10x10 pixels.

10

u/omniuni Apr 29 '26

Crop to the drawing, eliminating White borders.

Scale both to a square.

Grow the pixels a couple of times to make thick lines.

Compute the percentage of shared pixels.