AI will be the most important advance in RPGs.
seismologist said:
I'm thinking that turn based RPG's must be among the least CPU intensive games out there.
With little in the way of AI complexity so a game like this where most of the game code runs on the PPE. What would be the most likely use for SPE's in this scenario?
Extension of the GPU? lighting? vertex processing? any thoughts?
Why do you think more complex AI would not be beneficial to RPGs? I think that improved AI will be the most important advance in RPGs in future, rather than graphics or physics improvements.
Current games use primitive code branch based top-down pseudo AI, because of the procedural, single threaded nature of conventional CPUs. The AI is simple and predictable because it consists simply of traversing through a fixed set of states (mirrored in code branches) depending on decisions taken. This is predictable and has a limited number of states, because it has to be programmed in explicitly by the programmer. It is also limited because it is inefficient due to the fact that the logic state is stored in the program counter and requires long branches (forcing the instruction cache to be flushed), and hogs a whole execution thread. It is pseudo-AI because it isn't really AI at all, just something that has the appearance of intelligence. It is comparable to the LISP based talk programs of the 80s, which would take text you type in and try and give a response by identifying grammar and switching verbs and order to pose a question. It seems intelligent for a very short time and then becomes infuriating because of it's limited response capability.
There is another way of doing AI, one which the SPE is ideally suited to: neural-network type AI. Examples of this type of AI have recently been demonstrated in the crowd behaviour demos.
Neural network type AI involves treating the logic status as data in a logic table and processing it as data with boolean operations rather than representing it by the position of the program counter. This has a number of advantages. You are not limited to one logic status per execution thread as you are with procedural AI - you can have thousands of logic states by creating thousands of logic status datasets each associated with a different object. You can process the logic datasets using vector processing to some extent by using branchless boolean algorithms. You can load and stream process the logic states of objects in turn, or distribute them to a number of SPEs to process them in parrallel. Branches are short and can be limited to a large extent by using branchless algorithms that store the results of what would otherwise be branches as boolean flags in the data in the logic tables instead for later action. The SPE is perfect for could have been built with this type of AI in mind. Also for complex AI, neural network type AI is much easier to program, because the programmer just has to program the (relatively simple) rules for each object, and then turn them loose to interact with the environment and with each other in complex ways, rather than having to program explicitly for all outcomes in the entire environment. Unlike procedural AI, this is real intelligence. Take the crowd behaviour demo for example, the programmer has defined how each person in the crowd should behave, and he/she can put each person in a particular place, but unlike procedural AI, there is no way he/she can predict where they will end up - the darn things have a mind of their own, and there is an almost infinite number of ways things can end up. What neural network type AI really is, is a realtime simulation of a complex network of interacting objects based on rules specified for the objects by the programmer. You may of course have more than one AI object to a physical object. For example the human mind may have an emotion AI object, a conscious AI object, a sub-conscious AI object, a desire AI object, and a conscience AI object, all interacting with each other and with the environment. Another possibility is interaction of AI objects over the Internet in a truely massive environment.
In Cell, you would probably run procedural AI on the PPE to do overall game AI, but the SPEs would handle the AI of individual objects in the environment.
As far as a RPGs are concerned, instead of the boring and predictable navigating through a finite set of possibilities, the neural network type of AI could allow far more immersive and complex RPG games than we have now. It would drive the "cheat" bloggers mad though.
There were some old discussions on this in the IBM Cell forums
http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=739&thread=93069&cat=46
http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=739&thread=103263&cat=46