Symbol recognition script?

Started by Nazurin, October 19, 2008, 11:15:04 am

Previous topic - Next topic

Nazurin

Okay, this is a pretty big thing to ask, I know, I apologize in advance.

What I'm asking for, is a script that would allow you to add a "symbol recognition" field onto the screen when a button is pressed/other event is called.

You use the mouse, or maybe button presses, to draw a symbol on screen, and if you draw an X you cast fire, if you draw a V you cast ice etc.

I'm actually planning to use this for a little Hiragana/Katakana game.

I'm currently only using Blizz-ABS, but it's fine to use this in a completely new script free game too.

Blizzard

Actually that shouldn't be so complicated. Here are a few guidelines for the person who will take this request:

Use a premapped set of symbols, best in bitmap format. When detecting the symbol drawn, it would be the easiest to simply use a table to store the pixel coordinates which are touched. The memory usage is 640x480 = 307,2kB, but that's not so much since you can save a lot of CPU time because you're not working with resizeable arrays. The comparison can be made with a specific tolerance factor, i.e. if the tolerance factor is 5%, then 5% of the pixels can be off the actually correct image. The only problem would be a scaling factor of the images since I can't think of a way to effectively scale down or up the image for comparison except a repeated matching against copies of the images in smaller and bigger sizes. Hm... Actually that idea could be doing it. In any case, it's not too complicated. Somebody would just need to know how to implement my suggestions. You should post the code of a possible mouse module.

Just a question, is this anything like Black & White's symbol recognition?
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Aqua

October 19, 2008, 11:26:47 am #2 Last Edit: October 19, 2008, 11:55:10 am by Aqua
Mmm I believe this is like Lost Magic's battle system.

In that... you drew a /\ for a basic fire spell... and the V could look very demented as long as it was still V-like.  Like.. you can draw (\ and it'd still work

Nazurin

I was looking for closer to LostMagic, a game I have obsessively now attained 200 hours gameplay on.(I've replayed the storyline now close to 10 times)

It may be similar to Black & White, but I don't know, I was comparing it to what I know, which is LostMagic.



This is how it works on LostMagic. You draw the symbol you see above in the spell table, you can draw two symbols for a stronger spell, and three symbols for an ultimate spell. There is no two rune combination that doesn't exist. On this game, you can draw any two runes and some effect will be found. Trio runes are harder, because there's only 30 or 40 combinations.

EDIT: Aqua said LostMagic before I even had a chance to. LostMagic for the win.

Blizzard

Hm... Except for the direction of drawing, my system analysis should work pretty well. Also, the problem for different sizes can be ignored if it has to be drawn right.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Nazurin

The direction on LostMagic actually doesn't make too much of a difference. I frequently draw the second Air and the second dark runes backwards, it just means I draw them less perfectly, so they're not as strong.

Blizzard

Interesting. Well, direction check can be easily implemented by checking the start point. But crossing of lines can't. xD
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Satoh

You could use a secondary image loaded into memory as a checksum of sorts for the symbol you're trying to draw. a grayscale image that is much less strict than the actual symbol is, (much wider lines etc) that way as long as the players lines are always inside a certain color of the hidden check image, (say white is good black is fail... or vise versa) if the lines all fit into the white of the image, the symbol is ok, if the lines touch the black of the image, the symbol is failed....

Did that make sense?
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Blizzard

I was actually thinking of a duotone image. So a black and white image should be fairly enough if you use a reasonable tolerance factor.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Satoh

ah, as for symbols with crossing lines, you could use multiple images to check the symbol.

Whenever the mouse button is lifted, the image that is being used to check the symbol is switched and the color of the line changes or something like that... or you could use several colors on the check-image and have the script check each color individually...

(I'm not sure if I explained that how I was thinking it, I hope I make sense...)
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Blizzard

It does to me. That's a good idea. To force a specific path a symbol could consist out of 2 images which need to be checked one after another. I like the idea. I don't think the "different colors" idea would work, though.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.