Player Figure Drawing System

Hey everyone,

I’m trying to develop an MMO game where instead of binding abilities to a certain key, players draw the glyph corresponding to the ability they would like to use. That way, the number of active abilities you can have aren’t limited to the number of keys on your keyboard, they’re limited only by the number of glyphs you can master and remember. Think something like these shapes as the “glyphs”:

Maybe not as complex and more smooth as these, however, this is the idea. Each useable ability will have a corresponding glyph that the player must remember and then “draw” using the mouse.

I’m having a hard time approaching how to solve this issue. How can I have a player draw a shape? How can I then determine 1) if that shape matches the glyph of a known ability and 2) how accurate the player drew the glyph?

I would eventually like to be able to match the drawn glyph to another glyph independent of the size so that if a player wants to cast an ability with more or less power, the glyph can be drawn bigger or smaller. However, for now, I’m just looking for a way to build a system where the player can draw a glyph, the game can (quickly) check if that drawn glyph matches the glyph of a known ability, and determine how well the drawn glyph matches the glyph of a known ability. That is, small differences in the drawn glyph shouldn’t matter when determining if the drawn glyph matches a known glyph.

An idea I had would be to somehow determine how much a drawn glyph matches every known glyph, perhaps with a score out of 100. For the known glyph with the highest matching score, that ability will be cast if the matching score is above the threshold to be considered a sufficient match. I have no idea how I would go about implementing this or if the algorithm would be fast enough when there are many glyphs to check against.

I am looking for solutions using either nodes or c++ or both. I have never worked with C++ in UE4, however I do know c++ so I can figure it out. I also know calculus, so if the best solution to this problem requires any integration or derivation that is fine; I’m sure the best solution is going to involve some type of calculus, I just can’t figure out how to approach this problem and if anyone can help get me started that would be great!

I’m not sure if I have explained my problem well enough, if anyone is confused and needs clarification of what I’m looking for, let me know…

Thank you in advance for anyone that can give me any advice/ideas!