Skip to content

Alien Fauna ‐ Programming Guide

pchsa edited this page Oct 3, 2023 · 37 revisions

Introduction

This wiki page outlines implementation and example usage of alien fauna in the game.

Adding Animals

New animals can be added in the NPCFactory. See Adding Animals.

Animal Movement Behaviour

An animal's movement behaviour is dictated by adding tasks to the AITaskComponent.

Running Away Task

Taming

Taming passive animals are implemented in TamableComponent. See Taming Animals.

Animations

Animal animations are implemented using the AnimationRenderComponent and are handled using the AnimalAnimationController.

Attack Patterns

Hostile combat (including melee attacks and projectiles) are implemented using AttackPatternComponent. Attack Patterns

Projectiles

Hostile animal projectiles are implemented using Projectiles.

Indicator

Indicators appear on the screen to notify the player that there are hostiles in the area that they must defeat. Entity Indicator

Adding interactions with animals and other non-tile entities

Detecting animals in range of player, as well as the animals detecting player / plants to attack is implemented using InteractionDetector. Please read https://github.com/UQcsse3200/2023-studio-1/wiki/Interaction-with-non%E2%80%90tile-entities

Animal Drops

Animal drops occur either periodically or due to events (such as feeding or killing an animal). This is handled by the MultiDropComponent

Animal Spawning

Animals can be spawned by spawning entities in SpaceGameArea. Animals also spawn periodically. This is handled by the EntitySpawner

Clone this wiki locally