-
Notifications
You must be signed in to change notification settings - Fork 0
Resource Management
The resource management system currently consists of the stone currency and the stone quarry building. It is intended to be a way for the player to manage the construction of buildings in Atlantis Sinks. Stone is the currency used for the purchase of all buildings in the game. It is generated by the stone quarry building.
The player can press the 'B' key to enter building mode. The default building is a defensive wall. Press 'N' to cycle to the next building - the stone quarry. Buildings can be placed with a left click. Clicking and holding allows the player to drag the building into place. Press 'B' when finished to exit build mode. While in build mode, the player can generate 100 stone by clicking on any of their already placed stone quarries. In future, resource collection will be changed to an automatic time-based system instead of manual on-click generation.
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.
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:
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 too was designed into the cliff and with as much greek influence as we could find just to help find the aesthetic middle ground.
To add an extra layer to the design and functionality of our feature, we thought it was important that small animations were added. We created several frames which depict the minecart entering and exiting the mine, with the minecart emptying upon exit. The torches on either side of the mine also flicker.
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.
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.
The UML diagram attached below allows us to visualise a clearer overall structure of the relationship between each class:
Junit tests were also written to provide an automated test to test the behaviour of the methods inside each class that we have written (Test Class path: source/core/src/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 and validation were performed consistently to gather feedback on both of the design and functionality aspects of the resource management features:
** Operates Left to Right, Top to Bottom...
- Ascension, S. o. (n.d.). First mine entrance art done! Retrieved from Twitter: https://twitter.com/startselect__/status/993808320971538433
- Boulders_variation. (n.d.). Retrieved from https://static.wikia.nocookie.net/dont-starve-game/images/6/6e/Boulders_variation.jpg/revision/latest/scale-to-width-down/250?cb=20140120130328
- Dmytro, A. (n.d.). Vector isometric illustration of a underground mining quarry. Retrieved from ShutterStock: https://www.shutterstock.com/zh/image-vector/vector-isometric-illustration-underground-mining-quarry-269919209
- GOLD MINE. (n.d.). Retrieved from GameCenter2: http://gamecentre2.weebly.com/gold-mine.html
- Greeka. (n.d.). Retrieved from https://images.greeka.com/resized/user_images/krilis/1920/mig9KMYr4.jpeg
- Jones, R. (n.d.). Scifi - Mine entry. Retrieved from Pintrest: https://www.pinterest.com.au/pin/353743745707541693/
- JORDAN. (2013). Retrieved from Broncesmestre: https://broncesmestre.com/zh-hans/griferia-exclusiva-mestre-en-jordania-2/
- Xi Wang - Personal Drawing
- Krivio. (n.d.). mines. Retrieved from Pintrest: https://www.pinterest.com.au/pin/400820435564325911/
- Rizuki, K. (n.d.). Fantasy City. Retrieved from Pintrest: https://id.pinterest.com/pin/542472717618696256/
- Softworks, B. (n.d.). Huaban. Retrieved from Lord of the Rings: War in the North concept art: https://huaban.com/pins/1540673584
- Stone, J. (n.d.). NOP on Twitter. Retrieved from Pintrest : https://www.pinterest.com.au/pin/824581013021511475/