Skip to content

Unit Spawning From Buildings

Harikesha Suresh edited this page Oct 4, 2022 · 1 revision

Introduction

In prior sprints unit spawning was done with spawning methods called once when the game is started, however, this functionality is limited and doesn't reflect the requirements of the game. Units, both friendly and enemy are supposed to be spawned by a variety of events, they can include random/story events, direct player intervention, i.e. play selects a barracks and deploys n number of units, or auto spawning functions.

To fit the unit spawning to these new requirements we've implemented an event system for spawning units from buildings, events such as spawnHoplite and spawnBlueJoker are triggered by the UnitSpawningComponent, the events triggered are dependant on the building type the component is attached to, currently it spawns a unit every 30 seconds, these events then process their respective spawning functions in AtlantisGameArea, where the event manager instance is located. This system allows for successful deployment of units without having full access to classes like GameArea.

UML Sequence Diagram

The following demonstrates how the Barracks uses the event system and UnitSpawningComponent, this is a similar flow that happens with any buildings that has UnitSpawningComponent.

UnitSpawningpng

Table of Contents

Home

Game

Game Home

Design Influences

Gameplay Features

Style

Story

Friendly Units
Map
City
Buildings
Unit Selections

Spell

Game User Testing: Theme of Unit Selection & Spell System

UI User Testing

Tutorial

Resource Stats Display

Loading Screen Bar

Health Bars
In Game menu
  • Feature
  • User Testing:In Game Menu

Landscape Tile Design

Landscape Tile Design Feedback

Weather Design

Weather Design Feedback

Camera Movement

Enemy design

Enemy Units

Enemy AI

How Animation Works

Map Flooding

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

Troubleshooting

MacOS Setup Guide

Clone this wiki locally