Skip to content

Resource Management

Suki Z edited this page Aug 30, 2022 · 85 revisions

Wiki page for Team 5 - Resource Management

Resource Management Overview

The resource management functionality is accessible throughout the entirety of the game and provides the players with various methods of collecting stone to build other buildings in Atlantis Sinks. Initially, we intended that the player would have three methods of obtaining stone: main character mining the map, enemy drops and a stone mine building. But because the first two methods relied heavily on two other teams, we decided for the MVP we would focus on a Stone Mine Building. Once placed, this stone mine would generate a certain amount of stone per level to aid the player in purchasing other buildings and is intended as an investment.

The Design Process

Inspiration:

In terms of inspiration the main ideas we wanted to explore were: mines built into the wall, mine cart / traintracks, atlantean themes and various lighting ideas.

Aesthetics:

Atlantean Themes:

Fake Height / Pixelation / Isometric Design:

Initial Brainstorm:

As we were initially told that the mines would be built into the cliff faces that would step down per level, the brainstorming had the mines designed into the cliff face.

Low Fidelity Sketches:

Low fidelity too was designed into the cliff and with as much greek influence as we could find just to help find the aesthetic middle ground.

High Fidelity Sketch / Final .jpeg:

Animation

To add an extra layer to the design and functionality of our feature, we thought it was important that small animations were added. Not only did we add the apparent appearing and disappearing of the mine cart, but also flickering of the torches and the cart being emptied every time the cart reappears.

Animation basically works on the spritesheet and the TextureAtlas file. So, after loading these assets into the MainGameScreen.java file, an animator in the StructureFactory.java file was created

AnimationRenderComponent bul_animator = new AnimationRenderComponent( ServiceLocator.getResourceService().getAsset("images/anim_demo/res_bul_1.atlas", TextureAtlas.class));

And then animation was added to it,

bul_animator.addAnimation("bul_1", 0.5f, Animation.PlayMode.LOOP);

After which we can just start the animation and it appears as above.

Coding Process

Classes

InventoryComponent: The InventoryComponent class tracks and manages the player’s inventory. Currently the class stores the amount of gold and stone. This class can be extended for more advanced functionalities in the future such as artefacts etc as well as more generic components for other entities.

ResourceBuilding: The ResourceBuilding class is used to generate and manage resources for the player.

ResourceType: An enumeration that contains different resource types.

UML Diagram

The UML diagram attached below allows us to visualise a clearer overall structure of the relationship between each class:

UML_Diagram_Team5_DECO2800

JUnit Test

Junit tests were also written to provide an automated test to test the behaviour of the methods inside each class that we have written '(see test/com/deco2800/game/components/player/InventoryComponentTest.java)'.

For example, the assertTrue() and assertFalse() methods will check if whether the expected value is true of false, which can be seen in the attached Junit test shown below: when the amount of stone is out of scope, the test will assert a false condition; otherwise the test will assert a true condition.

@Test
void shouldCheckHasStone() {
  InventoryComponent inventory = new InventoryComponent(150, 150);
  assertTrue(inventory.hasStone(100));
  assertFalse(inventory.hasStone(200));
}

User Testing

Design Testing:

To remove any team biases and to gain another opinion, user testing was conducted. Specifically, we wanted to ask others about colours, shape, animations and any other opinions that they had. To do this, we showed them the individual sprites and then played the gif for them and asked them to complete a small interview afterwards.

The main take aways from this process were as follows:

  • Colour Scheme: On initial viewing, most of the people said that some of the colours didn't match and the entire colour scheme could be improved. Despite this feedback, we explained that we were given a design document by the UI team and after they scanned through that, they could acknowledge our initial design decision and most were then happy with it.
  • Animations: After the gif played for the viewers, their first reaction was that the fact that the colours inside the cart stayed the same made it look like we were taking stone back into the mine as well. To fix this, we then made the inside of the mine cart black to make it look as though it was being emptied before the process repeated. The rest of the animations they enjoyed.

Functionality Testing:

Functionality testing of the game was conducted in order to identify any errors, bugs or inconsistencies that may affect the user experience adversely. We planned to ask others to look out for any performance issues of the game in the future including:

  • Possible issues in the game interface such as issues with animation or any graphical corruptions.
  • Possible freezes, crashes or any glitches while testing interactive functionalities.
  • Test for areas for any event that may does not trigger or gets triggered incorrectly.

Reference List

** Operates Left to Right, Top to Bottom...

Table of Contents

Home

How to Play

Introduction

Game Features

Main Character

Enemies
The Final Boss

Landscape Objects

Shop
Inventory
Achievements
Camera

Crystal

Infrastructure

Audio

User Interfaces Across All Pages
Juicy UI
User Interfaces Buildings
Guidebook
[Resource Management](Resource-Management)
Map
Day and Night Cycle
Unified Grid System (UGS)
Polishing

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