by loftar » Tue Jun 23, 2009 12:56 pm
That is, for various reasons, not very likely to happen.
Game mechanics and similar issues (of which there are a few, to be sure) aside, the problem lies mainly with defining what would constitute item identity. To begin with, items in Haven have no primary type*, and therefore no obvious identity for grouping. However, even assuming that there were, it would still be non-obvious how to properly define type identity -- for instance; can bloated leeches stack with non-bloated leeches; can wheat seeds stack with flax seeds; and, assuming that we add food decay, can apples stack with rotten apples?
Even if it were possible to define such things in any useful manner, what, then, happens when objects spontaneously change identity characteristics? For instance, if one apple in a stack of five rots, should that apple be ejected from the stack; or should there be an item "on top" of the stack, so that the stack appears rotten only when the rotten apple is on top; or should it be completely hidden?
Therefore, I don't think that it's possible to define any useful characteristics for generic item stacks. It could be argued that Really Simple(TM) items, like pieces of linen cloth or straw, could stack, but that may not be too obvious either. Particularly so if we decide to change them later on; for instance, to add coloring capabilities to linen cloth or maybe rotting straw or something else (and what, then, would happen to existing stacks?). Instead, we plan on adding certain special-purpose inventory items, such as seed-bags (or quivers, which already exist, if in an imperfect implementation).
* If you've ever programmed in Common Lisp, you can probably relate to that; CL objects can be queried with various well-defined type predicates to check whether they conform to that type, but they can belong to several distinct such types, and the TYPE-OF function is quite unreliable and mostly informative. So, also, do items in Haven work; they can be queried if they belong to one class of items or another, but there is no reliable way to query them for "which" (singular) type they are. The analogy is not perfect, though; Common Lisp objects usually have a primary type returned by TYPE-OF, and the unreliability of TYPE-OF mostly depends on the fact that the primary type is implementation-dependent, while in Haven, there really is no primary type.
"Object-oriented design is the roman numerals of computing." -- Rob Pike