- CRYENGINE Game Development Blueprints
- Richard Gerard Marcoux III Chris Goodswen Riham Toulan Sam Howels
- 227字
- 2021-07-16 20:21:18
Registering a new AI class
At the heart of every character in CRYENGINE is the IActor
interface. It provides the mechanism for objects to have AI. When we refer to a player or an AI, we are really referring to something called an actor. An actor is responsible for containing and managing all the logic that will be used to bring an object to life. This can range from being an animal companion, an AI character, or any other game object whose purpose is to represent living objects. Since GAS is a very simple side-scroller, we will not be using CRYENGINE's AI system. However, we will use CRYENGINE's IActor
interface since our character is a living object. There is not much difference between our player and the AI; the only difference is how they shoot and who they shoot at. This allows us to reuse the CPlayer
class for our AI, and simply register it under a different class name.
Open the CGASGame.cpp
file and navigate to the RegisterGameObjects()
method. Re-register the CPlayer
class under the name AI
. It should look like this:
//Registers The AI. REGISTER_FACTORY( m_pGameFramework, "AI", CPlayer, true );
Notice that we reuse the CPlayer
implementation and just register it under a different class name AI
. This will create another entity class called AI
that uses the exact same code as the CPlayer
class.
- Go Web編程
- VMware View Security Essentials
- 案例式C語言程序設(shè)計
- Oracle從新手到高手
- Servlet/JSP深入詳解
- Java EE 7 Development with NetBeans 8
- Access 2010中文版項目教程
- OpenCV with Python Blueprints
- Learning Bootstrap 4(Second Edition)
- Java 9 with JShell
- PHP項目開發(fā)全程實錄(第4版)
- Android初級應(yīng)用開發(fā)
- MySQL從入門到精通
- 利用Python駕馭Stable Diffusion:原理解析、擴(kuò)展開發(fā)與高級應(yīng)用(智能系統(tǒng)與技術(shù)叢書)
- Python Natural Language Processing