ID:151286
Oct 15 2011, 2:09 pm
|
|
In most RPGs, the inventory system looks more like Baldur's Gate or Diablo and less like a vertical list. Since skins give us greater freedom in our interface style, I was wondering if anyone has attempted a less list looking inventory system. I was imagining that a beginining might be using a grid system where every item has an x and y position (maybe even a secondary map?) obtained based on where the item is drag and dropped in the inventory pane and the inventory displays based on that position as opposed to a list. It could be even be exapanded to allow for various item sizes so that an object con occupy more cels (say a large item).
|
Oct 15 2011, 2:15 pm
|
|
I've never seen one done like Diablo. Try looking at the grid element and the proc :
|
In response to Kyle_ZX
|
|
Actually, I think MouseDrop is what you meant :-)
I haven't seen many games veer far outside a list style inventory and was wondering if anybody had tried it. I got a simple grid based inventory working and it looks alot nicer. I imagine there are other ways to do it, too. |
One thing I've been wondering is, given this kind of system, is there an efficient sorting algorithm that allows you to pack the items in your inventory so that they take minimum space?
|
In response to Toadfish
|
|
Toadfish wrote:
One thing I've been wondering is, given this kind of system, is there an efficient sorting algorithm that allows you to pack the items in your inventory so that they take minimum space? My hunch is that it's not that bad if you have restrictions on the shapes of the inventory and the items. If you have items that are rectangles fitting into a rectangular inventory it's probably easy enough, and you can probably develop a simple heuristic that does a good job. If you're looking to pack arbitrarily shaped items into an arbitrarily shaped container it's probably much harder. To do this on a second map control I think you'd have to use screen objects, which means you might as well do it on a single map control. If BYOND had better mouse support I'd probably do this with screen objects, but the way it is now I'd probably do it in a browser control using JavaScript. That has some benefits you won't get from BYOND even with improved mouse support. |
In response to Forum_account
|
|
Forum_account wrote:
Toadfish wrote: Hmm, yeah, I think even with only rectangles this would be similar to the bin packing problem, so a heuristic is definitely the way to go. According to the article, one optimal heuristic for the bin packing problem is to sort the items from biggest to smallest, and place them in the first bin they fit. So extending this into a 2-dimensional inventory we can maybe partition the inventory space using something of an R-tree and place the sorted objects (height first width later rather than area, I'd say) in the first 'node' they fit. |