Not logged in
Register | Login

Menu:

Game Maker Extensions Menu:

av. 8/10 | Who rated

Credit to Kyle_Solo

Downloads: 3172

Tags:

Get a refer button for this extension!

BBcode

html [example]
download
[download]

Advanced Gesture Recognition System

Posted by Kyle_Solo on July 24, 2007

Summary:
Ever played Black and White? If so, you must remember the innovative spell system, which required you to trace a spell's symbol to cast it. My gesture system allows just that. With just a few lines of code, you can add shape recognition to your games. It will take you no more than a few minutes to master the system. The help file also has an easy to follow step-by-step tutorial that will guide you through the process of recognizing a shape.

Features:
1. Automatically scales your shapes. If you define a square, it doesn't matter if the user draws a huge square or a tiny one, the system will recognize it.
2. You can make your own shapes! From Spirals to Stars, Squares to Letters, anything you want.
3. Easy to use! Only 6 essential scripts to learn, but very powerful!
4. Easy to use shape creator allows you to skip the time-consuming process of hard coding your shapes (get it on the GMC).
5. The tutorial in the help file will walk you through creating a simple shape and recognizing it. Someone with little or no code experience could easily figure it out.
6. Lots of new functions!

The download includes the gesture extension (.gex), the demo (.gmk registered), and the source!

      

» Add a Screenshot


Functions:

gesture_shape_create(cutoff,width,height)

This function is used when you want to start defining a shape. It adds point (0,0) to the shape. It also clears existing shapes, if you want to redefine one.
Cutoff:
Higher cutoff, more likely the computer will pick this shape. Use a higher cutoff value on bigger, more complicated shapes. A good guess is about 3/4 of the average of the shape's width and height.
Width:
The width of the shape (should fit the shape nicely, no extra room on the edges)
Height:
The height of the shape

Returns The id of the shape

gesture_shape_setup(id,cutoff,width,height)

Arguments are same as above. You can use this to change a shape’s cutoff, name, width, and height after it is created. You do not need to use this function, only if you want to change a shape you've already defined without clearing it.

gesture_shape_addpoint(id,x,y)

Adds point x,y to the shape. Note that the order you add the points in is important. Points should be added in the same order you want the player to draw the shape in.

gesture_shape_subdivide(id)

Adds more points to the shape. Makes the recognition very slightly slower but much more accurate. Optional.

gesture_capture_start(x,y)

Starts capturing points that will be compared to the shapes in gesture_capture_end(). Use only once each time you capture.

gesture_capture(x,y)

Captures points.

gesture_capture_end()

Ends capturing and returns one of the following values:
a. A zero (0) if no shape has been detected
b. The id of the shape that was detected
You need to enable your shapes for them to be returned

Returns Winning shape id or 0 for none

gesture_capture_percent(id)

Returns the percent chance (0-1) that this shape was the one that was drawn.

Returns Percent

gesture_shape_enable(id,id,...)

Enables the shape(s) so they is scanned for in gesture_capture_end

gesture_shape_disable(id,id,...)

Disables the shape(s) so they will not be scanned for in gesture_capture_end

gesture_shape_enable_all()

Enables all shapes

gesture_shape_disable_all()

Disables all shapes

gesture_shape_recreate(id,cutoff,width,height)

Allows you to redefine an id. Essentially the same as gesture_shape_create, except it clears an existing id.

gesture_shape_draw(id,x,y)

Draws the shape at x,y.





You not logged on! It is recommended you logon before commenting so we can tell who you are!

Comments:

12:47pm, 24 Jul 2007
Jonah

Awsome! This is one of the best ones yet! I gave it 5/5.

BTW I also re-cached the images so now this works (get code on the right):
User submitted image

8:04pm, 30 Jul 2007
Jonah

I think you are right, people are jealous. BTW I have done both your suggestions. They were great ideas.

3:21pm, 17 Aug 2007
Jonah

Ooh, you added function descriptions. I also added a screenshot uploader to the site and I took the liberty of uploading a screenshot of this (hope that's ok). Look right below your description and you'll see it.

6:58am, 20 Aug 2007
Kyle_Solo

Thanks!

3:19am, 3 Sep 2007
Guest

i could use this it's like that gii extension.

9:53am, 10 Sep 2007
Kyle_Solo

I've updated it to version 5.

3:06pm, 11 Sep 2007
Jonah

Cool. What's been changed?

6:54pm, 11 Sep 2007
Kyle_Solo

I've made it work much more like GM's particle system. You can also enable and disable gestures now. The help file has more info.

9:04pm, 28 Sep 2007
Kyle_Solo

I've released Shapemaker. Check it out here: http://gmc.yoyogames.com/index.php?showtopic=294978

6:10pm, 8 Oct 2007
Kyle_Solo

Update to Version 5.1
Added a function for drawing shapes and optimized another.

11:05pm, 10 Nov 2007
Guest

This makes me think Nintendo DS

3:48pm, 20 Nov 2007
Guest

it says when i load the game it cant recognize the code

7:02pm, 20 Nov 2007
Kyle_Solo

Please post on the GMC. Be sure to include the specific error in your post.

8:24am, 29 Nov 2007
Kyle_Solo

Version 5.2 out. New functions and better accuracy.

2:54pm, 6 Jan 2008
Guest

Nintendo DS GM Native Emulatie for GM DS Clone'i'es!

(Ill make a DS Program which loads GM Games and allows them to run like a ds by loading script files containing shapes!)

2:47pm, 22 Feb 2008
Guest

cool

5:10am, 24 Aug 2010
hakkan

thanks