How to effectively compare two 3d paths?

Hi there,

I am trying to find a solution to the following problem. The user will move a game object in 3d space (movements will be recorded as a set of points every frame) and try to repeat a sample path. After that, I am going to compare a user input path with a sample path. I thought to make a vector every n units and compare them, but maybe there is a better solution.

Thanks.

This would kind of depend on how your movement works. If your movement works like clash of clans for example where a unit moves consistently and reliably according to a set of rules after its original placement, then for obvious reasons, all you need to record is its original placement and time. However, if your movement is based on straight lines from the user input like, say, Bomberman on an arcade, then all you need to record is the input and time to recreate it or compare it. But say your movement is based on physics and has random elements to it then you will need to record vector3 positions with timestamps at a set interval to get an approximation of what happened.

You might want to think about that first, whether its inputs or vector3 you should record. Regardless you also need a variable of time from the start of the path. So a Dictionary of timestamps and Vector3 positions.

To visualize the difference you could use a spline with the list of vector3 positions.