Live data from Hacker News

Street Fighter II's AI Engine

sf2platinum.wordpress.com

41–50 of 88 posts

Re: Street Fighter II's AI Engine

#41
post #34

> Anyone looking for some insight into how to write an AI engine for a game today will be disappointed. And yet, it was really effective and fun. This is like a magician revealing how a trick was done, it's always a "letdown".

Well you are in luck because in a major sense, deep learning AI cannot reveal how the trick was done unless you are willing to speak in terms of a model with trillions of variables and feedback loops.

Re: Street Fighter II's AI Engine

#42

> These days, when most people talk about AI they’re talking about machine learning. There’s not any of that in SF2. Actually, AI for games is pretty much never equivalent to AI for non-games. The end goal is different - games want to provide a non-optimal set of instructions, so that it's challenging but not impossible to win. The goals are entirely different. If you're making a game, this is probably at least a use…

(uninterruptible moves, for instance)

I bet this was done to decrease the complexity of the script flow. Otherwise, you'd have to provide for the interruption cases.

Re: Street Fighter II's AI Engine

#43
post #11

That's pretty fun, thanks for sharing ;) Actually with a machine learning approach it's not immediately obvious to me how to incorporate it. I suppose an RNN or reinforcement learning could be used, in principle, to learn good reactions to a given sequence from the opponent, but it would take so many failures to train it, which would have to be generated more or less manually. I don't see how it could be done easily,…

There have been some attempts to apply ML to NPC control: sometimes to learn how to beat the player, sometimes how to mimic them (Forza), sometimes to learn what player wants done and assist them (B&W). But none of them have crossed the chasm from novelty to killer app. The main difficulty with combat AI is that players enjoy mastering a game and beating it. And if the game keeps getting better and beating them inste…

Yeah I think that's a very interesting aspect. If you want, I think this speaks to a more general point about AI that I have thought about sometimes. I suspect that we enjoy interacting with machines and using machines when we understand them, and that this understanding of how a machine operates, its capacity and its behaviour, is similar to the "theory of mind" idea that we employ a model of another person when interacting with them. That is why it is so frustrating to work with a machine that changes as you use it -- it's like trying to shoot a moving target.

I really suspect that ML will find its place in helping design machines that are then static, but ML that adapts as we use it will be frustrating to work with. At least until we develop, as a society, some kind of "theory of mind" of AI, where we learn how to expect a machine to adapt as we use it. But we are not there yet.

For now, machines are still better when they act like machines. That is why I think, for example, society adapting to the presence of things like ubiquity of self-driving cars is going to be a long and scary road.

As for video games, it seems like a computer-controlled character should be somewhat predictable, even if complicated. When the ML algorithms adapt, it should present a new character to fight, not adapt an existing one that the player has already "theorized" (i.e. figured out its pattern.)

Re: Street Fighter II's AI Engine

#44

That's pretty fun, thanks for sharing ;) Actually with a machine learning approach it's not immediately obvious to me how to incorporate it. I suppose an RNN or reinforcement learning could be used, in principle, to learn good reactions to a given sequence from the opponent, but it would take so many failures to train it, which would have to be generated more or less manually. I don't see how it could be done easily,…

Colin McRae Rally 2.0 was released back in 2000 and used offline learning to train a driving model. Here's an interview with the engineer that made it: http://www.ai-junkie.com/misc/hannan/hannan.html

In this modern day and age grabbing telemetry from multiplayer matches might be a good way of getting training data. Particularly for games that already measure player skill. For example creating AI for Hearthstone that played like each of the skill tiers. Periodic retraining on up to date data could then keep up with things like changes in the metagame.

Re: Street Fighter II's AI Engine

#45
post #16

I wonder if one can create an invincible AI for Street Fighter II. One that obviously makes the right choice always and can counter every possible human attack. (kind of think that it was also possible even back in the 90s, but never implemented; what would have been the point?)

One interesting thing about street fighter 2 is that all of a the character's basic moves are different. I've learned from playing street fighter 2 that one matchup has a sort of bug, Zangief vs Blanca. Zangief requires to be close up to hit someone. Blanca's hard kick in the air has a long reach.

I've figured out that if Blanca jumps straight up and does a hard kick when zangief gets close, there is literally no way for zangief to hit Blanca. You can do this on the hardest difficulty and beat zangief perfectly.

This presents a problem for a perfect AI. The perfect AI would need to know not to get so close to Blanca as Zangief and at best could only let the time run out during that matchup.

Re: Street Fighter II's AI Engine

#46
post #45
post #16

I wonder if one can create an invincible AI for Street Fighter II. One that obviously makes the right choice always and can counter every possible human attack. (kind of think that it was also possible even back in the 90s, but never implemented; what would have been the point?)

One interesting thing about street fighter 2 is that all of a the character's basic moves are different. I've learned from playing street fighter 2 that one matchup has a sort of bug, Zangief vs Blanca. Zangief requires to be close up to hit someone. Blanca's hard kick in the air has a long reach. I've figured out that if Blanca jumps straight up and does a hard kick when zangief gets close, there is literally no way…

You can beat him with any character. Jump away from him and kick constantly and you will win

Re: Street Fighter II's AI Engine

#47

"Charge moves such as blade kicks are simply executed as instructions, so they cannot fail. Guile can do a bladekick from a standing position simply because that’s what’s in the script." That's a pretty big cheat, to be honest.

Welcome to the frustrations of my childhood.

I sort of neat trick is during a dump you can be holding down to charge your "blade kick"* and immediately when you hit the ground, press up and kick to execute the move, and it gives the appearance of one of performing the move without charging. Sometimes gets a surprised look by your opponent.

* we called it a flash kick, but whatever.

Re: Street Fighter II's AI Engine

#48
post #23
post #3

I wonder if knowing the different strategies would make pro-humans better at playing the game. I feel like they might already have internalized the different strategies the computer uses, but still pretty surprising to see how simple the source code is. Also cool to think about would be AI-vs-AI street fighter competitions. Or SF AI that learns from live matches currently being played online.

> AI-vs-AI street fighter competitions http://www.saltybet.com/ does just that.

That's awesome. Next-gen betting - on AIs! :)

Re: Street Fighter II's AI Engine

#49

> These days, when most people talk about AI they’re talking about machine learning. There’s not any of that in SF2. Actually, AI for games is pretty much never equivalent to AI for non-games. The end goal is different - games want to provide a non-optimal set of instructions, so that it's challenging but not impossible to win. The goals are entirely different. If you're making a game, this is probably at least a use…

(uninterruptible moves, for instance) I bet this was done to decrease the complexity of the script flow. Otherwise, you'd have to provide for the interruption cases.

I asked the blog's author and he said hits do interrupt scripts. Aside from that, more complex scripts intended for higher difficulty have explicit conditional branches after moves to allow for blocking and counters. The triple fireball script example is for "easy Ryu", so it's intentionally dumb/non-reactive.
Post reply on HN