🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Magic Growth

Started by
18 comments, last by Magic Card 23 years, 10 months ago
A pixel-by-pixel matching sounds like it would be a pain for a player to use. Think of just how many players would bother making a [near] perfect match every time because they don't realize they don't have to. Besides, traditionally in magic it is the motions you go through that affect the outcome of your conjuring. Thus, the motions should be captured and compared, not pictures.

Two methods:

Adapt the 64 by 64 grid idea so the direction the player is moving the mouse at the moment affects the color of the pixel {sixteen colors for sixteen angles would be sufficient at such a low resolution.} That way it would both be easy to recognize which way to perform the spell by examing the colors and easy to write the comparison code.
[Another thing: When a spell doesn't require as accurate a reproduction of motion, you could use symbols with lower bit-depths. Then use bit-shifting to decrease the bit-depth of the players 'drawing'. This would make the drawing less 'sensitive' to direction [and thus, motion,] allowing for easy spellcasting on simpler and weaker spells.]

Save the motions as bezier curves, similar to how a drawing program creates curves in the 'freehand' mode. Finding information on how to capture motion this way should be easy to find. Comparing them seems to be a much trickier idea, but could yield more accurate and precise results.

Edited by - SonicSilcion on August 9, 2000 12:41:29 PM
Advertisement
Well ... let''s say it again, there IS a method out there already.

It''s called Hidden Markov Model. Do a bit of Altavista crawling and you''ll see dozens of cool sites. But none that would actually explain the basics behind it, nor a good example for gesture recognition, because it seems that gesture recognition is, like, ovious to the people doing those HMM.

so if anyone would know a tutorial, low level article or such on the topic.

SonicSilicon : from my readings, I think you are not to far from the actual method.

the way I understand it :
you capture mouse movement and from it establish a list of headings (angles) at the various capture points, because if you really think about it, a symbol is just a line, whose angle varies ...isn''t it
so what you then do is compare the angle serie with the model.

An "O" for instance, would start at the middle right, heading North, then NW, W, SW, S, SE, E, NE, N again.
When the player move the mouse, the program records the position of the mouse, and calculate a series of vectors, which his basically a heading. Then you smooth the variations by some value.
For instance, if you only take into account variations of angles when they reach at least 45°, you would end up with the above 8 directions. But for an octogone (eight sided polygon) the program would also recognise the same sequence of angle variations.
Any way, I think I am not too far from the truth, problem is I don''t have a compiler handy.

Anyone wanna try my nice idea ??

(are we totally off topic or is it just me ?)

youpla :-P
-----------------------------Sancte Isidore ora pro nobis !
My method is simple:

You just divide the screen up into 16 boxes (I like using a square representation of my screen ) and then you just need to log:

  • Where it starts
  • What boxes it enters
  • Where it finishes


Because I am talking about VERY SIMPLE symbols (because I have to say that most gamers will be new to this idea) then it should be fairly easy to notice which symbol was drawn. It also adds fun of miscasts and funny cock ups like that. Make the player think twice about the dangers of Arcane Majik

Read my doc for more info on this...


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
Ugh, ugly University Technical Papers... why can''t they just write in comprehensible terms like everyone else instead of refereing to works which refer to other works which refer to...

Anyway, I think we''ve gone off topic. Of course, it would be nice if Magic Card would come and explain what the topic is since my mind is too cluttered to comprehend it at the moment. *lick*lick*lick* {mmmm! boots!}
My doc is my definitive doc... I have no other... It is my doc

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
Instead of capturing mouse movements, or drawing in a box, draw in a non-displayed matrix. The same code that paints the pixel over which your mouse has entered in a program such as MSPaint can be modified to write a value to a two by two array.

When you discern that the player is finished drawing (after a certain delay perhaps) flash the symbol they just drew onto the screen using those great special effects your artist tells you he can do so that the player can see what they''ve drawn. Then compare the array to your set of symbols and super impose what you think it should be so that the player can get a better idea of what he should have drawn.

To determine what the computer thinks the player has drawn, I would recommend using a simple neural network that''s been loosely trained to the symbols used for the spells. You can find several good articles here at GameDev in the AI section on how to set one of these up.

If you''re looking for a new way to learn what these symbols are, perhaps using dream sequences which show the symbol along with what they are used for. For example, a short video of a man caring for another injured man, the man tracing a glowing symbol on the injured guy''s forehead to help heal him. Or perhaps oil burning from an overturned lamp creates a symbol which the sequence focuses on. Something like this that simply associates the symbol with the effect without telling the player to ''do this to make that happen'' may also have a more profound effect on the player.

--svyyn
I was kind of talking about what you suggest. Basically you can say "mouse moved through my grid x,y so that is flagged as true" and then you have an easy to use grid. But you could also (with my system and not yours) have counter spells that you have the symbol drawn in the reverse direction. This would add a lot to the play . It shouldn''t be about clicking on all the required areas, but about a combination of methods. My method just opens up a few more doors

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
OK, I started a thread on the Game programming forum, so I don''t feel totally OT when posting here

I am currently testing the idea I have in mind, which is to use variations of angles,and length rather than your grid system.

There are two very obvious problems to the grid idea (at least to me) : how do you handle the same drawing at different sizes.

Plus how the heck do you want to analyze a picture lightning fast while rendering your game, and having a good AI ?

I base my method on the fact that a symbol is a one stroke symbol, which simplifies greatly the task.
If my test are conclusive, I''ll be happy to share my results, but in the mean time if you come up with new ideas, let''s use the proper forum

youpla :-P
-----------------------------Sancte Isidore ora pro nobis !
I will tell you how you take the input no matter what size... SPECIFY THE SIZE. I divide up my screen into enough squares to allow variation, but I divide them coarsely enough to be able to distinguish the difference.... EG.

_____________________
|====|====|====|====|
|====|====|====|====|
|____|____|____|____|
|====|====|====|====|
|====|====|====|====|
|____|____|____|____|
|====|====|====|====|
|====|====|====|====|
|____|____|____|____|
|====|====|====|====|
|====|====|====|====|
|____|____|____|____|

I realize that this is not a nice picture, but it will serve a purpose. The outer bounds of this is the screen (say 640*480 pixels) and it is divided into 16 squares. This allows for a resonable ammount of variation with combinations (you need start and end points and mark what path the mouse takes by what the cursor enters) and you can come out with fairly easily randomly generated symbols. Just make sure that diagonal movement is prohibited and it will work like a charm. Otherwise, you could put some restriction on HOW FAR or HOW LONG the mouse lingers in a square to remove those that are just clipped. Miscasts are always fun!

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
Apologies.. the spacing for that is f***ed and ''='' is a space ... I couldn''t be bothered using   to do it Aren''t I lazy?

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)

This topic is closed to new replies.

Advertisement