itch.io is community of indie game creators and players

Devlogs

Inventory: Now On Display

Xenodochium
A browser game made in HTML5

Where To Begin

Today I dove into the real hard part of the inventory system, the item slots and displaying the actual inventory. I had an approach in mind, based on similar functionality in other parts of my UI. As a matter of fact I ended up actually copying code from my HUD into my inventory. I actually ended up working with two difference instances of Gemini. I started with my main chat to discuss the general ideas and approach I wanted to take with the inventory. Then I moved on to a separate chat to deal with the actual coding.

After discussing some general ideas and concerns, I made a bunch of changes to the inventory and began setting up the object pooling functions. Once I felt like I was in a good place, I fed this script into the second Gemini instance and went through it for any issues. It did catch a couple of things, which was great. Then I continued and finished everything!

That would have been great, if it wasn't for an issue with my inventory manager. Turns out, every time I saved my game, my inventory kept getting deeper and deeper into a nested dictionary. Turns out I wasn't quite properly dealing with the data going to and coming from the savegame manager. Once I figured out the source of that issue, my inventory screen finally worked, once.

It me a while to figure it out, but for some reason the game would crash every second time I opened the inventory. Turns out it was a very simple mistake, I just forgot to add a node to a dictionary. Once that was done, my inventory display is now working!

What's Next?

I'm really not sure at this point. I still need to do more work on the inventory system, such as actually being able to interact with it in some fashion. But before I do that, I probably need to make some other updates and changes to other systems. I know there's still so much more to do, it's just a little hard figuring out exactly what comes next. Maybe I take a step back again and continue working through the new player experience. 

Leave a comment