Welcome, Guest. Please login or register.

Pages: [1] 2
Print
Author Topic: Inventory system  (Read 13057 times)
zenbitz
Community member

Posts: 1164



View Profile
« on: November 30, 2009, 07:54:23 AM »

As in, we need one.  If you need some "game physics" advice on it.  PM me or look me up in IRC or send a smoke signal or tweet or something.

I think we should start with some place holder graphics to represent objects, that would be fine.   I think the inventory GUI badly needs tool tips.

I think our inventory as planned looks a lot like avernum 6.  Although they don't seem to have weight in your "pack" count at all... but whatever, it's just a phat loot / level grind game.
Logged

We are not denying them an ending...
We are denying them a DISNEY ending - Icelus
mvBarracuda
Admin
Community member

Posts: 1308



View Profile Email
« Reply #1 on: November 30, 2009, 01:13:10 PM »

I'm just trying to imagine how we could tackle this step by step. Saritor has been working on refactoring the GUI code and AFAICT the inventory code pretty much relies on it. I haven't seen Saritor for a week so he's prolly rather busy with his job/school. Should I send him an email, asking about the status of the refactoring? Or can we go ahead with implementing the inventory pretty much independent of the ongoing GUI code refactoring?
Logged
amo-ej1
Community member

Posts: 80


elie@de-brauwer.be
View Profile
« Reply #2 on: November 30, 2009, 01:32:17 PM »

I had a talk with b0rland about this too, I believe he was also working on this part. (not the gui part of it though)
Logged
shevegen
Community member

Posts: 705



View Profile
« Reply #3 on: November 30, 2009, 02:50:48 PM »

How about a simple placeholder for it? No inventory system means that quests can't be done because the actor can not carry objects.
Logged

Cleaning away the bureaucracy in PARPG to make our life easier.
b0rland
Community member

Posts: 105



View Profile Email
« Reply #4 on: December 01, 2009, 11:35:41 PM »

Class for inventory is already in place and in svn. If you have any suggestions/additions, let me know or feel free make your own patch. Class name is quite predictably Inventory.
« Last Edit: December 01, 2009, 11:57:10 PM by b0rland » Logged
Kaydeth
Community member

Posts: 185



View Profile Email
« Reply #5 on: December 02, 2009, 12:31:44 AM »

We could use the console commands to display the Inventory in text format until we can get a GUI up a running. But that still requires someone to put the Inventory plumbing together in the gamestate class as well as the dialouge engine.
Logged
zenbitz
Community member

Posts: 1164



View Profile
« Reply #6 on: December 02, 2009, 08:48:18 PM »

I poked in the code a bit.
I think what is missing is attaching Inventory classes to PC & NPCs. 

Also, some one should make a test for picking up stuff on the ground
Logged

We are not denying them an ending...
We are denying them a DISNEY ending - Icelus
b0rland
Community member

Posts: 105



View Profile Email
« Reply #7 on: December 03, 2009, 11:50:21 AM »

I've commited the new inventory GUI today and replaced all the old-style references to inventory that I could find. PC now has an attached inventory object with several slots. Drag and drop inside the inventory and between inventory and container works fine. Objects don't multiply anymore.
There still are things that need testing and some long-time todos
* Dialog/Quest system may have suffered, especially things related to beer Smiley. I'd like to ask someone who worked closely with it lately to check if things are fine
* Regardless of whether it's already broken, we'll end up having problems with it sooner or later. It's no longer possible to refer to object as if it were a text string. The best way of object identification seems to be the ID field that every GameObject has. I'd like a word of feedback from the guys who work(ed) on quest/dialog engine about whether it's a good idea and how much changes it will require. At the very least we'll probably need a helper class to keep track of occupied IDs and corresponding objects and that will allow for easy conversion ID <-> Object and new ids generation.
* Picking up stuff directly from the map isn't implemented yet.
* The objects database is still missing and I don't think anyone started it. For now the visible effect of this is that beer looks like a dagger. Because, well, everything looks like a dagger. Even a rudimentary implementation of the db with properly designed interface would be nice at this point. And some graphics for the objects we plan to have in techdemo.
* Some parts weren't yet tested properly. I suspect evil things will happen if one would try to drag-and-drop to a widget that is not intended for that. I also suspect that "ready" slots in hud and inventory may be out of sync. Please let me know if such things happen. I intend to polish that part during the nearest days.
* I very much dislike the idea of referencing the View tier from the Model tier as we do of lately in Containers:
Code:
self.containergui = engine.view.hud.createBoxGUI(self.name, self, self.events)
...
def showContainer (self):
    if self.containergui:
        self.containergui.showContainer()
This leads to some weird special effects which I had to hack around just to make things work. I think this can be improved, although obviously not high priority.
* In far future I think we should make a joint Container-Inventory GUI (similar to Arcanum et al). Current gui's usability sucks.
For most of the above I'll try to create tickets. Comments are welcome as usual.
Logged
shevegen
Community member

Posts: 705



View Profile
« Reply #8 on: December 03, 2009, 12:25:41 PM »

Quote
The best way of object identification seems to be the ID field that every GameObject has.

Reminds me of what MUDs using http://en.wikipedia.org/wiki/LPC_%28programming_language%29LPC used decades ago - a unique ID for every object. :>


Quote
For now the visible effect of this is that beer looks like a dagger. Because, well, everything looks like a dagger.

Bug! BUUUUG!!!! lol

I should collect quotes.

December 2009: "Hmm, something is strange... every object looks like a dagger."
Logged

Cleaning away the bureaucracy in PARPG to make our life easier.
Beliar
Community member

Posts: 71

KarstenBock@gmx.net
View Profile Email
« Reply #9 on: December 03, 2009, 01:23:11 PM »

[...]
* I very much dislike the idea of referencing the View tier from the Model tier as we do of lately in Containers:
Code:
self.containergui = engine.view.hud.createBoxGUI(self.name, self, self.events)
...
def showContainer (self):
    if self.containergui:
        self.containergui.showContainer()
This leads to some weird special effects which I had to hack around just to make things work. I think this can be improved, although obviously not high priority.
[...]

Well, i put that in so that every container has unique contents. It also has the benefit that it is now possible to wait for the open animation to finish before showing the gui and doing the close animation when the close button is pressed.

But i agree that its probably not good to reference them there but i saw no better way then.
Logged

Wing IDE - http://wingide.com/wingide - Free for OS use
zenbitz
Community member

Posts: 1164



View Profile
« Reply #10 on: December 03, 2009, 09:17:42 PM »

b0land -

I will go through the quest/dialogue stuff and refactor it to fit the new system.   I realized when I posted yesterday that the dialog references to inventory had to be replaced (they were just placeholders anyway).

I also think we should rename 'take stuff' to give stuff.  Then we have give_stuff and get_stuff as dialog functions that access inventory.  The other (duh) thing we need is to be able to check if PC/NPC "has" the thing we are looking for in his/her inventory.  I think this is implemented though.

It would be somewhat awesome if someone could change the colors on the "dagger" image so that it's not exactly the same as the "bag".  Actually the bag icon (repsententing generic container?) I find really annoying.
Logged

We are not denying them an ending...
We are denying them a DISNEY ending - Icelus
zenbitz
Community member

Posts: 1164



View Profile
« Reply #11 on: December 04, 2009, 03:29:00 AM »

There is a trac ticket for this:
http://parpg-trac.cvsdude.com/parpg/ticket/229

Other things I noticed:  Need a input file format for PC and NPCs inventory.  Currently PCs starting stuff is hardcoded.
Also, I think we are going to need a "findItemByName" function instead of by ID.  Since we will basically never know the ID.

Basically - questEngine needs to search PC/NPC inventory for a specific object or type of object and transfer/use/drop/destroy it.
Logged

We are not denying them an ending...
We are denying them a DISNEY ending - Icelus
b0rland
Community member

Posts: 105



View Profile Email
« Reply #12 on: December 06, 2009, 12:58:39 AM »

Another note. I think we need to have two cases in mind. Sometimes we'll only care about whether a user possesses any object of a certain kind (grain from this field or that field, we don't really care as long as beer can be brewed from it). Other times we'll need to check for a certain specific object which e.g. belonged to some NPC ("go steal that big bandit's glasses and bring them to me", not some random glasses, but the ones with specific ID (?)). Possibly both cases can be solved by findItemByName if we start giving those quest items (bandit's glasses) unique names which don't collide with anything else anywhere in the game. Or maybe it's better to refer to items by ID when we have a specific item in mind.

I'll create findItemById anyway since it comes virtually for free. But it's still useful to decide on a preferred strategy to use in quest/dialog engine.
Logged
amo-ej1
Community member

Posts: 80


elie@de-brauwer.be
View Profile
« Reply #13 on: December 06, 2009, 07:04:38 PM »

I played around with the inventory systems and  I ran into a couple oddities/exceptions. See ticket 231 and 226.

I found some other errors too but those were mainly gui-ish things I believe.  But I also created tickets for those.
Logged
shihonage
Community member

Posts: 22



View Profile
« Reply #14 on: December 07, 2009, 10:16:10 PM »

Having gone through very similar decisionmaking process, I have to suggest - use FindItemByName (and FindItemOnThisPersonByName). With unique names.

Do NOT refer to anything by fixed index numbers. It will become incomprehensible very fast.

Unique names are fine, especially considering that you can CreateItem("glasses") and then change the name of THAT SPECIFIC ITEM to "Ivan's broken glasses". Just make sure that the name of each item is stored with it, and NOT JUST in the global "all possible items" index.

In other words... really DO create the item, including the name... don't just make a pointer to template it was created from.

Sorry if much of this is redundant, and carry on.
« Last Edit: December 07, 2009, 10:27:39 PM by shihonage » Logged

Developer of Shelter - Fallout-influenced isometric CRPG. Videos: gameplay_11/08 (re-annotated), introteaser_01/09.
Pages: [1] 2
Print
Jump to: