ID:153359
 
Spuzzum wrote:
(any game which doesn't stack objects reasonably just sucks)

Drawn from the discussion in "Why a money var"...

Im mildly curious about others handling of stacking. As I see it, there are several things you can do, to either simulate or do actual stacking.

Simulating stacking would be to simply show items as stacked, if multiple are found in the same spot.

Actual stacking involves keeping track of how many of the obj the obj actually is, and cloning it when dropping and such.

Both have their advantages, and are practical in different areas I suppose. Where you may run into problems with #2(Actual stacking), is with items that have roughly the same properties but not quite. Two Bone Wand of Cindering, for example, each with a different amount of charges.

To keep game integrety, #2 is not practical here, unless you want to keep another list for differential info amongst the same object.

For things like coinage, #2 is very practical, however. There's no need (usually) to make a distinction between two gold coins, pennies, oompabows or whatever currency you are using.

Which brings up another point. When differential info DOES occur amongst the same object, do you stop stacking them, or stack them and force the player to scurry through the different obj's to check which one is the one with a different amount of charges? (He would have to do that anyway, but this way its easier to spot which one has a varied amount. Here's an example).

You are carrying the following items:
Bone Wand of Cindering,
4 Bone Wand of Cindering,
200 gold coins,
50 copper coins,
2 Manisi herb,
Sword of Ethereal Energy,
2 Copper Hammer of Striking


This assumes that since the first(top) Bone Wand of Cindering has a differing amount of charges from the 4 others, it occupies its own place in your inventory. NOT using this idea, it would look as follows:

You are carrying the following items:
5 Bone Wand of Cindering,
200 gold coins,
50 copper coins,
2 Manisi herb,
Sword of Ethereal Energy,
2 Copper Hammer of Striking


Thoughts?
If I had three Silver Swords and one had less durability, I'd separate it from the other two. It just seems normal to me. =)
Alathon wrote:
2 Copper Hammer of Striking


Thoughts?

You can't have 2 Copper Hammer of Striking, they're lore! The way I would do it, is have some items stackable, and others not. Really, could you stack a bunch of swords in that tiny backpack and save space? not much. And if you would be doing it just to keep the eye clutter down, you could still use it for items where variables (such as charges) dont change, like your mansi herb, or your coins, or your stack of fish fillets. The way I do inventory systems (I dont use stat panels) there is limited ammount of space, so I use stacking on things that can be stacked, and others that just wouldn't handle well stacked. I guess it really depends why you need to stack the items.
Which brings up another point. When differential info DOES occur amongst the same object, do you stop stacking them, or stack them and force the player to scurry through the different obj's to check which one is the one with a different amount of charges? (He would have to do that anyway, but this way its easier to spot which one has a varied amount. Here's an example).

That's the system I always use -- objects stack as much as they can conceivably stack, but only if they match variables. Piles with different variables don't stack together.

Certain objects which are almost always different will never stack, even if an exact match occurs -- weapons, tools, gemstones, etc.
In response to Spuzzum
That's the system I always use -- objects stack as much as they can conceivably stack, but only if they match variables. Piles with different variables don't stack together.

What about, say, cursed items? For example, you have 10 healing potions; 9 of them stack together, but one doesn't. The player knows that one's been poisoned, even though the character doesn't have that information.
In response to nick.cash
nick.cash wrote:
What about, say, cursed items? For example, you have 10 healing potions; 9 of them stack together, but one doesn't. The player knows that one's been poisoned, even though the character doesn't have that information.

I think the key is to only use variables that are obvious. Better yet, base the seperations in stacking by the player's knowledge.

For example, an aged mage would be able to spot a cursed dagger with laughable ease, and so cursed items would form different stacks than non-cursed ones. On the opposite end of the spectrum, our dull-witted, mace-swinging barbarian wouldn't be able to stack items based on their magical affections, although maybe stacks based on the item's durability. Such a system wouldn't give exact numbers or answers, but gives clues that a certain item is "different".

Definitely a great feature for a roguelike. :)
In response to nick.cash
nick.cash wrote:
That's the system I always use -- objects stack as much as they can conceivably stack, but only if they match variables. Piles with different variables don't stack together.

What about, say, cursed items? For example, you have 10 healing potions; 9 of them stack together, but one doesn't. The player knows that one's been poisoned, even though the character doesn't have that information.

A combination of both systems might work -- making it such that all unidentified/partially identified objects stack virtually as well as physically, while all wholly/magically identified objects only stack physically.

Thus, you might have a stack of 10 healing potions, though internally it'd be a stack of 9 mundane healing potions and 1 cursed healing potion. Grabbing a potion from the virtual stack would randomly pick one of the hidden physical stacks based on weighting (so you'd have a 9 in 10 chance of getting an uncursed potion if you grabbed a potion).
In response to Spuzzum
Spuzzum wrote:
A combination of both systems might work --

Hmm. I sense some library material spewing up from this discussion.
In response to Spuzzum
Grabbing a potion from the virtual stack would randomly pick one of the hidden physical stacks based on weighting (so you'd have a 9 in 10 chance of getting an uncursed potion if you grabbed a potion).

But chances are someone doesn't just randomly pick potions to drink. There is probably some order in which the person will be drinking them based on how the person is storing them.
In response to Theodis
Theodis wrote:
Grabbing a potion from the virtual stack would randomly pick one of the hidden physical stacks based on weighting (so you'd have a 9 in 10 chance of getting an uncursed potion if you grabbed a potion).

But chances are someone doesn't just randomly pick potions to drink. There is probably some order in which the person will be drinking them based on how the person is storing them.

This is for simplicity's and sanity's sake. Otherwise you'd have to track three physical stacks internally if you got additional mundane potions after picking up a cursed one.
In response to Spuzzum
This is for simplicity's and sanity's sake.

But abstraction is evil, gotta have realism down to every minor touch or else you might break the suspention of disbelief :P!

Otherwise you'd have to track three physical stacks internally if you got additional mundane potions after picking up a cursed one.

Just keep them as seperate items internally and then display the stacked results to the player. Then you could just have the player use the first potion on the list. Or you could let the player decide exactly how he's storing all the items and let him choose which one :).
In response to Theodis
You both make compelling arguments, though the gameplay is the most important factor to consider, so I'd have to agree with Theodis on this one. Unless you have a way to expand that stack back into a list of individual objects, though, the player would just grab the last thing added.

Keeping a list internaly that tracks variants of the base object and thier locations in the stack shouldn't be too difficult to implement. Coming up with a solution for displaying the stack that would be appropriate for different player's perceptions, on the other hand....

How would you show a stack with a cursed item to a player who can percieve cursed items, while at the same time only showing the stack to players who aren't so perceptive?

~X
In response to Xooxer
Tracking stacks without any physical stacking is bound to crash your game once you breach an object limit.
In response to Spuzzum
Um, ok. Haven't we covered that already? I assumed everyone knew that when I said stack, I was refering to a single object.

~X
In response to Xooxer
Not really. If you have some way of expanding a stack back into individual objects, then you logically must track individual objects. The only conceivable way to allow a system which has multiple different types which virtually stack together is to A) virtually stack two stacks together, picking randomly, or B) virtually stack stacks in order of stack types, picking deterministically.

The first (A) is the best solution to me, because it offers a minimum memory footprint and it's more intuitive: if I put a cursed healing potion into my sack without knowing what is, then reach into my sack and pull out a healing potion, I have no idea which of those potions I've picked up, just that I've picked up a potion. When you open your wallet, do you grab the last quarter you put in, or do you grab the first quarter you can get? =)
In response to Spuzzum
*grins* Just make the curse infect the entire stack. ;)
In response to Spuzzum
When you open your wallet, do you grab the last quarter you put in, or do you grab the first quarter you can get? =)

True, and this is why every once in a while I pull out a Cursed Quarter of Canadianess.
In response to nick.cash
nick.cash wrote:
When you open your wallet, do you grab the last quarter you put in, or do you grab the first quarter you can get? =)

True, and this is why every once in a while I pull out a Cursed Quarter of Canadianess.

Cursed? I once heard of an american vending machine that would return you your canadian money, but you'd still get the drink. That's closer to the opposite of cursed.