Kynapse User Guide
Total Page:16
File Type:pdf, Size:1020Kb
SDK Release 3.8 Published Friday, June 24, 2005 Copyright © 2000-2005 Kynogon S.A. All rights reserved. Kynapse powered by Kynogon SDK Contents Kynapse User Guide 5 Introduction 6 Getting started 7 What is Kynapse? 8 Purpose of Kynapse 9 Design philosophy 10 Kynapse specs 11 Using this documentation 13 Typographic conventions 14 Finding information 15 Programming Guide 16 Kynapse 3.7 to Kynapse 3.8 migration guide 17 Getting started with Kynapse 18 Fundamental principles 19 Behaviors 20 How behaviors are generated 21 Kynapse architecture 22 Architectural overview 23 Kynapse layout 25 Simulation engine integration 26 Main objects 27 AI engine 28 AI world 29 Entities and entity attributes 30 Actions and action attributes 32 Brains 33 Agents 35 Services 36 Teams 38 Pathfinding constraints 39 Pathfinding heuristics 40 Pathobjects 41 Main data structures 43 Resources data structures 44 PathData 45 Pathways 47 Configuration data structures 48 AI engine configuration parameters (CParamBlock) 49 AI world definition 50 Entity definition 51 Core management 52 Time management 3 Kynapse powered by Kynogon SDK Exact time measurement 55 Deterministic time measurement 56 Time management sample code 57 Memory management 59 Object management 62 Data management 63 Initializing, updating and terminating Kynapse 65 Overview 66 Initializing Kynapse 67 Updating Kynapse 69 Terminating Kynapse 70 Kynapse coordinate system 71 Using Kynapse standard components 72 Creating and customizing Kynapse components 73 Configuring Kynapse 74 Generating pathdata 75 Common topics 76 Integration helpers 77 Tools 78 Reference 79 Glossary 4 Kynapse powered by Kynogon SDK Kynapse user guide Welcome to the Kynapse 3.8 user guide (online LIMITED version)! New to Kynapse? If you're new to Kynapse you should start reading: • The introduction (p.6). (Available) • What is Kynapse? (p.8) (Available) • Getting started with Kynapse (p.18). (Available) Already with previous versions of Kynapse? Learn about migrating from Kynapse 3.7 to Kynapse 3.8 (p.17) (Not available) User guide content The API Reference contains the following sections: • Introduction (p.6): introduction to Kynapse and the Kynapse user guide. (Available) • Programming guide. (p.16) (Available) • Getting started with Kynapse (p.18): introduction to the Kynapse design philosophy. (Available) • Using Kynapse standard components (p.17): basic use of Kynapse. (Not available) • Creating and customizing Kynapse components (p.17): advanced use of Kynapse. (Not available) • Configuring Kynapse (p.17): to quickly set up Kynapse. (Not available) • Generating path data (p.17): learn everything about Kynapse data generation process. (Not available) • Common topics (p.17): learn how Kynapse can be used for implementing typical game behaviours. (Not available) • Integration helpers (p.17): to quickly and easily integrate Kynapse. (Not available) • Tools (p.17): discover Kynapse tools. (Not available) • Reference (p.17): standard C++ reference doc. (Not available) 5 Kynapse powered by Kynogon SDK Introduction Welcome to the Kynapse User Guide. Kynapse is a powerful AI library. This user guide is aimed at helping newcomers to Kynapse become familiar with the product. Kynapse is the result of many years of development, which began in 2000. The power and flexibility of the product has been increased with every release. Kynapse is a multi-platform Application Programming Interface (API), which is constantly being improved and updated to keep it at the cutting edge of AI. If you are new to Kynapse, it is strongly suggested that you read this user guide as you go along to acquaint yourself with its operation. If you have already been using Kynapse for a while, you can also find a lot of help here. The user guide is written by the people who created the library, so you can gain new insights, tricks and tips. Additionally it has been revised and expanded to cover all the latest new technology. Read these sections if you are new to Kynapse. • Getting started (p.7) • Using this documentation (p.13) 6 Kynapse powered by Kynogon SDK Getting started You should read this section if you are new to Kynapse. • What is Kynapse? (p.8) • Purpose of Kynapse (p.9) • Design philosophy (p.10) • Kynapse specs (p.11). 7 Kynapse powered by Kynogon SDK What is Kynapse? An AI SDK Kynapse is an AI (Artificial Intelligence) SDK. It is used by programmers to create real-time AI applications, such as computer games and simulations. Multi-platform Kynapse is a multi-platform, portable API that allows high level functionality to be achieved on all platforms, with platform specific optimizations to get the best from the hardware pipelines. Kynapse is available for Sony PlayStation 2, Microsoft Xbox, Nintendo GameCube and Microsoft Windows. Customizable Kynapse has a component-based approach to its architecture based around a small-footprint, thin-layer highly-optimized core library, supplemented by a number of customisable components. This component mechanism is fully exposed. You can write components or extend existing ones, for your own requirements - in fact you are encouraged to do so, as we do not claim to have thought of everything! 8 Kynapse powered by Kynogon SDK Purpose of Kynapse From a general perspective, a game can be structured as follows: Typically, the game is built around a game engine that is the core of the game application. This game engine manages all aspects of a game (interface, rendering, network, and so on) and is fed with data (such as images, 3D models, sounds, and so on. Here is a brief description of these key elements: 3D graphics engine What the user can see on his screen. Physics engine How 3D models in the simulation react to gravity, collisions, friction, and so on. Sound engine What the user can hear from the simulation. Interfaces How the player can interact with the game. Network How the player can share their simulation experience with other players. AI behavior All objects that are expected to have a living behavior and that are not controlled by the player can be managed via Kynapse. This includes advanced perceptions handling, decision taking, complex pathfinding, high level behaviors (such as flee, hide, attack), and so on. There is an exhaustive list of Kynapse specifications (p.11). 9 Kynapse powered by Kynogon SDK Design philosophy The design brief for Kynapse was to create an AI library that would perfectly match game designers AI needs and bring an easy-to-use but powerful collection of tools and functionalities to developers. We have tried hard to make sure the library is the most powerful multi-platform AI library available. Performance CPU and memory performance was one of the main concerns when designing Kynapse. The core algorithms have been designed with this in mind, and many tuning opportunities are exposed to the developer for customizing memory and CPU management. Easy integration process The number and complexity of connection points between client game engines and Kynapse have been minimized. This way, integration process and SDK evaluation can be very straightforward. Platform independent development Kynapse has been designed to let you get the most out of all the supported platforms with no compromises. APIs are provided which expose low-level features and optimisation opportunities to the developer, so the best performance can be obtained for your projects. 10 Kynapse powered by Kynogon SDK Kynapse functional specifications Here is a brief list of functionality that is supported by the current release of Kynapse. Decision (thinking logic) • C++ brains (p.17) support. • Lua script brains (p.17) support. Pathfinding • Automatic pathdata generation (p.17). • Complex 3D topology support (slopes, holes, irregular surfaces, and so on). • Dynamic avoidance between entities. • Support for dynamic pathobjects (p.41) (doors, elevators, scales, and so on). • Constrained pathfinding (p.39) support. • Shortest path (p.17) pathfinding constraint. • Stealthiest path (p.17) pathfinding constraint. • Point to flee path (p.17) pathfinding constraint. • Custom pathfinding constraints (p.17) support. • Simple (p.17) path following mode. • Complex (p.17) path following mode. • Customizable pathfinding heuristics (p.40). • Euclidian (p.17) pathfinding heuristic. • Zero (p.17) pathfinding heuristic. • Path cost (p.17) pathfinding heuristic. • Custom (p.17) pathfinding heuristic support. Agents (high level actions) • Goto agent (p.17). • Follower agent (p.17). • Flee agent (p.17). • From danger points. • From dynamic entities. • Wander agent (p.17) (wander freely in the level). • Pathway agent (p.17) (follow an authored path). • Hide agent (p.17). • Relative or absolute. 11 Kynapse powered by Kynogon SDK • Far away or close. • Shooter agent (p.17). • Imitator agent (player cloning). • Test agent (p.17). • Custom agent support. Perceptions • Visibility between entities (p.17). • Sophisticated understanding of surrounding topology via access ways (p.17) (points from which danger can come). • Sound and smell perception manager. Team support • Dynamic Team (p.38) composition. • Communication between team-mates. Performance • Time-slicing (p.53) mechanisms. • Customisable memory management (p.59). 12 Kynapse powered by Kynogon SDK Using this documentation This section is designed to help you read this documentation. • Typographic conventions (p.14) • Finding information (p.15). 13 Kynapse powered by Kynogon SDK Typographic conventions Kynapse user guide follows certain typographic conventions. These are used to clarify the meaning of the text: Convention Meaning courier Function/class/variable name italic Kynapse concept that is defined in the glossary (p.) hyperlink (p.14) To find out more about a topic. 14 Kynapse powered by Kynogon SDK Finding information The Navigation pane contains tabs enabling you to find information fast. Content Use the Content section to find the information you require. The structure of the API Reference is explained in the API reference section. Index The index contains a list of all functions in the API Reference. Search tab To search for specific terms enter the word and press enter or use wildcards. Searches are not case sensitive and punctuation marks are ignored.