Thursday, December 22, 2011

Funny AI Ethics collection

http://tvtropes.org/pmwiki/pmwiki.php/Main/AIIsACrapshoot

There are some great examples of AI ethical issues in this collection.  All the old chestnuts.

Doomed Game AI Research

The problem with doing research on Game AI is that its all secret sauce.  The AI systems are still considered as a competative advantage so "officially" the source is protected.  The other reality is that they are a "work in progress"... so like most software, they are undocumented and constantly evolving...

This makes studying them at best observational research and at worst like trying to dent water.

Id are about the only company releasing their old game source... although without the assets, so it should be possible to reverse their AI system.  This results in a 10yr old system that has been cloned by eveyone... kind of like game development DNA. And they used scripted AI anyway... so nothing to see there.

The next source is articles and books written by developers and designers.  These are often short, conceptual and neat.  The describe intention and mechanism... and we assume they reveal the "secret sauce"... but in reality the implemtations are going to have their own kinks and twists which don't make it into the article.  Probably not significant but sitll there's a gap between reality and the description which may contain something interesting.

The other side of this is that no matter what the designers intended, emergent systems are by their very nature, a bit unpredictable.  So after all that... observation and experimental testing may be the only way to really document them.  Having the source would make it a lot faster....

But to make the whole observation problem slightly managable we just need more eyeballs... lucky someone invented internet forums to bitch about bad AI... whooot.

E.g Artificial Stupidity at tvtropes. This is a great collection of anecdotes about flawed AI.

Reading this suggests that the "game" is to figure out weaknesses in the enemy strategy... which, when you think about it is the point of any game, even those against a human player.  So are these AI really "flawed" or are they imperfect enough to be satisfying? Do players want an unbeatable opponent? I would think not.  So that only leaves "flawed" opponents... in other words "human", limited, imperfect.... this gets to the question of the type of flaw... will it be a "human" flaw? A Character "flaw"?  So sort of tactical flaw based on not understanding the resources/economy/vehicles/environment?

Do we want the AI to display "human" flaws when they are simulating "things" that are not human?   (How much role-playing do we want encoded in the AI?)

All this gets back to presenting a challenge to a player... which leads to the conclusion that no matter what the AI "should" be doing as far as actually manipulating game elements, it needs to be able to adapt to the players capacity in some fashion.  I shall state it thusly...

Rule 1 of Game AI - Play the player not the game. 

(Reminds me of a line from the movie "Searching for Bobby Fisher")  The player defines the challenge, thus the AI needs to know the player. This gets me back to my on-going rant about modelling the player as the basis of a game AI system.

It's obvious that the vast majority of game developers (99%+ would be my conservative estimate) spend no resources on modelling the player, they simply try to react to the current state of the players avatar or their units and leave it at that.  Pour on a couple of reactive heuristics and some tuning constants and cross their fingers. Or simply have a "Novice", "Middle"and "Hard" settings.  This presents a simple target for the game tuners to work with but also allows the player to exercise some choice about the type of game they want to play "Now".  Sometimes, I just want to blat around in a game without being "Challenged". So I think its important to allow the player to choose their difficulty level in some fashion.  

Reading more of the comments leads to the conclusion that the second rule must be...


Rule 2 of Game AI - Play all the game elements. 

By this I mean that the AI should have heuristics governing all the play elements. In the case where there are dozens or hundreds of different "bits" in the game, the developers have just made a stick to beat themselves with.  Permutation is the enemy.. until they figure out a way to build an AI to write the rule sets for them... Duh!  Computers are there to do the repetative work...

Obviously this starts to bite when the AI is computationally limited and the rulesets exceed the resources allocated.  But even in those situations it should be a case of creating an AI that can decide what to spend that limited CPU resource on... one ruleset to rule them all... lol.

It's easy to see how developers dig themselves into these holes by trying to hand tune games with insane numbers of relationships between game elements. 

Finally, we get to....

Rule 3 of Game AI - Match your players expectations.   

The common thread though the forums is that players expectations are being violated.  It's not that the AI is smarter or dumber or creates wildly un-desirable behaviour (although that's often the end result) but that player "Notice" when the AI does something they think is uncharacteristic.  If they are expecting a smart AI and it acts stupid... tada... forums catch fire.   

So, the big issue is to manage the players expectations.  Tell them before, during and after what they should expect.  Currently, the situation is more that players learn by observation (nothing bad about that) except their learning starts long before they get to most games.  If the game is a strategy game, they have probably seen a couple of movies or read a book or two that have shaped their expectations.  These feed into their expectations of the game behaviour... which is quite reasonable as the game is drawing on those genre's for art and marketing... so its reasonable for the player to carry their expectations into the game.

Am I suggesting that developers should not be ambitious and create games using genre material that the AI is not yet capable of simulating?  That seems a bit limiting... but it would be nice to see the time and energy put into the AI and simulation that matched the quality of the art work, for instance.

I think there is a sense of acheivement when a player figures out (or reads on a forum) an exploitable flaw in a games AI.  Spending the time learning about your enemy, testing them and finally beating them is the essence of competition.  Because of the re-playability of games, they turn into a puzzle that can be beaten if you are persisent. In this case having flaws in the AI behaviour is kind of essential. 

When the AI is not simulating an "Enemy" to be beaten but is trying to generate background behaviour, showing flaws is just wrong. The suspension of disbelief  that the player needs to buy into for the narrative to work is essential and fragile.  Break this and the game is fundamentally broken. The great thing is that players are able to selectivly ignore instances and forgive mistakes and regain their flow given enough other material to continue playing. But multiple, repeated or massive violations drag the game down to a point where it becomes a sham and the player feels foolish for "playing along" with it and abandons it.  Because this kind of simulated life buys into some fairly complex expectations that the players will be carrying into the game, its a particularly hard problem to get right.  


Rule 4 of Game AI - Life is infinitly complex, the players perception is not. 

Resource limits are real in most games so procedural generation is the only viable mechanism for behaviour and art assets when you want to produce complexity. But not all games want to end up looking like "Spore".  So there needs to be some more tools in the toolbox.

Scenario Templating, Procedural generation, Scripts, Rulesets, Heuristics, Skeletal animation + Skins, motion libraries, behaviour libraries, better reaction heuristics, player modelling, AI systems to generate AI systems,  cheating, suggestion, borrowing from the players experience.

Good narrative works by allowing the reader to fill in many of the blanks themselves and just sketches the background.  I feel that most games are able to do this convincingly enough but the question is how to identify and fix the weak points.

More thinking to do.

So whats the linear solution to the exponential problem?

Have the AI do what people do, use feedback... predict the result of their activity, do the behaviour and then evaluate that result, modify their ruleset, rinse, repeat... This simple feedback loop should prevent a lot of the repetative stupidity that I see in the forum posts.  It would also help with game tuning.  Building evaluation critieria is much easier than having a blind ruleset that is context insensitive.

There are some more interesting examples here http://tvtropes.org/pmwiki/pmwiki.php/Main/SpitefulAI


Friday, December 9, 2011

Intermediate Solutions

http://blog.notdot.net/2007/4/Damn-Cool-Algorithms-Part-1-BK-Trees

 I have been thinking for a while about a strategy that I call "The Intermediate Step".  The above link illustrates an example of the idea. By arranging the data in a different way that emphasised a property that was useful for the final solution, they found an efficient way to return a result from what is essentially a list searching problem.

Basically, for problems with no obvious solution, I find its often useful to look for ways to re-state the problem elements before being able to "see" a solution.   This may be (as above) organising the data into a structure that emphasises particular properties of the data that were either in-obvious or poorly structured in the initial presentation of the problem.

These "intermediate" steps are often of no immediate value for solving the problem, but help to explore the problem space.  Sometimes simply by re-stating the problem elements, you can jump to a single step solution, but usually, one or more of these intermediate steps can be composed to form the final solution.

The basic tools that I see recurring for this sort of exercise are:

* Sorting
* Partitioning and Grouping
* Meta data and Indexing (decorating)
* Deriving and Summarizing (reducing)
* Mapping, Translating and Transforming
* Adding edge case data ( Extreme data values, nulls, etc)
* Relating data (Identify implicit relationships, structures or sequences)

By playing with the properties of the data, especially implicit properties, and looking for different ways to re-state the data without damaging it, one of the variants will usually present a much simpler path to a final solution.

Does this mean that "hardness" of a problem may be related to arrangement of data? (I would suggest that this is often the case in the data sets I work with)

I would suggest that any problem where I cannot re-state the data set in a couple of different ways is one that I just do not understand well enough to play with.

Lets see how many seconds before I think up enough examples to undermine this whole post completely.....

Tuesday, December 6, 2011

Strategy for eliminating bullying within organisations

I have been reading a couple of things about bullying within organisations, specifically at Universities and how hard it is to mitigate, treat and elminiate due to the cultural issues.

My question is, is there a generic strategy that can be implemented that will change the dynamic and allow this kind of abusive situation to be cheaply removed from an organisation.


The problem drivers are that individuals who are bullied are unwilling to report it and the organisation is disfunctional in how to deal with it.  (I would hypothesise this is harder in hierarchical organisations... but thats another line of rant...)

Firstly, the idea of using "reporting" as a problem identification process and "correcting" the bullying as a self improvement method... nice in the abstract but hard to implement in reality. 

Another strategy is to make a business case... but that's just foolish.  If there was clarity on the situation the bully would have been fired long since.  



Need to play with this idea a little more to find some better solutions. 


Shuttle Software Process

http://www.fastcompany.com/magazine/06/writestuff.html?page=0%2C0

This is a shallow article but useful on the way software is constructed for the old shuttle program.  Obvious.

Wired Bitcoin article

http://www.wired.com/magazine/2011/11/mf_bitcoin/all/1

Really interesting post on the internals of both the Bitcoin community and the emergent structure of the economy they constructed. 


Boring Information visualisation

http://www.leancrew.com/all-this/2011/11/i-hate-stacked-area-charts/

http://www.practicallyefficient.com/2011/11/25/boring-charts/

These are two short and tasty articles on information visualisation. And some particularly deceptive graphing.

Mesh Topography in networking and life....

http://sha.ddih.org/2011/11/26/why-wireless-mesh-networks-wont-save-us-from-censorship/

Good summary of some of the problems in distributed networks (and a few other technical issues) and some of the "solutions" to using a distributed network as a "solution" to what is essentially a beuracratic attack on the existing network.

This is applicable to networks of self organizing agents, information distribution networks in games and the simulation of information networks in games.

Emergent structure in volunteer organisations

http://daggle.com/closed-unfriendly-world-wikipedia-2853

This is another sneak peak into an evolving organisation.  The post itself is a fun read but the indirect references in the comments lead to better snippits of corruption and trust.

This kind of emergent structure and rules systems (that then get ignored) is fascinating.  Especially if you think about how under siege some Wikipedia articles must be.  Being able to generate a self assembling organisation that can collate and maintain some semblance of structure is amasing.  

The aggregation and politicking over the "rules" suggests some interesting mechanisms at play.  Issues like, trust (that the rules are valid/correct/followed), faith that the rules are coherent and unambiguous, and the embedding within the rules of the domain langauge of accronyms and community dialects.

It would be a fascinating community to study.

Monday, December 5, 2011

Imitation is the most poorly thought out form of flattery....

http://mattgemmell.com/2011/11/27/copycats/

Great article analysing the effects of integrating someone else's design decisions in your product.  Very insightful.

This is especially insightful for the thread that has been running through my head for the past week about iterative improvement on existing game designs.  Similar problem and the same flaws.  Making anything me-to is just dooming yourself to failure on many fronts.

Its interesting to look at the media space after reading this article, with the number of me-to's, franchies and tie-in products... even the same product done across multiple platforms has elements of this kind of failure built in.

The argument that goes... "which is better the book or the film?" is often decided simply by which one the speaker saw first.  The other is always a copy.  It's interesting with the case where there is a movie derived from a book; and you see the movie first knowing that there is a book with a different treatment... its always hard to not see the compromises in the movie that have been made to fit the media and genre conventions.

There is much to think about....

Cheap spies for sale...

http://www.theregister.co.uk/2011/12/01/security_firms_compete_to_sell_snoopware_to_repressive_governments/


There are some interesting aspects to this article about the propagation of technology and strategy from the public sector to the private sector and how the profit motive changes things. Its amusing that the subtext of this article is that "it was alright when it was our government spooks doing all this stuff. But its not funny now its for sale to people we don't like...."  The other fun subtext is the fairly overt China bashing in a couple of places in the article.  If you consider the issue that they have pinpointed these companies in all sorts of countries but take a bit more effort to highlight the Chinese ones... very balanced.  Nice work.  Is it just that China's a new player on the stage?  Is there some sort of acceptance of the dark and secret as long as its British? Anyway... quality journalism...

The more interesting point is firstly just how low the bar has been set for this kind of attack and how its propgating now that the free market is involved.  How many movies and books have predicted this?  Time to dust off your Mirrorshades people.

I seem to remember predicting that market economics would push the botnet business into the legit-ish sphere while the same thing is happening to these tools and techniques... step 1. Commodify it... step 2. Market it... Step 3. Profit.  (Underpants gnome reference...)


Friday, December 2, 2011

Façade and a Rant on Interactive Narrative Systems

http://www.interactivestory.net/

This is an interesting experimental interactive narrative system.  The list of  pubs  looks like some good reading and ends with a bibliography of the same who's who of interactive narrative that I was reading a decade ago.

My first through is... has nothing changed?  They seem to still be trying to generate emergent drama involving a set cast of characters in a sterile environment.  I find it a bit strange that the product is intended to "appeal to the adult, non-computer geek, movie-and-theater-going public".... probably should have made a movie if this was the point.  Sounds like they are fundamentally missing the point of interactive narrative.... if its an art form unlike anything else, then it will need to define its own audience... however, if its an art form that will be defined by an existing audience who already has a well defined taste in a particular media form... why not just stick with that media form?  There is no need to replace "movies and theater", which are at their essence an experience of someone elses story... with an art form like interactive fiction which is an art form that requires the consumer to engage and add their essence to the narrative.

One observation I have made with the various interactive fiction examples I have seen is that very few people are capable story tellers.  Its a skill that takes a great deal of practice.  This is why great writers and poets are celebrated... because they are unusual.  Have a look at facebook or twitter for examples of how few people think in narratives.  Expecting everyone to be able to "bring the magic" to an intereactive narrative is just not realistic.  This will make it a very niche experience for a select few.  And one that will not be able to be shared with others unless its recorded.... in which case the whole system becomes an interactive authorship system for creating movies/stories.

On the other hand, if users are expected to suck at creating narratives and instead the system "takes them by the hand and generates a narrative around them... irrespective of the quality of the players interaction... then the player is essentially just being used as a source of randomness which is being fed into and filtered by a narrative engine which does 100% of the narrative creation.  In which case.... why bother?

If a user is really along for the ride... then my guess is they will figure it out.  The second they do something stupid and the narrative engine "smoothes" it out... they will know they are being "managed".  If the engine lets the stupid into the narrative... then the users suspension of disbelief will be shattered.

This is the flaw in a narrative system that expects the player to inject "talent" as part of the experience.

So how can this

AI Middleware Tools

http://www.industrygamers.com/news/ai-building-smarter-games/

Advertorial on current generation game AI. Mentions some tools.

http://www.xaitment.com/english/products/xaitcontrol/features.html

Another AI Tool Suite.  Seems to be based on Finite State Machines for the AI behaviour graphs.  This is probably fine for the bulk of games where the player is interacting with the NPC for a relativly short period of time, but I would debate if its sufficient for RPG's of any depth, where the player is trying to interact with an NPC, often as deeply as they possibly can, to extract information, engage in trade, form a complex relationship ( or a cheap and superficial one...) a simple FSM is just not going to cut it.  

Radiant AI reviews

Started collecting some commentary on the Radiant AI engine.

http://bitmob.com/articles/dimming-the-radiant-ai-in-oblivion

There are some interesting comments following the article.
This article talks specifically about the choice that the developers of Oblivion made about the AI.  It makes some good points about the problems with emergent systems vs the needs and conventions of a narrative game.  Its interesting to see that when the AI system generated unexpected results, the designers chose the conservative solution of going back to simple scripts rather than trying to fix the emergent system ( which would have been much more fun) 

http://www.somethingawful.com/d/news/asshole-physics-meet.php

This article, although fairly low on results illustrates an interesting point about the AI in games, namely how it can be tested or re-purposed for entertainment.  I think, while this is clearly not in the spirit of the game, it does suggest a functional way of testing emergent AI systems. Act like an Asshole and see if the NPC's treat you like one.  In the case of the version of the AI that shipped with Oblivion... clearly they did not.

http://video.google.com/videoplay?docid=-8900168580155619696&q=oblivion+chapter&pl=true

This is the pre-release demo video for Oblivion showing some of the possibilities of the AI system which did not all make it to release in Oblivion but seem to have been polished for Skyrim.

http://videosift.com/video/Oblivions-Radiant-AI-not-as-great-as-they-said-it-would-be

Another video illustrating how unresponsive the AI can be to events in the immediate environment.


http://www.ttlg.com/forums/showthread.php?t=105339&page=1

This is a four page forum thread about various aspects of the Oblivion AI wins and losses. Some interesting points. 

http://elderscrolls.filefront.com/file/NPC_with_jobs;73212
One of the AI Mod's for Oblivion.   Seems to be a rebuild of some of the generic NPC stereotypes along with a couple of other odds and ends.  Includes source. Very interesting.


http://www.reddit.com/r/skyrim/comments/mqw0h/the_radiant_ai_really_wowwed_me_tonight/

Here are some fun stories from Skyrim about AI interactions.