Devlog - Inventory UI - Douglas Strange


I have been having difficulties with my inventory UI. What I thought was going to be maybe a week project has taken almost two extra days’ worth of time. I did not foresee running into the issue of my blank item slots being listed as full, null being valid data for a sprite, slots sometimes not persisting in the manager, and other minor issues due to reminding or learning C#’s eccentricities.

The way I managed to locate the problem is quite simple. Instead of trying to fix all the problems at once I diagnosed the three problems: the inventory, the inventory manager, and the item slots and broke them down into what they should be doing for my purpose. So far, the largest of problems occurred when the manager attempts to add an item to a slot. Repeatedly I was given errors that empty slots could not be found or the data passed was invalid. This had a lot to do with two different persons working on the inventory. Our gameplay programmer set up the internals so they could test their pickups, and I adopted it before realizing that the data they used was incomplete compared to what I needed; which meant I had to completely rethink how I wanted to create the inventory UI for display purposes.

                To solve my problems, I have decided on the simple solution of breaking down the programming methods into blocks to figure out how the logic failed. I believe that part of the problem was checking all the slots in my item slots array. For the fix I check all the slots regardless and in doing so found my empty slots when cleaning up the editor. As it turns out the slots had not been inserted into the inventory manager on the editor side. Once doing so the array became properly populated and my inventory manager performed its designated task as intended.

                Assuming all goes well the inventory UI should be completed by the end of my work session tonight. Right now I just have to fix an error where the sprites are not updating and then I need to adjust the code to work with the inventory rather than as a separate component.

Get Noble Roots

Leave a comment

Log in with itch.io to leave a comment.