Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Nazurin on October 19, 2008, 11:15:04 am

Title: Symbol recognition script?
Post by: Nazurin on October 19, 2008, 11:15:04 am
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.
Title: Re: Symbol recognition script?
Post by: Blizzard on October 19, 2008, 11:23:44 am
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?
Title: Re: Symbol recognition script?
Post by: Aqua on October 19, 2008, 11:26:47 am
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
Title: Re: Symbol recognition script?
Post by: Nazurin on October 19, 2008, 11:29:45 am
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.

(http://www.myds.com.au/img/game/large/Lost-Magic-DS-4.jpg)

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.
Title: Re: Symbol recognition script?
Post by: Blizzard on October 19, 2008, 11:52:36 am
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.
Title: Re: Symbol recognition script?
Post by: Nazurin on October 19, 2008, 11:58:17 am
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.
Title: Re: Symbol recognition script?
Post by: Blizzard on October 19, 2008, 12:19:17 pm
Interesting. Well, direction check can be easily implemented by checking the start point. But crossing of lines can't. xD
Title: Re: Symbol recognition script?
Post by: Satoh on October 20, 2008, 04:46:58 pm
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?
Title: Re: Symbol recognition script?
Post by: Blizzard on October 20, 2008, 05:04:19 pm
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.
Title: Re: Symbol recognition script?
Post by: Satoh on October 20, 2008, 05:17:49 pm
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...)
Title: Re: Symbol recognition script?
Post by: Blizzard on October 20, 2008, 05:45:02 pm
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.