Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Drawing and Matching Like Crazy Cutter - Mario Party


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Vincent_M   Members   -  Reputation: 748

Like
0Likes
Like

Posted 07 November 2013 - 11:29 PM

I'd like to add a gameplay mechanic that requires a player to draw symbols close to a predefined one just like in Mario Party:

http://www.youtube.com/watch?v=07ISD4eQslY

 

This is for touch devices, so my idea would be to have a blank texture-like mask over the screen which is actually an array of booleans. As the player touches and drags their fingers over the screen, it'll make the pixels' boolean values become true. The drawing is silently scored whenever the player releases their finger, and if the score is greater than 70% or 80% relevancy, then it's considered a success. Something along those lines...

 

Also, I'd use a really low-res texture mask. Nothing like 960x640, or something crazy like that. That's just way too large!



Sponsor:

#2 Samith   Members   -  Reputation: 2325

Like
0Likes
Like

Posted 09 November 2013 - 10:50 AM

That sounds like a sort of expensive approach, even with a low res mask. On one of the games I worked on we had a feature where the player could "sign" their name with the touch screen. As the player dragged their finger along the screen I would add verts to a tristrip that followed the player's finger. That way I had a relatively small object which described the player's signature (just a tristrip with a couple hundred points) vs a large texture.

 

If I were in your place, I would attempt something similar. As the player drags their finger, I would create a line strip or something that followed the player finger, then when they release their finger I could compare the line strip to the "correct" line strip for the gesture. Matching the player's line strip vs the correct line strip might be kind of tricky. I would probably normalize the player line strip (scale the line strip such that the min x of the line strip becomes -1, the max x becomes 1, the min y becomes -1 and the max y becomes 1) and then march along both the player line strip and the correct line strip at fixed intervals and sum up the distance from the player point to the correct point. If the sum of the distances at each sample point is below some threshold, it passes, otherwise it fails.

 

Keep in mind I've never actually implemented a gesture system, so the matching part might need some work, but what I suggested is probably a good place to start and should be faster than comparing two textures (even a modest 100x50 texture would require 5000 comparisons).


Edited by Samith, 09 November 2013 - 10:52 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS