Skip to content

Animal Overview

Blauberg edited this page Oct 14, 2024 · 17 revisions

Introduction

The animal system in the game serves as a core gameplay element, providing players with engaging challenges through diverse enemy encounters. Animals in the game are designed to act as hostile entities that challenge the player through combat. Each animal type has unique movement patterns, attack styles, and animations, all of which contribute to the player’s strategic decisions during encounters. By differentiating animals through configuration, the system allows for a wide variety of enemies that require different approaches to overcome.

System Architecture

Animal Instantiation

All animals are created using the NPCFactory class, which provides a create() method to instantiate animals based on their specifications. The configuration for each animal, including its tasks, animations, and combat stats, is defined in a JSON file (NPCs.json). The factory uses these configurations to build animals with various components that dictate their behaviour and abilities.

Configuration of Animals

The behaviour and characteristics of each animal are defined in the NPCs.json file. The configuration of this file is covered in the NPC Configuration page.

Key Components

The following components are used in animal creation:

  • AITaskComponent:
  • AnimationRenderComponent:
  • ColliderComponent:
  • CombatStatsComponent:
  • DirectionalNPCComponent:
  • HitboxComponent:
  • NameComponent:
  • NPCAnimationController:
  • NPCConfigComponent:
  • NPCDeathHandler:
  • NPCHealthBarComponent:
  • PhysicsComponent:
  • PhysicsMovementComponent:

Attack Components

The following components are added to NPC's if defined in the configuration file:

  • MeleeAttackComponent:
  • RangedAttackComponent:
  • AOEAttackComponent:

Boss Components

If an NPC is defined to be a boss, the following components are added:

  • BossHealthDialogueComponent:
  • DialogComponent:

Integration with Other Systems

  • AI System: Animals use the AI Task system, where tasks are prioritised and executed based on their configuration. This allows animals to react dynamically to the player and environment.
  • Physics and Interaction: Managed by physics components, animals interact with the game world and player through collisions and movement dynamics.
  • Animation and Rendering: The AnimationRenderComponent synchronises animations with the animal’s actions, ensuring great visual representation of behaviour.

Future Plans

Table of Contents

Home

Design

Design Document

Design Choices

Game Wiki

Gameplay

Controls

Game Features

Utilities
Animals
Menus/screens
Character
Map
Weapon
Projectile
Items
Music/sound

User Guide

Starting the game

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Enhancement of Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally