This book describes the architecture and methodology of building animated human-like interface agents that act as and interact with human users to accomplish tasks in dynamic, inhabited virtual worlds. By animated human-like interface agents we mean intelligent autonomous agents with human embodiment and human-level intelligence from low-level reflective action to high-level motivational and emotional behaviour. The book presents a cognitively inspired affective control architecture that marries the traditional deliberative paradigm with the currently prevailing behaviour-based approaches. The distinguishing features of the architecture are that it adopts a cognitive modelling approach based on a highly developed logical formalism and incorporates an explicit computational model for motivations and emotions. To help implement cognitive and affective models, a declarative programming language for knowledge representation, planning and affective computation has been developed, and an animation engine based on the layered animation methodology has been designed, which provides the agent with believable appearance and realistic motions.