Will we be training fencing with artificial swordfighters?

Yesterday when I was browsing SparkFun’s Kickstarter references, I found out about the CLANG project. An American fiction writer, Mr Neal Stephenson, basically looked at the level of detail contemporary video games provide when it comes to firearms and thought to himself hey, why don’t swords get the same treatment?

He probably found the answer pretty quickly: because it would suck. Pushing a rubber button on your keyboard or gamepad doesn’t really leave you much space to show off your fencing finesse, and there really aren’t any play styles to choose from. Most often your only option is to walk next to the dude you don’t like and press the button until he keels over.He decided to fix all of these problems. How is he going to do that? Crowdfunding a project on Kickstarter is just the beginning.

CLANG-kickstarter

simulator

Watching that video reminded me of a diploma thesis my friend Jaro defended a year ago.[1] It was a fencing simulation in 3D. But not just any fencing; the attacker chose various kinds of thrusts and lunges to hit a poor, defenseless opponent, which utilized an artificial neural network (NN) capable of learning. And the longer the defender got beaten up, the better he got at deflecting the attacks and “generalizing” from the acquired knowledge along the way. In non-technical terms this means that not only did the defending trainee get better at defending against the moves he got hit by before, he also caught the ones he never saw.

Now this could prove to be quite a combination. Jaro managed to improve an existing algorithm, so the learning was quite fast. But in this scenario, the opposite might be better – it might be too difficult for a human to try to outperform the learning speed of a NN. If handled right, this approach might give a real feel to the game. You could train with an NPC friend. Or you could have a nemesis that gets better each time you fight him, adapting to your style. You could be frustrated of being defeated consistently. Great, right? Just like real life.

simulator-2

The speed of learning (text is in Slovak). The X axis shows the number of trainings, Y shows the number of errors. This is a comparison of 2 approaches – CACLA is the original algorithm, MCACLA is Jaro’s modification. And he once said he has one even better algorithm, but doesn’t plan to publish it just yet.

Of course, the bot wasn’t made to train with as many nuances as there are in a real swordfight. I’m not sure it would even be feasible to train the robot well enough to give the player a fair challenge, while still maintaining the realistic behaviour and finesse Mr Stephenson is aiming for. But in the long run, I guess it’s just a matter of time before I get my posterior handed to me by a bunch of numbers.

Note: all the images are taken from *Blanář, 2011: Simulácia šermu v 3D za pomoci metód umelej inteligencie. Only available in Slovak language.


  1. Now that I think about it – we both did a simulation for our theses. They just were totally different kinds of simulations. :) ↩︎