top of page

Updates to Inventory System and Storage Lockers

Sep 6, 2024

New Inventory System and Locker Storage!

After running into some problems with the old grid based inventory system after adding in a rotate item functionality I decided to take a step back and re-design how the inventory system works to better allow for this new mechanic. With this new spatial inventory system each item has a row in a data table with useful information such as icons, size in inventory, inspectable mesh, name, description, and more to be used later on. This new inventory system also uses an array of tiles that store information about what should be in each tile of the inventory. Then using this array a grid is drawn on the widget to display where each space is. This grid can be easily adjusted in the editor to change the number of columns and rows as well as how large each tile should be. This allows for easy iterations to UX design as well as allowing for the same code to be used for multiple inventory screens such as the locker storage system. Using these tiles to store inventory items allows for larger items and the rotation of items to be changed extremely easily. The last iteration of the inventory system didn't allow for this to easily change as each square was a different widget. However this new system allows for an item to sit on top of the grid and change the array to see where it is in code. This way all that needs to happen to rotate or add a larger or smaller item is change the size variable in the data table ex. 1x2 to 2x1 for rotations or making a 1x1 item a 2x2 item. I also override the on paint function to show a green or red overlay behind the image. This will show the player where they are currently going to be dropping their items when arranging the inventory.

  • LinkedIn

©2024 Tucker Holmes

bottom of page