What's in an Inventory?

Published February 20, 2012
Advertisement
What is an inventory?
It's kind of a container the player has to hold Items I guess. Seems simple enough. Coding this should be real quick.

What about creatures can they carry items?
Oh..yeah of course, so an inventory is not player specific after-all, inventories can be owned by any a creature - including the player.

What about a chest and other containers in the map?
Didn't think of that...I guess those are furniture. For simplicity I can just make them a creature that cannot think or act I suppose...

What about a bag?
...a bag?

Yes a bag. A container the player can carry
Oh. *facepalm*. I didn't think of that either. A bag would be an item but it also has an inventory....

Can the player carry a bag in a bag in a bag?
I guess....there's probably only going to be a weight limit.

How are you going to handle the UI for nested inventories?
...

And what about corpses? They have inventories right?
Yes they still have inventories the player can browse

But you can carry corpses right?
wow it gets even more complicated. Can you carry a dead creature while it holds all it's inventory? That means you aren't just carrying items you can also carry creatures. Hmm maybe dead creatures just drop all their items to the floor. Would make it easier...but has downsides too.

What about worn equipment like armor though? Does that just fall off onto the floor?
Uh I guess it could...unrealistic but that would also make things easier.

Now, weight restrictions...
[conversation continues into the night. No coding is done]
Previous Entry Zoom + Combat
Next Entry progress update
0 likes 2 comments

Comments

Machaira
So it sounds like inventory should be an interface that whatever class needs to can implement.

"Can the player carry a bag in a bag in a bag?"

Only when they're empty. Otherwise it just doesn't make sense. You then don't have to worry about nested inventories.

"But you can carry corpses right?"

I'd say no. Why would you?

"Now, weight restrictions..."

I'm all for these.
February 26, 2012 03:45 PM
omnomnom
hmm the post was marked as draft...i guess i must have published it by accident at some point...republished now...

[QUOTE]
"But you can carry corpses right?"

I'd say no. Why would you?[/QUOTE]

Good point, I was thinking of nethack where you can.

[QUOTE]Only when they're empty. Otherwise it just doesn't make sense. You then don't have to worry about nested inventories.[/QUOTE]

Good idea
March 07, 2012 10:30 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement