Skip to main content
GameDev.net gamedev.net
🔒 Locked

Martial arts combat mindset simulation

Started by Iron Chef Carnage Dec 8, 2002 at 12:31 PM 40 replies 4.2k views
Original Post
Iron Chef Carnage
Iron Chef Carnage
Reading throught Musashi Miyamoto''s "The Book of Five Rings", I was struck by the utter simplicity of certain elements of it, and started wondering how hard it would be to build an AI capable of using some of the principles therein. A lot of Musashi''s ideas are based on perception of changes in the opponent(s) and much of the rest comes from applying principles to your own actions. Take, for example, the spark hit and disintegration. The spark hit is a sudden, directed application of force, roughly analogous to Bruce Lee''s "three inch punch", but from contact distances. Your swords are actually touching, after a parry or grapple or whatever, and you, with a sudden, decisive action, exert all the force of your body against the enemy, effectively blasting him backward with a huge, convulsive strike. Disintegration is watching your opponent for signs of weakness, fatigue and loss of coherence. Wasted movements, tired movements, unsure movements, these are all symptoms of disintegration. Musashi has all kinds of neat things that you can do to people when they''re disintegrating, but the main thing is seeing it. This wouldn''t be particularly useful in a player-vs.-AI setting, since the player character would be necessarily clumsy and choppy, owing to the poor interface between man and machine, but in AI confrontations, such as RPG''s, such a system could lead to a new form of level-raising. Instead of getting "Broadsword +4", your character could actually get better at fighting, and employ basic principles in duelling and combat. A dynamic learning system would make practice and battle experience more realistic, and there would be a very realistic progression in character strengths. I first thought of this while playing Kengo II for the PS2. The character gains strength and speed and agility, but also acquires new moves as he fights different enemies. It was then the player''s job to govern things like distance, timing and aggression. If, instead of learning moves and stringing them into combos, the character could take over the more human roles, then a character could be cultivated into a truly autonomous fighter. In Ogre Battle 64, the characters take care of fighting all by themselves, with the player offering only the most abstract tactical advice. If the fighting was more complex than hit-block-dodge, a whole new world of fighting could be developed. A sort of über-pokemon, if you''ll excuse the parallel. Even in games in which the player takes a direct hand, the AI system could be applied to allies and enemies, so that while the player character does as player characters do, the NPC''s would engage one another on a fairly advanced level.
Timkin
Timkin
This is an excellent idea that has been explored well in pen-and-paper RPGs although little in computer games. The difficulty you face though is the user interface. It is difficult to permit the player more control over a fight using just a mouse, keyboard and/or joystick! Perhaps you have some good ideas about how to achieve this that you could share with everyone?

Cheers,

Timkin
Iron Chef Carnage
Iron Chef Carnage
To be honest, I have no idea how to address those problems. It might be necessary to relegate such things to a purely AI system, without direct user control at all. Maybe an RTS or even an encounter-based RPG, like Tactics Ogre, where the command to attack initiates a quick exchange of blows, rather than just a chopping action.

It''s one of those things that would make the characters seem much more human, but would have little direct impact on gameplay.

In all honesty, I was hoping someone would have already made progress in this direction, so that I could study up on the theory. I wrote an extremely abstract paper not too long ago about neural networks, in which I trained a hypothetical fencer to parry in 3, 4, or 5 depending on the direction of the attack. It was a neat assignment, but I don''t think that that''s what I''m looking for here.
Metorical
Metorical
This sounds like a great idea!

I''ve always been interested in generating a full martial arts third person simulation and the biggest hurdle is definetly the interface.

I''ve drawn out a whole system in pen and paper for actions, training (e.g. improving muscle quality, flexibility etc) but getting it in game is difficult.

I currently learn a form of Kung Fu and from this I can draw some basic conclusions from free-sparring.

1) Your primary aim is to defend yourself. I am very tall so this basically means if they come close I throw a punch in their face so they have to back off. If they move in really close quickly I spurn them away by pushing them with my legs. Moving quickly backwards (and forwards) is very important as well as standing in a stance which gives you balance and exposes the minimum number of vital organs. This equates to standing with your side facing your oponent at all times and with your weight on your back leg so they cannot simply sweep your leg away. If they sweep your front leg you simply pick it up.

2) We learn to attack by learning useful combinations. The most simple is a punch. Punches can be combined with kicks for greater affect. By leaving a punch in your oponents face you effectively restrict their vision making it harder to see your sidekick, turning kick or whatever else is coming.

There are many ways of improving your technique including,

A) Power - Stronger kicks are harder to stop.
B) Momentum - Using your bodies momentum to add to the force of an attack.
C) Predicting your opponent - If you know when they are going to drop their guard or what they are likely to do you can more easily decide on an effective counterattack. Talking to friends they''ve all had experiences were they spar someone with an amazing "turning kick in to back kick". Next week they come back and defeat that move when their opponent tries it. If you can do this in a fight your on good stead. Our sensei takes one or two minutes of a fight and then moves in for the kill knowing his oponents.
D) Skill - We have defined kicks because they are supposed to be performed in a certain way for maximum effectiveness. With practice you will have better attacks.
E) Speed - It''s harder to dodge a speeding car than a bicycle.
F) Physical and Mental conditioning - for a while I wondered why my free sparing was suffering, basically I was laughing too much during it and *not* concentrating. If you are healthy and focuses you will perform much better.

+ a lot more.

Looking back at the list C and D could be implemented with something similar to an ANN. The others are more ''constant'' variables given a short enough timescale.

-Meto
Timkin
Timkin
quote:
Original post by Metorical
1) Your primary aim is to defend yourself.



Interesting view point! I would suggest (also from extensive martial arts experience) that in a real combat situation, your aim is to disable/kill your opponent before they do the same to you (given that they are attacking you it is a fair assumption that they mean you severe harm!). You can defend all day long if you want, but if you don''t finish them off, they''re going to get you eventually (when you fall asleep maybe?)!!!

Cheers,

Timkin
Iron Chef Carnage
Iron Chef Carnage
I don''t see any real reason for the primary objective of combat to be defense, and can actually think of a few arguments as to why it would be an inferior mindset. Sure, the decision to resort to physical conflict as a means to resolve a situation might be based on self-preservation or enforcing ideals and objectives, but once you''re fighting, you''re fighting to win the fight. Again, from the Book of Five Rings, Musashi Miyamoto pointed out that in a duel, every action should be done with the intention of killing your opponent. Even blocking his attacks or dodging them should be done, not to prevent him from winning, but with an eye always to achieving victory yourself. The definition of "victory" may vary depending on the unique scenario, but the goal of achieving it is universal.
Timkin
Timkin
quote:
Original post by Iron Chef Carnage
Reading throught Musashi Miyamoto''s "The Book of Five Rings",


BTW: Just to clear up any confusion, his name is actually Miyamoto Musashi, or as his name is correctly given, Shinmen Musashi No Kami Fujiwara No Genshin.

Another interesting tid-bit about Musashi... some may have heard that he faught and won his first duel at the age of 13 (or 14 in some texts). Interestingly enough he did not win the fight with his sword, but rather utilised his jiu jitsu to throw his opponent to the ground wherein he kicked the man to death! These days he''d get 25 to life in prison (or the death penalty in some US states)! Oh how times have changed.

Cheers,

Timkin
capn_midnight
capn_midnight
In Aikido, the purpose is only for defense, and only minimalistic, no harm to the attacker. In Krav Maga, the purpose is pure offense, attack and kill before being attacked.

Personally, I study a form of Tae Kwon Do that my sensai has been developing over the past 15 years drawing from various techniques of various arts (Sounds a lot like Jeet Kun Do, I know, but he likes to call it Tae Kwon Do). I think you will see a lot of serious martial artists fall into two categories: the Bruce Lee/JKD inspired samplers, and the hardliners who study only one art in it''s purist form.

As for strategy in fighting, the sky is the limit. My instructor often mentions how proud he is that no two students in his school are alike, that he isn''t turning out cookie-cutter students but unique martial artists that can develope their own sense of style.

Generally, I find myself not thinking in terms of what to cover on my body and what technique to throw or what technique to block. I usually try to think in terms of what target to hit, how much force to use on that target, and what direction I will come in for the attack (straight on, hook, feint, etc.) For many fighters I know, counter-attacking is the main focus, only worrying about the first few attacks an opponent throws, countering, and regrouping. Another group of fighters prefer pre-emptive attack, following a basic pattern of enter-attack-retreat. Personally, I try to mix the two together, keep my opponent guessing.

I think once you start studying, you''ll find that all the martial arts have a basic core in common, and that defining that core will make the structure of your system, but emphasizing the differences will make you system interesting.
Iron Chef Carnage
Iron Chef Carnage
Lousy password field... The above post is mine. Also, there's no such word as "Inompetence". Imagine a "c" in there.

[edited by - Iron Chef Carnage on December 11, 2002 2:19:21 PM]
Metorical
Metorical
An interesting point you''ve raised and maybe it''s due to my poor explanation.

I wouldn''t consider my self very experienced in martial arts (and I doubt that many people who practice would). The road to improvement would be very difficult if I had to jump straight in at the deep end so I take it in very small steps. In real terms this means that I learn how to defend myself before I learn to attack. Sure in a real fight this might not be that useful as it could go on indefinetly but having a firm foundation makes progressing a lot easier.

The complete opposite would be to attack without thought of ones personal safety. Reading Hagakure a lot of people get very confused by the second quote.

"The Way of the Samurai is found in death. When it comes to either/or, there is only the quick choice of death. It is not particularly difficult. Be determined and advance. To say that dying without reaching one''s aim is to die a dog''s death is the frivolous way of sophisticates. When pressed with the choice of life or death, it is not necessary to gain one''s aim.
We all want to live. And in large part we make our logic according to what we like. But not having attained our aim and continuing to live is cowardice. This is a thin dangerous line. To die without gaining one''s aim is a dog''s death and fanaticism. BUt there is no shame in this. This is the substance of the Way of the Samurai. If by setting one''s heart right every morning and evening, one is able to live as though his body were already dead, he gains freedom in the Way. His whole life will be wihtout blame, and he will succeed in his calling."

I''ve talked to many people who think this means that a person should expect to die and therefore fight to the death. In reality I believe it is about accepting death and therefore not letting it hold you back. If you are not thinking about dying you will much more likely perform well as your mind is on the task.

It is foolish to openly attack and put yourself at risk. You may not be scared of death but you openly inviting it. With fundamentals you could achieve the same goal and perform at the maximum of your ability therefore you would not need to worry about death (even though it might come).

I''ve gone a little deep but basically what I''m saying is that just because I have a priority of defending my self in a fight (assuming I''m attacked) does not eliminate my effectiveness at attacking provided I have the right mind set.

I quite like your comments Iron Chef Carnage. Realisiticly I''d say my techiniques lie in the Concious Incompetence/Competence range at the momeny.
Kingstone426
Kingstone426
Really cool topic this. I myself have never read Shinmen Musashi No Kami Fujiwara No Genshin''s book (nice name) and I have never practised Kung-Fu.
However I have some experience with Tae Kwon Do (competative WTF-style, non-traditional), kickboxing and thaiboxing.

What I find crucial in all of them is movement and balance wich could be defined by some value that your character could improve by training thus making his movement faster. I''ll explain further. From what I''ve been training the body is always in some motion, like changing the balance from one foot to the other. The better you control your body the faster you can shift your balance and move or produce an attack/block.

btw, i am imagining this as a tekken-like game.
strength would also be increased by training as it would be rather silly to take in mind the pressure on the attack-buttons, if you even could.

Some other article about gamedesign was covering AI-learning in a online way, making the npc''s learn from players and remember their skills and i think that would be cool. Imagine meeting an npc who has got his ass kicked for so long that he now could beat up almost every real player. also in such a virtual world npc could fight (train with) each other.

oops off topic
capn_midnight
capn_midnight
Iron Chef, you''ve been reading NAPMA magazine, haven''t you? Skip it, it''s mostly an ad for their services. An excellent magazine is Black Belt magazine. Personally, I think this is the only magazine on the market worth reading. Most of the other magazines use writers that have no basic concept of grammar or the english language.

Kingstone, you make a good point about the importance of balance. I am constantly making my students work balance drills, and they are slowly but surely reaping the benefits (did I forget to mention that I am an instructor as well as a student?).
You also touched on the idea of a genetic algorithm for a fighting pattern. Techniquely, that would be fairly simple (as far as GA''s go). Programming the individual moves would be trivial, from there it''s a matter of matching the AI against human and AI players for it to gain data for genetic strength. From there, you could develope different styled AI''s based on what kind of techniques you teach it and what kind of techniques you start it with (assuming an AI that starts with kicks will learn to use kicks more effectively, rather than drastically changing to throws).

I have found that for miss-matched opponents, the weaker opponents only recourse is a brutally explosive pre-emptive strike, no holds barred, no rules. For the equally matched fighters, it''s all about stamina.
Timkin
Timkin
quote:
Original post by capn_midnight
In Aikido, the purpose is only for defense,



That really depends on who you talk to.

Certainly, the modern view of the Aiki-kai has seen the removal of many techniques from the Aiki syllibus that involve disabling/killing ones opponent, as opposed to merely restraining them. This is a shame, because it pushes Aiki further away from its roots and, IMO, away from Ueshiba''s view of what Aiki was (and what it was/is for).

I could go on for hours but I''d only be dragging this thread further off topic. Sorry for taking it this far.

As to the original discussion, personally I think that the answer lies somewhere between initial customisation of a player''s character and advancement based on player decisions (weapons used, attack styles used in combat, training undertaken, etc). Combining this with a skill/physiology based system would give a large amount of variety between characters and make fights less determinate.

Cheers,

Timkin

Iron Chef Carnage
Iron Chef Carnage
What''s NAPMA Magazine? I don''t like to read a bunch of niche periodicals (with the notable exception of American Handgunner), since they''re generally filled with misinformation and extremely arrogant writers (American Handgunner is NOT an exception to this, but the guns are so pretty!).

I just flipped through The Art of Peace, and it seems to me that it, like The Art of War, preaches pacifism through invincibility. Before deciding that true martial arts lies behind the punches and kicks, Morihei Ueshiba studied the mechanics and theory of combat until he was untouchable. If I was that awesome, I wouldn''t fight either. I wouldn''t have to, because everyone would know that it was suicide to take me on.
Timkin
Timkin
Interestingly enough, Ueshiba''s background was in Jiu Jitsu... which is, in fact, the basis of most modern martial arts (although many practitioners of these other arts either don''t know, or wont admit it!)... and was the primary weapon of the Samurai... more so than the sword!

I agree that Ueshiba''s view was most likely the idea of training so as not needing to fight; of being in such harmony with ones environment so that the conflict could be avoided, or the opponent defeated, without the need for a blow to be struck (by either side).

Unfortunately, times have changed. I''m curious to know whether Ueshiba would have maintained his views in the face of the culture of violence we now live in!

Cheers,

Timkin
Metorical
Metorical
I definetly think a lot of the aspects of training could be implemented in nice algorithms.

I'm not 100% sure but this is how I understand what I've read (I'm a physicist not a physician)

Flexbility: When you extend your arm outwards a part of your muscle will lengthen in your arm. At the same time another part will attempt to contract to oppose the stretch. Flexibility training relies on reducing this natural oposition to your movement.

This is certainly a simple case of having a variable co-efficient which acts against the stretch. As you train you can reduce this co-efficient. Possibility of injury can be included as this reflex can only be reduced so much before you start stretching tendons and ligaments (with a typical maximum variance of about 3-5%).

Strength: This relies on a combination of many parameters. There are basically three types of muscle fibres which all react differently. It's quite complicated the arrangement and composition (and how to change it) so this is something I'll leave you to look up. They are in a nutshell slow and fast. The slow ones can employ a force over a long period. The fast fibres apply an explosive force (very great) over a very short time. Lifting a weight repeatedly (e.g. 15+ reps) would utilise your slow fibres whereas jumping uses your fast twitch fibres as it is a very quick action.
Your muscles also have a reaction time. This is basically a measure of how quickly they can change the force applied. e.g.
When you jump off the ground you create an explosive force downwards to propel you upwards. When you land your legs counter this force so you don't break your legs. Professional gymnasts can go very quickly between these two stages (cushioning and jumping) and it can be seen evidently when they touch the mat for only split seconds before jumping again. Try jumping on the spot with that much force at the same speed and you'll see it's very hard to do and relies on training.

You build muscle by breaking it down and allowing it to regrow. You do not build muscle while training! Another common misconception is that you can gain muscle. In reality you are just increasing the quality and size of the muscle fibres (you cannot grow new fibres naturally).

So applying an algorithm to this:

Well you could build the model for improving muscles and flexibility and then give each object a random training pattern. Subject them to this for a set period of time and then assess them by allowing them to fight against each other. Ofcourse the whole fighting bit could become a very complicated algorithm.



[edited by - Metorical on December 13, 2002 10:56:16 AM]
Metorical
Metorical
What about an open ended combat simulation e.g.

The player designs each moves as if he were animating his character. So if I wanted to design a double punch I would set my character up in to the desired stance in the first frame then move an arbitary number of frames forward and move the arm and hand in to a punching position. There are no constraints on the player as to what he designs except for the possible physical positions based on the skeletal system. When the player executes the move in game the physics are calculated on the fly to find the momentum (=>impact strength), muscle strain etc etc.

This would be truely open ended and if they player wanted they could put together more complicated moves.

Important things would include balance and a rating system would need to be invented to consider the difficulties of the moves. The game could also add very slight variations based on the actual training of the move (each punch might represent a generation in the genetic algorithm and then the best ones are selected for the next punch so the move gradually improves?).

Just an idea I''ve had for a while which I''d like to see/do someday. The biggest problem is making a suitable control interface.
Iron Chef Carnage
Iron Chef Carnage
That, of course, would require the player to be a skilled animator. Also, you''d have to put more physical restraints on it than just the skeleton. I could design a one-frame strike that would be going so fast it would crush walls and skulls alike.
Dreddnafious Maelstrom
Dreddnafious Maelstrom
a couple of odds and ends regarding this post:

The feeling you are describing.(where you need not attack your opponent to win.) Is called "supreme confidence" at my dojo. It is a tiny part of a larger philosophy that we use to define our art. Supreme confidence means never cheating in a tournament(rather you can win easily thru application of the rules) as well as not attacking an opponent that you know has no chance against you.

A bit closer to on-topic:

At risk of leaving the player feeling out of control, you could emulate reality and have certain actions be autonomic to the player. For example, after attaining a certain level of repetition the player may always end a certain kick with a quick chopping motion at face level directly in front of him. I know that when i spar if i throw an over-hand right as my last punch in a combo that i automatically throw a tight left hook afterward. Reason being it is an essentially "free" addition whether your right was effective or not.(try it out on a friend, hehe, a very good friend)

Long story short, perhaps consider automating some of the more advanced actions based on the specific state of the two avatars in-game. and base this automation on repetition or training.

my favorite story on Mushashi is how after age 34, he would only use a single wooden sword, never two, and never steel, just a simple wooden sword.(or on occasion an oar from a local rowboat)

Dreddnafious Maelstrom

"If I have seen further, it was by standing on the shoulders of Giants"

Sir Isaac Newton
"Let Us Now Try Liberty"-- Frederick Bastiat
capn_midnight
capn_midnight
Actually, the martial arts (in the East atleast) probably originated from the Greek Pancration when Alexander the Great attempted to conquer the entire east.

Back on topic--Metorical suggested an animation system. For the Playstation there is a game Fighter Maker (it''s sequel is on PS2). It allows you to completely design your fighters style. It gives you quite a few base styles to start with, but if you want to start from scratch you can.

The real problem I see is interface. How do you get the control right? Consoles have done a fairly good job, but trying to get the same functionality out of a keyboard will be difficult.

What about the effect of uniforms? I find that different weights of canvas effect my fighting (lighter is not necessarily better). For some arts, the uniform is integral (Judo, Juijistu) for grip. In Aikido, the hakama (sp?) pants were used to mask leg movement and confuse. So your uniform really has an effect on how you fight.

Any thoughts on weapons?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.