Saturday, August 27, 2016

Here's a brief summary for my two chapters in Game Engine Gems Volume 3 on developing a framework for building a behavior model that can be be used for programming contextually adaptable game agents. 

Chapter One - A Control System Based Approach to Entity Behavior

Character control and artificial intelligence.

This chapter focuses on a hierarchical control system to model an entity’s AI. While many games’ AI appear to exhibit nothing more than a simple stimulus and response mechanic, more robust behavior can be crafted through the use of control systems, ideally resulting in more compelling game play. Instead of coding for specific behaviors that may break under unknown game situations, we compose a hierarchical architecture of negative feedback systems to minimize disturbances between the entity and the environment, allowing it to exhibit purposeful behavior, even when those
disturbances may be unknown.

And there is also a second chapter that further enhances the base character control framework described above.

Chapter Two - A Control System for Enhancing Entity Behavior 

We’ve all seen games where an alien soldier is running down a hallway, and as
that soldier reaches the end of the hallway, he starts to blend in a turn animation
to change his direction but ends up careening into a wall! Sure, we could have the
level designer make the hallway wider in a vain attempt to fix the problem, but
the real problem is that we’re mixing statically generated assets with behavior
that’s driven or influenced by the game player. We need entities that can react to
these types of situations, and one of the mechanisms that can help us modify that
soldier’s behavior is by taking feedback into consideration in an entity’s control
architecture.

Control and feedback are everywhere in our everyday interactions with the
real world. We perceive and act according to a myriad of feedback from ourselves and the environment as well as social cues. One of the essential understandings we want to achieve is that we want to influence an entity’s behavior specifically by its own output, rather than just brute world queries. We are seeking reliable behavior. Feedback within a control system is essentially perceiving or receiving suggestions about an action that we’ve performed within a specific set of contextual extents and using them in a manner that appropriately modifies an entity’s behavior. What this chapter shows is how we can use a proportional integral differential (PID) controller to influence our entity’s behavior through negative feedback.

Buy it here: Game Engines 3 purchase link

Chapter Three - A Basic Learning Model for Entity Behavior Based On a Control System (WIP)

This chapter focuses on a storage, retrieval and comparison mechanism for categorizing control system disturbances that may be used and adaptively modified in similar contexts.

Sunday, October 27, 2013

Game AI Pro: Collected Wisdom of Game AI Professionals


A couple of brief snippets that provides an introduction to my chapter on developing a framework for building a behavioral model that can be be used for engineering virtual animals or really any in game agent.

A Control-Based Architecture for Animal Behavior

Many games include creatures or animals that exhibit the illusion of life while interacting with the game player and with the world around them. This illusion breaks when a creature does something that seems out of character or unnatural – and these types of breaks in the illusion are unfortunately all too common. Thus we need to provide the ability for our characters to exhibit believable behavior that is purposeful, while being robust enough to appear fully life-like.

... if our behavior is going to be believable then it needs to be more than just the output from a behavior tree or other AI architecture. It requires a system which can deliver the appropriate interactions regardless of the ever-changing situation in-game. If purposeful behavior is going to be believable then it must produce consistent results regardless of varying environmental conditions. This is something that real-world creatures typically handle without much thought, but for an AI character it can be quite hard.

... this chapter provides an introduction to aspects of controller theory that can be used to implement a behavioral system for life-like animals.

Sample Sources/Inspiration

[Hediger 1955], Heini Hediger, Studies of the Psychology and Behavior of Animals. New York: Criterion Books.
[James 1890 ], William James, The Principles of Psychology.,New York: Dover Publications.
[Lorenz 1981], Konrad Lorenz, “The Foundations of Ethology.” New York: Simon and Schuster.
[Powers 1989], William Powers, Behavior: The Control of Perception. New Canaan: Benchmark Publications.
[Ramsey 2009-A] Michael Ramsey, “A Unified Spatial Representation for Navigation Systems.” Proceedings of the Fifth AAAI Artificial Intelligence And Interactive Digital Conference, 2009,
pp.119-122.
[Ramsey 2009-B] Michael Ramsey, “A Practical Spatial Architecture for Animal and Agent Navigation.” Game Programming Gems 8, edited by Adam Lake. Boston:Charles River Media, 2010.
[Ramsey 2011] Michael Ramsey, “An Egocentric Motion Management System.” Game Engine Gems 2, edited by Eric Lengyel,
[Toda 1982] Masanao Toda, Man, Robot and Society:Models and Speculations. Martinus Nijhoff Publishing, 1982.

Sunday, October 06, 2013

Wargaming books, old and new

Interestingly enough since my post about my new AI project - Declaration of Empire(DOE), I've received inquiries asking which books I've found useful in the development of DOE. Instead of listing a bunch of books - here's a picture of some books that have influenced my endeavors both directly as well as simply providing motivation from the early 1960's and 1970's (some of these are reprints courtesy of John Curry's wargaming history efforts - highly recommended).

DOE will include a write-up that includes sources of inspiration for the project. More books to come.

Friday, September 27, 2013

A Tribute to Stellar Conquest via Declaration of Empire

I've been a wargamer my entire life. I enjoy CRT's, shifts, grain analysis, establishing defensive lines, etc. So here's my long overdue tribute to what I consider one of the best games from the 1970's.  I've been putting together this little AI project (Declaration of Empire) as a side project while I develop the technology for a chapter I provided for Game AI Pro: Collected Wisdom of AI Professionals. It's a tribute to Stellar Conquest (Metagaming 1979).

In short it's "A game in which four alien societies invade an unknown section of the galaxy. Each player accepts control of an expeditionary force, which they will grow into an interstellar empire."

While the Declaration of Empire (DOE) has similarities to Stellar Conquest, DOE's AI is quite interesting in that while developing it over the 2013 summer, I've used my accumulated archive of every Stellar Conquest article since the early 1970's to craft the underlying strategies. These articles coupled with some technology that I've developed for the AI engine simply entitled Noumena, make for a game that is challenging and (I'm happy to say) yields a number of late game surprises.

While DOE is being written on a Windows system, it should be fairly straight forward to recompile DOE for either MacOS or Linux with the eventual availability of DOE on Android and IPad tablets. I haven't worked out the distribution method for the initial desktop releases, but it should be reasonable if not almost free.






Wednesday, December 28, 2011

An Egocentric Motion Management System - article excerpt from Game Engine Gems 2

Google Books has provided a generous preview of my chapter from Game Engine Gems 2 describing a character movement solution - aspects of which I used in World of Zoo (PC & Wii). The character movement solution was also used in several demos - including a prototype of a non-zoo type game. The chapter contains a detailed write-up of how how to integrate the character movement system with a behavioral model that conveys perceived intent (section 19.9 A Single Agent Behavioral Response Algorithm and Example). The link to the article is below - enjoy!

An Egocentric Motion Management System Summary

The egocentric motion management system (ECMMS) is both a model for agent movement and an application of a behavioral theory. Any game that features agents (e.g., animals, soldiers, or tanks) that move around in a 3D scene has a need for an agent movement solution. A typical movement solution provides mechanisms that allow for an agent to move through a scene, avoiding geometry, all the while executing some sort of behavior. This article discusses not only how focusing on the agent drives the immediate interactions with the environment but also, more importantly, that by gathering some information about the environment during locomotion, we gain the ability to generate spatial semantics for use by the agent’s behavior system. Portions of the ECMMS were used in a cross-platform game entitled World of Zoo (WOZ). WOZ is an animal simulator that requires various zoo animals to move through their environments in an incredibly compelling manner while the  players constantly alter the environment. So the proving ground for this system was in an environment that could be changed around the agents at any particular moment. In addition to detailing ECMMS I also discuss how to build a unified behavioral model that utilizes technology from all three of my character movement articles.


 
An Egocentric Motion Management System - Theory and an Implementation

Tuesday, December 13, 2011

Qualitative Improvements of Biasing a Routes Starting Position


In this note I'll be discussing how biasing an entities starting position before providing it to the pathfinder, can improve the qualitative behavior of your game's characters. This technique was used on a multi-platform game [Ramsey 2009a].

Generating a route to destination can be parametrized in many ways, but one of the most fundamental parameters has a trickle down effect attune to an avalanche with observable repercussions on an entities motion - if selected incorrectly.

What I'm suggesting is that the start position provided to the path finder is one of the most important parameters to get correct. It almost seems intuitive to suggest that the starting point is "where your at." Well, maybe not so - we need to think temporally. Consider not only our thoughts, but our movement - it's always changing, adapting and what's appropriate at this moment in time is not necessarily appropriate 5 seconds from now, probably not even one second in the future. This applies to selecting a starting position for our animating penguin. We are more interested where it'll be rather then where it's at currently.

The picture below illustrates a simple environment where we have a penguin that wants to move from position A to position B. A typical pathfinder would be supplied with the penguins current position as the start position, and position B as the end point. The problem with this seemingly correct solution is that it fails to factor in any forward momentum of the penguin. Whether the forward momentum is implicit in the animation driving the penguin or an associated movement rate of a simple sprite where the penguin is at (t) is not where it'll be at (t+1).

The penguins directional vector is represented by the light blue line, the pink segments is the path returned if the penguins current position is used as the starting point, and the green segments is the route when we factor in not only the penguins directional vector, but also it's velocity. The yellow bidirectional connections is the graph representation of the navigation mesh.

Depending on how fast the penguin is moving, we bias the start position of the penguin farther and farther away. A simple technique is to attain the penguins heading and magnitude of translation over one frame (t). And then using a standard unit of measurement (r) - I used the diameter of the penguin, you multiply (r*t) = (s). I also experimented with the radius and this worked as well for animals that didn't translate too fast. (s) then becomes a scale that we can apply to the penguins directional vector, with a resulting point in the environment that serves as the starting point for your path finding algorithm. Straightforward and it allows for the continuation of the penguins motion with out any jarring hitches caused by the pathfinder (I had coded up a modified version of A-Star that supported our modeling methods) .

This technique is not only useful in this directed graph representation, but also on typical grids and navigation meshes. I hope you find it useful as using this technique had a qualitatively positive impact on the movement of the animals in World of Zoo.

References
[Gibson 1986] James J. Gibson. The Ecological Approach to Visual Perception. Hillsdale,
NJ: Lawrence Erlbaum Associates, 1986.

[Ramsey 2009a] Michael Ramsey. “A Unified Spatial Representation for Navigation
Systems.” Proceedings of The Fifth AAAI Artificial Intelligence and Interactive
Digital Entertainment Conference, 2009, pp. 119–122.

[Ramsey 2009b] Michael Ramsey. “A Practical Spatial Architecture for Animal and
Agent Navigation.” Game Programming Gems 8, edited by Adam Lake. Boston:
Charles River Media, 2010.

[Ramsey 2009c] Michael Ramsey. “An Egocentric Motion Management System.” Game Engine
Gems 2, edited by Eric Lengyel. Natick: A.K. Peters, 2011.

Further Reading
1. “On the Nature of Things” Lucretius, translated by Ronald Melville is wonderful book expounding the atomic theory first presented by Epicurus. Book I covers the two principles of beingness: that nothing ever came from nothing and that nothing ever returns to nothing. Book 2 discusses the principles of continual motion and how collisions shape the free will. Book 3 covers the nature of the mind, while Book 4 explains the nature of vision, hearing, taste, smell and how aspects of the environment enter the mind. Book 5 and 6 wrap covering mortality and environmental effects.

Friday, December 02, 2011

Noumena Philosophical Canon


While the last post attempted to cover the more concrete canon, this post will list the books that comprise my Noumena philosophical canon. Every project needs an underlying set of principles that help guide the development of not only the final product, but arguably the process in which these systems were built. These books represent some of the core books that provided ideas that contributed to Noumena's process.

1.  The Complete Works of Aristotle, ed. Jonathan Barnes
2.  The Human Touch, Michael Fray
3.  Michel De Montaigne The Complete Works, Translated by Donald Frame
4.  The Phenomenom of Life, Alexander
5.  On the Nature of Things, Lucretius
6.  Being and Time, Heidegger
7.  The World of Perception, Merleau Ponty
8.  Experience and Prediction, Hans Reichenbach
9.  The Phenomenology of Perception, Merlau Ponty
10. The Origins of Knowledge and Imagination, Jacob Bronowski

Noumena Canon

It's been a while since I posted, so here are a few of the books that I consider canon for the development of Noumena. There are literally hundreds of other books that have influenced Noumena in some form or another (I actually posted several years ago an initial list of some of the books) but these few here are the pillars on which a number of my ideas are based upon.


1.  The Philosophy of Animal Minds, ed. Robert Lutz
2.  Animal Cognition, Clive Wynne
3.  Mental Leaps, Keith Holyoak and Paul Thagard
4.  Mindreading Animals, Robert Lutz
5.  Incomplete Nature, Terrence Deacon
6.  Creating a Memory of Causal Relationships, Michael Pazzani
7.  Who Needs Emotions?, ed Jean-Marc Fellous and Michael Arbib
8.  Behavior: The Control of Perception. William T. Powers
9.  General System Theory. Ludwig von Bertalanffy
10. The Principles of Psychology, Volumes 1 & 2, William James.

Hopefully in the not too distant future, I'll be posting an outline for the manuscript entitled, "Fellow Creatures: A Referential Intelligence." It's a book that covers the development of the referentially based cognitive engine, Noumena.