Article
files/productionline

Will Reusable AI Bring the End of Original Game Behaviors?

Alex J. Champandard on December 11, 2007

This week’s developer discussion is about reusable AI, including the underlying engine and the logic itself. Does using middleware, or even sharing AI scripts and data across different games mean that they become mass-produced simulations without a soul? Let everyone know what you think by posting a comment below.

The subject of reusable AI engines came up in the panel on next-gen AI at GDC in Lyon. At the time, I felt there was generally a consensus that AI engines are already very prominent and will quickly become unavoidable in the future. Of course, it helped that the two other guys on the panel work for middleware companies, Axel Buendia is CTO at Spirops, and Pierre Pontevia is the CEO of Kynogon.

The argument in favor of reusable AI engines is easy to make:

  1. AI developers are becoming much more comfortable building data-driven systems based on existing algorithms.

  2. It’s now possible to implement tools and frameworks once and reuse them in different places (e.g. animation).

  3. It’s becoming increasingly hard to build good AI systems from scratch as more work is involved.

No doubt there are many more arguments in favor of not reinventing the wheel. But a reaction of one of the attendees of the panel got me thinking. He said something along these lines (I’m paraphrasing heavily):

“I’m not sure I agree with you on the benefits of reusable AI engines. All the games could end up playing in the same way!”

Now there is a big difference between reusing a set of algorithm and tools, and reusing the whole logic. Typically these days, the whole AI logic is only reused for sequels, which are intended to play in a similar way as the original. However, even reusing technology has the danger of removing the creative touch from the AI:

  • By using a the same standard algorithm, you encourage the same approach to developing AI — which may result in similar behaviors. For example, as Mark Rein said about the Unreal engine [1], nothing is restricting games based on Unreal to appearance the same. However, there’s a lot of experience in building games that look like that, so it’s easier for developers.

  • AI developers haven’t fully agreed on a good way to implement behaviors yet. Sure, scripts, state machines and planners are common, but they all have their flaws. So reusing this technology will most likely limit the capabilities of the AI itself. In the past, the games with the best AI have always been custom developed.

What do you think about this? Can you think of any other ways that reusable AI engines may cause games to become less original? Join the discussion.

Discussion 13 Comments

Ian Morrison on December 12th, 2007

I think the concern about having behaviours be the same is unwarranted. For starters, if the components can all be plugged together in a new game without having to tweak them for the new mechanics, then the gameplay itself is not any different. At that point it's a game design problem, not an AI one!

Sergio on December 12th, 2007

I guess the point of the discussion is how to create a piece of AI middleware that is useful in practice (i.e. actually saves an important chunk of time/resources) and doesn't limit the game to "standard behaviours", thus lowering the quality of the design. Nothing's easier than grabbing the example behaviours from a middleware package and shipping your game with just those. But nobody will want to play it. Naurava, IMHO building just very base tech is not really that useful. Either you don't know how to write it yourself, in which case you'll be hard pressed to use it, or a basic implementation is not really that hard to write. As they say, the devil is in the details. Writing an A* algorithm takes hours if you've done it before, so that's not useful middleware. A complete pathfinding solution will either box you into a standard movement solution, or be extremely complex and unwieldy. And you want your characters to be able to open locked doors, or respect traffic signs, or jump down building rooftops, or over cars, or fly, or... All those are hard to generalize problems, so games end up with custom solutions. I believe the real ROI comes when middleware delivers mature tools. Even if you can write the basic algorithm and you understand it perfectly, getting a fully-featured, interactive tool can be a big productivity boost. It could be an offline process to automatically generate a pathfinding search structure, or a flexible behaviour authoring interface, which can run in parallel with the game and has a powerful integrated debugger. Those are valuable, and won't lead to identical games. You still have to do all the hard work of developing the game itself, but hopefully the environment will be friendlier.

bibiteinfo on December 12th, 2007

I think AI is a bit like 3d graphics at the start. I was too young to know exactly what was going on, but if what I've heard is true, at the start everybody was doing there's engine from skratch. Now, there's still some companies that do a new engine from skratch ( Unreal, Crytek, etc. ) but most companies will go with middleware solutions. Is graphics and AI so different? AI just didn't get as much effort as graphics by the game companies over the years. It's easier to sell a visual quality then an AI on a box. Both have algorithms that are needed to work into the game. Typically in a graphic engine you will have an abstraction of the vertex to make a mesh, and with a set of mesh you will do shaders. No matter how well the code is done, if you have poor assets, the visual quality will be bad. Going back to AI, the goal is to have an AI engine which would need input and the results would be as good as the input. The behavior would be as good as the input. Similar to graphics if AI engine where more advanced, making the input would not be easy and should be a job on it's own, giving that to an AI designer ( I guess it exist in big companies ). You wouldn't want that the AI designer know how to write a pathfinding, it should be a characteristic that the AI designer can twist. Say that FSM are the equivalent of 2d graphics. 2d graphics where good in the 80's with Mario, but now in most games you won't see this type of graphics. FSM are just a bunch of conditions to respect, giving no real Artificial intelligence to the character and it's too easy for a player to guess what the computer is going to do next. That does not give an human taste to the AI. Why do we still suffer FSM, no matter how complex is the FSM? Because there's a limit to possible innovation when you always need to start from skratch. I read in the FEAR review that has been done on this site that when you kill everybody in the room, there's a call for reinforcement, but they never come since you will move and see others and think that those are the reinforcement. Do AI developper take players as dumb or what? When you play the game, it's such an idiot statement that you laught out of it. Why in this breaking AI game, there's such things that seem so retarded yet? Maybe there's some miss in the AI design. It's like having a Gears of war model into mario world, it just does not fit. So in FEAR, they took a lot of time creating again the wheel to come with breaking AI, but maybe forget to make everything coherent. I'm new to AI in general. One thing that really surprised me is how much coupling there is between the AI and the animation system. I think that if as much effort would have been put on AI than on graphics, we would not think the relation between AI and animation the same way. Animation by default would all be created AI driven, you won't have animators and AI guys trying to talk together to make something work, it would be the person who create the animation who is the AI animation guy. It would be the AI designer. I know there's some research going on in this field. Again the reason is that we start everything from skratch always. There's no major difference between mario walking in his world and the gear of world guy walking into his world. Both needs to walk. The difference is in the input. With good inputs, Mario would jump a funny way down the slope and the gear of war guy would go down the slope a virile way. All in all, what's missing for AI are tools to tweak, test and debug the AI. To get to that, we need to have some kind of standardization. We would need something like DirectX and OpenGL for AI. An abstraction of everything which is common to the AI. Then from that, Engine could be written which could exploit the fully potential of the standardization and having some taste of differents AI. With those standardization you could start to write tools that could help a lot of people in the field. With the tools, less programming would be needed and designers would have a bigger liberty to design the game and make it fun.

bibiteinfo on December 12th, 2007

I've written a complete discussion on the state of the AI compared to graphics, but there had an error with the website and my post did not get to the page ... I don't have motivation to write it all back. To answer to Sergio, mainly my point is that as today we don't have enough the mentality of having AI designers. AI middleware should be like for a graphic artist, tools for creating something beautiful. The solution to have a complete pathfinding which solve everything in a standard way should be easily tweakable so that you can put your own taste to the pathfinding. Everything is in details as your telling, so let an AI designer do it. What I was telling is that there should be some standardize model in AI as in graphics like OpenGL and DirectX. Everybody start at a minimum from there. Then there's different flavors which are engine built from there. In AI we try to create an engine to tweak behaviors and an abstraction layer of common problems. It's like too big to be handled well and go a step further to make innovations. It's only once you've got a working engine that you can create tools around it. AI needs tools, but they are mostly not existing since everybody start everything from skratch always. Once tools will exist, designers will have possibility to tweak everything to make it cool. On the other part, programmers could get further, innovate and let designers controls the basics.

Veksi on December 12th, 2007

Ian, yes, a good point regarding game design. I'm not aware specifically what the original point of view was. Perhaps there could be a possibility that some choices let the game always to converge towards some specific and distinguishable outcome. Sergio, I was thinking that there should be commonly occurring algorithmic problems that are difficult to solve even for the more experienced of designers and implementers and consequently pre-canning some of the would save considerably time and money, especially in maintenance. Though, I've let to believe, as you point out that especially heuristics like A* are extremely game and implementation specific. As you mentioned, the real boon will be the tooling support, since that could be a serious time (and nerve) saver. I could imagine designing artificial intelligence requires quite an amount of iteration, processing and simulation off-line to get the desired results. With AI middleware and tooling also more standard interfaces start to evolve and emerge and perhaps better industry insight for structuring solutions will be gained. With more pre-defined interfaces, interactions to other sub-systems could be improved. I wonder if it's just my too high-flying imagination, but would it be fruitful to think games as driven by the AI system -- so that the engine is mainly an AI system driving the other systems?

mihaic on December 12th, 2007

IMO, it is less probable we will see games that look and behave the same everywhere if the AI logic gets reused. I think that what actually sales a game title is the originality, the story and the gameplay, so the studios will have all the necessary motivation to make their title different even if they decide to reuse AI logic. From a technical point of view, general purpose algorithms would indeed be useful, perhaps even some data would be useful. For example I saw that EA had a collaboration with Porsche for their latest title, "Need for Speed: Pro Street" in order to gather real time data for their car models. I think such thing would be useful to have around and reuse, after all a Porsche behaves like Porsche regardless of the particular car you are looking at. What I am trying to say, is that this would make some behaviors more consistent which doesn't necessarily is bad. Also with the development of more emergent behavior algorithms, we will witness new behaviors spawn each time the algorithm is used, given specific context conditions. So yes, AI is still in its infancy but I think reusing certain things will lead to progress in this domain and improvements will start to appear because more time can be invested into research and in the improvement of the reused logic instead of wasting it on rewriting the same thing over and over again.

Sergio on December 12th, 2007

It's just wishful thinking to say that AI can be solved and encoded in an OpenGL-like API for everyone to use. First, OpenGL and Direct3D only cover the lowest level of the graphics engine. Games still need loads of graphics programmers and custom tools, and most of those programmers wish they could go even lower, but they need the API to interface with the hardware. Second, generic AI is not a realistic idea today. Not today, not for many years. It's not possible to build even a simple pathfinder that can be reused without modification or custom functionality unless the requirements are exactly the same. Which would lead to the whole point of this post: identical behaviours across games. If someone is able to build this generic all-purpose OpenAI toolset, then they might become the new Bill Gates. But us game developers are a picky bunch. Even when we do use middleware, we heavily modify it precisely to avoid falling into the mediocrity trap of using the same engine everybody is using.

Sergio on December 13th, 2007

I have some experience with Kynapse myself. It's a good product, but it will only provide you with a basic pathfinding and terrain representation technology. You are essentially on your own for the whole behaviour/decision-making part of the AI. And even if all you're looking for is pathfinding and movement, you'll have to implement yourself most of the complex interactions, like handling doors or jumping. I would also love to see AI middleware leap forward and funding and research increase for AI. I celebrate sites like this one that make AI technology advance. But I'm also pragmatic. Right now, right here, there is no AI middleware that's even close to fulfilling the expectations that people are posting about. And focusing on an all-encompassing solution is the wrong approach, because it's so damn hard. Let's look instead at what can be useful right now (in my case, I believe it's authoring tools) and move forward from there.

Jare on December 13th, 2007

I will begin by saying that I believe truly useful AI middleware is a matter of when, not of if. The question then becomes, what is necessary for that "when" to arrive? - There are no commonly accepted primitives for AI, like there were for graphics (sprites, polygons, textures, shaders) or physics (rigid bodies, forces, collision volumes, constraints). AI has some broadly common techniques (FSMs, BTs, NNs, pathfinding, perception, etc), but they are fairly high level, structural concepts, like "scene graph" would be for graphics. The implementation of two FSMs can be as broadly different as the implementations of two Scenegraphs. Standardized graphics middleware begun at the low level with APIs like OpenGL and polygonal 3D modelling packages, and then moved to fully featured graphics engines like Renderware. It's interesting that physics arrived at this stage rather quickly, in no small part thanks to piggybacking on the work in mathematics done by the graphics industry (algebra, intersections, parametric surfaces, polygon meshes, etc). - The amount of manpower (i.e. money) spent on graphics has typically been a huge % of the game development effort, and this naturally encouraged adoption of standard notations and primitives. AI effort has comparatively been much lower, and often the "good enough" (for sales) point is reached much quicker. Physics had an interesting thing here, in that whereas building the physics of a specific element (say a ballistic projectile, or inertial movement) is fairly easy, the next step of integrating multiple physical objects interacting robustly proved extremely hard and costly to derive and develop by an average programmer. - Development of graphics and physics has been able to benefit from the research and implementation efforts in fields outside games: visualization, CGI, robotics, simulations, etc. The application of AI in these fields is, in comparison, much more specialized: data mining, OCR industrial & vehicle controllers or market analysis, all deal with very domain-specific problems. The AI craze of the 70's never materialized, and games are arguably solving the most sophisticated general-purpose AI problems today. No standing on the shoulders of giants, WE are the giants! I think ultimately the standardization and adoption of AI primitives and algorithms will be driven by a critical mass of development cost (of building algorithms, engines, and tools for asset creation). And I feel that we are very close to reaching that critical mass. At that point, the advantages and uniqueness of roll-your-own AI in many cases will be offset by the cost-effectiveness of prebuilt packages, and developers will start accepting and working with the limitations inherent in middleware packages. Adoption and real use cases will breed more polished and solid solutions, and the snowball will roll downhill.

Veksi on December 13th, 2007

Jare, I'm not sure what you mean by solving general purpose AI problems, but there is a very good reason on having the existing solutions to be very domain specific: they wouldn't work otherwise. Incredible amounts of studying have been done to create the very fundamental structures supporting machine learning or any computation for that matter. The problem is that one soon comes across intractable problems (e.g. class NP, something comparable or even more difficult) or that many interesting problems are inherently unsolvable by the currently most widely accepted model of computation, the Turing machine. That doesn't mean we couldn't -- or shouldn't -- try to stitch together the solutions created in other domains or that we shouldn't try to pursue specific solutions to problems in specific domains yet to remain unexplored and stitch these together. The aforementioned tooling support to be used to solve some domain of problems would be a good start. I also think, as you quite correctly pointed out is that (game) AI lacks a clear consensus on which problems should be solved in which domain, solve them and then parameterise for good use and stitch the different domains together. This again would reveal something new about the fundamental structures that should be strengthened.

Dave Mark on December 14th, 2007

I'm a little late to this discussion so much of the good points have already been said. One thing that I would like to add, however, is that the individual who made such a statement as Alex reported should simply have been kicked out of the GDC. If the harbors such little creativity and insight to posit that the tool determines the product, he had no business being there in the first place. At the very minimum he should have received a lot of flat, unbelieving stares. And Jare hit it on the head, btw. Until we establish a set of standards for environment representation, we are going to have a hard time coming up with a one size fits all tool anyway. Ironically, the risk is that standardizing objects, behaviors and environment parameters may actually do more to homogenize AI than the AI middleware would.

Jare on December 18th, 2007

"I’m not sure what you mean by solving general purpose AI problems, there is a very good reason on having the existing solutions to be very domain specific" Oh, absolutely. I'm not passing judgement, just saying that this aspect of AI work has consequences. Games AI tends to be more "general purpose" in two ways: - they deal with levels of intelligence ranging from individual low-level behaviour (instincts?) to high-level group coordination and long-term planning and strategy. - they try to not just solve a problem but also "look and feel" natural and believable. That's of course a big generalization but I think it's reasonably valid.

Veksi on December 24th, 2007

Yeah, I thought that's what you meant, but somehow I managed to write a rather poignant comment. Not my intention. :-) (P.S. I was Naurava kulkuri.)

If you'd like to add a comment or question on this page, simply log-in to the site. You can create an account from the sign-up page if necessary... It takes less than a minute!