Code Architecture

Intro

After looking at the code for the last two weeks I think I've gotten it to the state where I'm going to start developing again. From looking at all of the scripts I've made I have some better ideas on how to structure the classes to have each script make a little more sense. I first started by just detailing all of the scripts and what was contained in them and then went and modified them to be more concise.

UML Class Diagram

NPC Movement

Main Changes

The above image shows the current class diagram that I came up with. One of the main differences is the Player class which has been split up into a few different scripts. The current Player class has a lot of lines and is kind of bloated. A goal of mine for the next sprint is to update the Player class to reflect these changes and have each script running one action like movement, interaction, and UI.

I also realized that the connection between the interactable objects and their UI can be streamlined. Particularly the Cauldron_UI script where the devices could definitely be reworked to be less complex. My plan is to separate the UI and objects so that the UI elements are just UI elements and aren't storing values that the objects themselves should be storing. This includes the Cauldron, Research Station, Devices, and Inventory.

The one section of the code that I have yet to flesh out is the quest system. It will definitely need a large overhaul and is something that I am going to put on the backburner for now. The currently implemented quest system isn't close to the final one and was mainly just a patch to get in the quest for the previous sprint. I want to get the architecture changes implemented and functional, as well as getting the game to look somewhat decent, before moving onto any new systems.

Next Sprint: Resturcturing Code

The next sprint I want to focus on implementing the changes I've made in the class diagram. specifically cleaning up the connection between the interactable objects and their UI as well as separating the Player class. As I go along I will probably end up adding and editing the current class diagram and I want to make sure that it is fully updated before I continue to work on anything else. I'm also going to make sure that any features I work on next will have their own class diagram as well as user stories to help me along the development pipeline. If I have any time near the end of the sprint I'm planning on searching for some temp assets as the ones I currently have I'm still not satisfied with.