Skip to content
Callan Vragalis edited this page Oct 1, 2024 · 12 revisions

Items

Overview

The items are one of the most fundamental part to most videos games. Within our game, these items will be used to display ingredient and used to make meals and give them to customers. These items are built through the entity-component system using an entity with multiple components which allows the functionality that we need.

How to create your own item

All of the spawning of the items should occur in ItemFactory where all items including meals and ingredients are spawned individually. All created items should be registered to the entity service upon creation, and unregistered when they are no longer used.

Example of a Fish

Below is an example of how a fish entity might be created and the components it might have.

Example fish entity containing ingredient component and cook ingredient component

If you want to add some items together to make a meal which will be servable to the customer, you will do the same thing as an item however use a meal component to give the functionality a meal requires. To get more info on how meal and ingredient component differ, refer to the UML diagram furthur below in the document

Components

image

The item you want to create will either be a meal or ingredient for the meal.

ItemComponent

The item components is a template class which has very basic functionality and is utilized by meal and ingredients for it's simplicity. It consist of a randomly generated ID, a name, weight and type. There are getter for all these however no setter as these function should not be changed after initialized.

IngredientComponent

The IngredientComponent is a child of the ItemComponent which will be used for all individual food items which will be used within the game. It can be defined to be chopped and/or/neither cooked and can be altered through the many methods available. Refer to UML for full list

MealComponent

The MealComponent is also a child of the ItemComponent which will be used to combine all individual IngredientComponent to make a central dish which can be served to customer. This allows meals to have ingredients set, added and taken away at a basic level and have a set price. The quality will be calculated through a calculateQuality() function which will access each individual item's state to determine each items quality, which each item identified in the incorrect state drawing a 'penalty'. These penalties are then summed and reduce the quality score, which has a maximum of 100.

ItemTimerComponent

ItemTimerComponent is an abstract class which the next two components CookIngredientComponent and ChopIngredientComponent inherit from. This component provides timer functionality for items down to millisecond precision to allow for the starting and stopping of item cooking and chopping. This enables features like the player needing to actively control the chopping process, and allowing for the burning of items.

CookIngredientComponent

The CookIngredientComponent inherits from the abstract ItemTimerComponent. This allows for the item to keep track of the time it has spent cooking. This enables partial cooking of an item. And allows the implementation of burning specific to items that can be cooked.

ChopIngredientComponent

Similar to CookIngredientComponent, ChopIngredientComponent inherits from the abstract ItemTimerComponent. This allows for the item to keep track of the time it has spent cooking. This means that chopping can be paused and resumed whilst saving the progress of how far the item has come.

Table of Contents

Home

Team Design Document

Game Features

Inventory System
Scoring System
Food Recipes
Level System
Player Actions
Ordering System
Stations
Items
Map Design
Customers
Pause Menu
Upgrades
End of Day Display
Day Night Cycle
Moral System
Debug Terminal
Game Interactions Tutorial
Backstory Cutscenes

Game

Getting Started

Entities and Components

World Backstory

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Map Design

Test Plans

Sensor Component

Customer Sensor Component

Interaction Component

Inventory Component

Inventory Display

Station Meal Component

Station Progress Display

Keyboard Input Component

Fire Extinguisher Handler Component

Score System

HoverBox Component

MainGameActions Create Docket Triggers

End Day Display Component

Cutscene Area

Docket

Docket Line Display

Docket Meal Display

Main Game Order Button Display

Order Actions

Recipe

Ticket Details Component

BackstoryCutscene Test Plan

BackstoryCutsceneDisplay Test Plan

Test Plan for Tutorial

Keybinds

Keybinds Test Plan

Test Plan for MainGameOrderTicketDisplay

Test Plan for MainGameOrderBtnDisplay

Test Plan for Docket

Test Plan for DocketLineDisplay

Test Plan for OrderActions

Ticket Details

Test plan for RandomComboService

Test plan for LoanUpgrade

Test plan for UpgradesDisplay

Test plan for RageUpgrade

Test plan for SpeedBoostUpgrade

Test plan for DancePartyUpgrade

Test plan for ExtortionUpgrade

Troubleshooting

MacOS Setup Guide

Clone this wiki locally