Week 9 Developments (Devlog)
Tasks Undertaken:
- The primary tasks for the week involved developing an Inventory Core system that stores Player Items collected including: Health Kits, Munitions, Weapons, and Collectables and displays them visually on a UI display for easy recognition and access for the player. The additional functionality encapsulates within this features ergonomic features such as item slot swapping between two items, deleting items by dragging them off of the UI interface alongside the ability to Quick Save/Quick Load Inventory items for Players within the Unity JSON files.
- The development of the Core Inventory system was a complex and long process involving a plethora of new coding applications and processes that were learnt about and allowed for the development of a better understanding of including the integration of Dictionary Lists for object IDs, Class creation within other classes and the use of scriptable objects that allow for easier creation of databases within Unity. Initially a Scriptable Object base class called ItemObject was created to store key data for the future game object that would be assigned to it such as an ID for database reading, an enumerable type to distinguish categories of items and other more rudimentary variables including a string for object descriptions. The category typing allows for abstracted classes of Weapons, Collectables, Keys, and other items possibly added in the future which was utilised during the development of the base Inventory scripts.
- The secondary processes required the creation of an item database which stores itemObjects in an array which can be called when a scriptable Object is acquired by the Player. The final generalised script required was a script that relayed the information onto a UI interface with particular functionality with event triggers for the Mouse Cursor that allowed dragging and dropping for the superfluous functions of Inventory item deletion and Swapping. A plethora of scripts including the ItemDatabase and DisplayInventory scripts as examples utilised ISerializationCallbackReciever to implement code and functionality at the exact stages of serialization of scripts which supersedes Unity's automated serializer by allowing a user to manually control processes before and after serialization with the OnBeforeSerialization callback and OnAfterSerialization callback.
- With an InventoryObject class developed that defines processes between UI Prefab slots and contains internalised classes of Inventory Slot and Inventory object, the data from the itemObject class can be visually represented within the developed UI display with the DisplayInventory script. The DisplayInventory script was then made more modular to cater to an Equipment Inventory and Storage Inventory Respectively. The DisplayInventory was refractored and converted into the UserInterface script which is an abstracted class. The benefit of having an abstract class was the Equipment Inventory that would be using a StaticInterface script could maintain the same base Event Trigger functionality and Inventory Slot interaction as the Abstracting parent class whilst allowing for some limitation with an override of an abstracted function for equipping items. The other developed script that was abstracted from UserInterface was the DynamicInterface class which automatically populates a display with Inventory slots with assigned spacing and tracking of slotObject positioning to ensure that the items can be moved freely to varying slots. in a visual manner, whilst the actual process was being called from the InventoryObject class.
- With the base Inventory and Equipment systems finalised a new PlayerInventoryBase was developed to hold the information on the player and Save/Load that data. This data was saved in JSON files with the IFormatter which serializes the ID and itemObject information into an external file that can be loaded at launch at anytime and can be overwritten with additional saves with no problems.
Obstacles:
- Initially, the start point for development of an Inventory System was quite unclear. This was remedied by intricate research and discovery of a tutorial that covers the development of an Inventory in detail. The reason this tutorial series was favoured over many alternatives was due to the detailed explanations and focus on Unity API and code conventions that educate on the capability of primarily programming based development of a game rather than the Editor heavy development alternative that cuts out coding for ease of use for new users. The tutorials were closely followed whilst using more recognisable variable names in my own developed scripts.
Links to the viewed Tutorial series are listed below:
1. https://www.youtube.com/watch?v=_IqTeruf3-s&list=PLJWSdH2kAe_Ij7d7ZFR2NIW8QCJE74CyT&index=1 (Scriptable Object Inventory System)
2.https://www.youtube.com/watch?v=232EqU1k9yQ&list=PLJWSdH2kAe_Ij7d7ZFR2NIW8QCJE74CyT&index=2 (Saving and Loading your Inventory with Scriptable Objects)
3. https://www.youtube.com/watch?v=LcizwQ7ogGA&list=PLJWSdH2kAe_Ij7d7ZFR2NIW8QCJE74CyT&index=3 (Item Buffs/Stats)
4. https://www.youtube.com/watch?v=ZSdzzNiDvZk&list=PLJWSdH2kAe_Ij7d7ZFR2NIW8QCJE74CyT&index=5 (Item Swapping)
5. https://www.youtube.com/watch?v=0NG_dXsPXg0&list=PLJWSdH2kAe_Ij7d7ZFR2NIW8QCJE74CyT&index=6 (Equipping Items)
Solution Reasoning:
- Due to following a Tutorial series for the development of the Inventory System the process was more of a educational experience with new coding methodologies and capabilities rather than an experimental individualised process for code development. The reasoning behind this was the limited knowledge regarding information and data being saved and represented on an interface, which led to the perusal of a variety of different Tutorial Series. The ultimate decision for the use of 'Coding with Unity's series was the deep explanation of Unity API and how it can apply to other elements of coding not limited to the development of the inventory system alongside the recent release of the video allowed for a contemporary approach to a key system to ensure that an outdated process was not taken from the beginning.
SGD300 Assessment. (FPSRPG)
Status | In development |
Author | Xianomorph-7 |
Genre | Shooter, Role Playing |
Tags | FPS |
More posts
- Week 12 Development (Devlog)May 29, 2020
- Week 11 Development (Devlog)May 23, 2020
- Week 10 Development (Devlog)May 23, 2020
- Week 8 Development (Devlog)May 18, 2020
- Week 7 Development (Devlog)May 18, 2020
- Week 6 Development (Devlog)Apr 11, 2020
- Week 5 Development (Devlog)Apr 01, 2020
- Week 4 Development (Devlog)Mar 24, 2020
- Week 3 Development (Devlog)Mar 24, 2020
Leave a comment
Log in with itch.io to leave a comment.