Post-Apocalyptic RPG forums

Development => Programming => Topic started by: b0rland on November 06, 2009, 10:45:15 AM



Title: Object 'thumbnails'
Post by: b0rland on November 06, 2009, 10:45:15 AM
Need an advice from those who worked with object xmls/images lately.

I'm currently doing a rework of inventory gui. One of the problems I'm trying to fix is the fact that objects and the images that represent them are currently hardcoded in inventory class. I'm talking about images that are displayed when you open the inventory screen. Those may and probably will differ from images that represent the same object when it's just lying on the map.

Keeping those "inventory" images in the same place as the rest of the images seems to be a reasonable solution. That means keeping metadata in <objectname>.xml.
My questions are:
1) Whether there are any downsides to this approach or any serious reasons to do it differently?
2) What would be the good way to store these inventory thumbnail images in xml? As a separate action?
3) Reading the script that parses those xmls would probably help to answer 2). Can someone point me at that script?

Thanks everyone in advance.

Update: Quite typically, I found the parser script the second after I posted this question. So, judging by it, it seems that creating a special action for inventory display is the quickest/most straightforward way to store inventory thumbs. Any serious objections to that?


Title: Re: Object 'thumbnails'
Post by: Kaydeth on November 06, 2009, 02:37:50 PM
I assume you are referring to the FIFE object files in the objects directory?

One problem with sticking extra data in these files is that we currently aren't storing any information from these files within PARPG code. It's all fed into FIFE and we forget about it. We would have to a similar extension that we did for FIFE instances where we create and object both in FIFE as well as the game code itself.

One thing I'm not so sure about it is this... Have we decided that items will actually lay around on the map? Or will they instead always be in a container (either one on the map or in your inventory)? If items can never be on the map then we won't have to make extra graphics for them and using the FIFE object files for thumbnail images wouldn't make any sense.


Title: Re: Object 'thumbnails'
Post by: zenbitz on November 06, 2009, 09:29:01 PM
I think we have to assume "everything" can be on the ground as well as in a container.
(for some values of everything).

I also don't like having a python class AND an XML file for each instance.  I guess we need python code for the class of objects, and then XML that instantiates them? 

I am probably wrong but it seems like FIFE reads the map.xml file and from there references further xml.files for graphic details etc.   Probably we should put some kind of hook in fife that instantiates the python (parpg) version of these objects in game (mechanics?) terms.


Title: Re: Object 'thumbnails'
Post by: superfluid on November 07, 2009, 02:27:30 AM
I think we have to assume "everything" can be on the ground as well as in a container.
(for some values of everything).

I think for ease of implementation (not to mention saving us from having to render ground items for every time) it probably will make sense to go the WoW route and make any loot on the ground into a generic looking loot pile graphic.


Title: Re: Object 'thumbnails'
Post by: Gaspard on November 07, 2009, 04:29:32 PM
is it going to be even more crazy work later on to rework that general 'pile' into individual objects ?

I was quietly imagining individual things having their own map ground images as opposed to the inventory images and when you stack 2+ items on one spot would trigger the 'pile' graphic image.

 ???


Title: Re: Object 'thumbnails'
Post by: zenbitz on November 09, 2009, 02:22:48 AM
obviously 2+ things should get a generic 'pile'.   I suppose we could have a few generic "single" objects: 

*Weapon (maybe one for melee weapons, one for guns)
* Food
* Clothes/Armor
* Equipment/Tools
* Raw materials  (Wood, metal, etc.)

Maybe something for medical supplies / or liquids if we get frisky.


Title: Re: Object 'thumbnails'
Post by: b0rland on November 10, 2009, 11:08:20 AM
Regardless of whether or not we will use fife's object files for item, we certainly will need a multitude of our own attributes for items. Thumbnail is only one of those, inventory will also need weight and bulk and the set of possible wearing locations for each item. And we'll probably need 20+ more once we start implementing character stats. So the logical solution seems to be creating our own xml descriptions for each item. Later we can merge FIFE xmls into ours (since we use a custom loader anyway) or decide we don't need FIFE's xmls for items at all. This may also be the first step for moving all the generic properties for each object type into a separate xml file instead of describing them each time this object appears on the map -- we discussed that thing with Kaydeth couple of months ago.

If there are no objections to this scheme, I'm creating a ticket in Trac.
@Kaydeth: this may be a good chance to involve additional developer, since this part seems quite separate from inventory GUI, but required for its successful completion.


Title: Re: Object 'thumbnails'
Post by: zenbitz on November 11, 2009, 12:57:46 AM
that makes sense b0rland.

I had kind of an interesting idea involving dropped stuff...it's pretty out there though... I am going to fork it to mechanics forum...  the upshot is - what if there were NO graphic for dropped things, you ALWAYS had to "search" an area for them?

Mechanics thread.
http://forums.parpg.net/index.php?topic=541.0


Title: Re: Object 'thumbnails'
Post by: Kaydeth on November 11, 2009, 02:06:59 PM
Thumbnail is only one of those, inventory will also need weight and bulk and the set of possible wearing locations for each item. And we'll probably need 20+ more once we start implementing character stats.
I see your point. We'll need some sort of database for all the items stats that we are going to implement. XML files will probably be the easiest thing.


Title: Re: Object 'thumbnails'
Post by: b0rland on November 17, 2009, 10:40:58 AM
http://parpg-trac.cvsdude.com/parpg/ticket/185


Title: Re: Object 'thumbnails'
Post by: b0rland on November 24, 2009, 09:20:25 AM
With current amount of free time, I most likely won't be able to manage the "objects database" implementation within reasonable time. So if someone has time and inspiration for it, feel free to start.
I doubt, however, that this is a good task for newbies. Or at least it might require some supervision.


Title: Re: Object 'thumbnails'
Post by: shevegen on December 05, 2009, 03:35:27 AM
A side note ... the dialogue system could need an easy way to query whether an actor (or the npc he is talking to) has an object in his inventory. It might be removed, or exchanged as part of a dialogue. Anyone has thought about a simple way for this? Not so important for techdemo I but I am just wondering anyway.


Title: Re: Object 'thumbnails'
Post by: zenbitz on December 06, 2009, 12:25:18 AM
actually shevy, it is kind of important and there is a trac ticket for this.  Otherwise we get repeating loops of giving stuff.