We have a Steam curator now. You should be following it. https://store.steampowered.com/curator/44994899-RPGHQ/

Obese Game Dev Blog

I'm sorry Dave, I'm afraid I can't do that
Ignore Topic
User avatar
Nooneatall
Posts: 2413
Joined: December 4th, 2023, 15:03
Location: The Congo
Gender: Watermelon

Geolocation

Adventurer's Guild

Obese Game Dev Blog

Post by Nooneatall »

Today I'd like to talk about an inventory system.

What you will see in the screenshots is just the front-end of the GUI which is being rendered in Godot. However, any front-end could use this, whether it be a web page, Unreal (with a lot of work with C ABI bindings), Unity, and so forth.
I have decoupled the actual systems themselves away from any of the front-end logic. For instance, you might have a button that says add item, but what is happening is that we are calling a function from a separate DLL and then that DLL is emitting a signal and we are capturing the event to tell us to update the inventory.

Right now, any sorting or changing of how the inventory items look is completely driven by the front-end. However, any logic that dictates if we should add something to the inventory, check the inventory, remove something, or anything else is controlled by the backend and has only a few public interfaces (add, remove, split, get).
one.png
We start with no items in our inventory, notice in the bottom left we are at 0 out of 200 inventory slots.
two.png
After pressing the add random item button we now have a shield.
3.png
Now we have 102 random items all messed up and out of order. In most good games they implement QAL improvements for sorting items. Some games take months after launch to do this which is very funny. There's a few ways to do sorting but we are going to do it the most naive, simple, and resource intensive way because we are only sorting 102 items. If we were sorting thousands or millions we would be in trouble but not so here.
four.png
All we have to do is say we want to sort by name:
five.png
And voila, a sorted inventory list.

There are a few problems here, however, one is that after we've sorted if we add a new item it will go back to the way it was. Once the user says they want to sort by a certain way it should respect that until the user unselects it. That's one thing I have to do. Another is I have marked every item as non stackable! I must change that as well so that items can stack.

Join me next time as I do a few more tweaks to the inventory by adding in splitting, stacking feedback, more sorting, and potentially starting work on a rudimentary trading system.
You do not have the required permissions to view the files attached to this post.
I made a mod for CK3:
DEI Remover

:knight-cross: donate to the HQ :knight-cross:

Volunteer Moderator
Professional Shitposter
Proud member of the woke right
User avatar
J1M
Turtle
Turtle
Posts: 6273
Joined: February 3rd, 2023, 00:23

Geolocation

Adventurer's Guild

Post by J1M »

I would like to know more about why you are calling a separate DLL instead of emitting a Godot signal into something like an event bus. Is the game only using Godot for UI?
User avatar
Nooneatall
Posts: 2413
Joined: December 4th, 2023, 15:03
Location: The Congo
Gender: Watermelon

Geolocation

Adventurer's Guild

Post by Nooneatall »

J1M wrote: ↑ July 19th, 2025, 22:31
I would like to know more about why you are calling a separate DLL instead of emitting a Godot signal into something like an event bus. Is the game only using Godot for UI?
Why not?
Edit: don't answer this I don't care enough to go into an arch discussion on this but thanks for the response
Last edited by Nooneatall on July 20th, 2025, 00:23, edited 1 time in total.
I made a mod for CK3:
DEI Remover

:knight-cross: donate to the HQ :knight-cross:

Volunteer Moderator
Professional Shitposter
Proud member of the woke right
User avatar
rusty_shackleford
Site Admin
Posts: 52832
Joined: February 2nd, 2023, 18:46
Gender: Watermelon

Geolocation

Adventurer's Guild

Post by rusty_shackleford »

Nooneatall wrote: ↑ July 20th, 2025, 00:22
J1M wrote: ↑ July 19th, 2025, 22:31
I would like to know more about why you are calling a separate DLL instead of emitting a Godot signal into something like an event bus. Is the game only using Godot for UI?
Why not?
Edit: don't answer this I don't care enough to go into an arch discussion on this but thanks for the response
I'm going to answer this. By separate dll are you just referring to the dll your game code is in?
:scratch:
Thank you for your attention to this matter!
Steam friend code: 40552640 https://steamcommunity.com/friends/add | email: [email protected] | Questions or problems? PM me. I reply quickly.
Rusty's Stuff Collection
User avatar
J1M
Turtle
Turtle
Posts: 6273
Joined: February 3rd, 2023, 00:23

Geolocation

Adventurer's Guild

Post by J1M »

Nooneatall wrote: ↑ July 20th, 2025, 00:22
J1M wrote: ↑ July 19th, 2025, 22:31
I would like to know more about why you are calling a separate DLL instead of emitting a Godot signal into something like an event bus. Is the game only using Godot for UI?
Why not?
Edit: don't answer this I don't care enough to go into an arch discussion on this but thanks for the response
Was just asking what you were doing because it sounded different from other games. I'm not out to tell you it's wrong.