Idea to reduce item limit issues - Item stacks.

subenji99

New Adventurer
Joined
Feb 20, 2008
Messages
97
Reaction score
0
I figured the most common reason people corrupt their character by having too many items is because of all the potions and arrows they lug around at once. (myself included :p ) Wouldn't the item limit count be significantly reduced if items stack?

The way Arrows/Bolts work suggest this is possible, as for example, Blessed bolts come in stacks of 100 and 25. Why not combine all your Blessed bolts into 1 mega-stack, not only tidying up the inventory but also reducing item count. The same can be done with potions - every new potion picked up just adds to the same stack when stored, not a seperate item.

I don't think this would affect game balance too much, as it shouldn't affect the weight of all those items you have. (again, arrows/bolts are proof of this.) The only big issue I see is a new need then to split a stack, so you can drop/sell only so many of an item.

Personally, I don't see why this can't be applied for all items, though it might be a good idea not to stack weapons or scrolls like this.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Needless to say this has been thought of before...

This has been going on for over two years, so ye kinda have to figure we've tried everything obvious. ;) - Problem with item stacks is they don't work like individual items. How they work is that there's an item, and then there's a quantity level defining the stack size.

We're getting better, however. We may yet figure a way to go, "Hey, I'm picking up a proj_ - why don't I check my inventory for any matching proj_ and add to that stack, then remove this item." – which would be more than reducing inventory size, it’d also be handy for organizing. That’d be an entirely code side task though.

Potions are similarly stacked items. Whenever you drink a potion, 1 is subtracted from its quality count, and it's removed when it reaches 0. If we had a thing that went, "Hey, I picked up a health_ or mana_, lemme look for a matching pot and add my value to that pot and then delete myself."... Dicey bit being that an item in a pack isn't "active" - it doesn't really "exist" - and that make's it impossible to modify or properties from - and there's no way to remove individual items from a pack script side, so doing things from the other direction is similarly problematic.

Back when we played with these ideas last, they seemed pretty unfeasible (also think it was before we had compliable code), but looking at it now, I think I could almost do the potion stacking script side, save for that pending issue there. It’d be a little unintuitive though, as you’d never have more than 4 expendable potions (maybe I can mod the name to have the drink count, or something). It would, however, let us go back to all 1-shot potions.

Shuriken’s been tinkering with the inventory system in regards to character overflow though. I’ve not gotten anything from him yet, but he does at least seem to be getting a handle on it, and that’d go a long ways to making the issue moot.
 

subenji99

New Adventurer
Joined
Feb 20, 2008
Messages
97
Reaction score
0
I did think it had been thought of before but after a search didn't show up any topics on it, I thought maybe it had been forgotten about years ago :p

On potions, AFAIK only Medium health potions have multiple "charges" - of course, certain rarer potions may do as well that I don't know about. Maybe the multiple drink charges could be scrapped altogether if they are only used for that 1 potion type, which would make that 1 issue vanish :p

At least i've brought up an old idea for review now that it may actually be possible. :)

Edit: i must have misread the first time - you did say that system would go back to 1-shot potions :p
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Actually, large health potions are the only 1-shot potions, all others are multi-shot. This was an effort to reduce inventory size, however. Once upon a time, all potions were 1-shot.

...and yeah, true enough, worth bringing up again. A very long time ago we had a plan to introduce a medicine kit, that worked like a bow, and replace all the pots with herbs that worked like arrows, so ye can see where we've beaten around that particular bush before, sortospeak.
 

Aische

New Adventurer
Blades of Urdual
Joined
Nov 16, 2006
Messages
97
Reaction score
0
Age
40
Location
ger
wouldnt it be possible to invent a container or maybe change one to do the job which has a build in instance of every potion object ingame so that they would work like ammo in half-life so picking up a mana potion wouldnt be like saving another instance of the object mana potion to the next container with a free slot but to add 4 t the counter of the build in instance of mana potion in the given container that way it should be possible to make shortcuts for potions too
even if the counter would be 32bit int its much less then saving 10 to 20 mana potions
 

subenji99

New Adventurer
Joined
Feb 20, 2008
Messages
97
Reaction score
0
Aische said:
even if the counter would be 32bit int its much less then saving 10 to 20 mana potions

Wouldn't 8 bit unsigned integer be enough?
Who's gonna go over 255 potions? :p
 

Aische

New Adventurer
Blades of Urdual
Joined
Nov 16, 2006
Messages
97
Reaction score
0
Age
40
Location
ger
yea 32bit is better for the bolt n arrow part :)
 

Belmont

New Adventurer
Blades of Urdual
Joined
Aug 22, 2005
Messages
475
Reaction score
0
I have always suggested that a NPC (be it in a town or you summon it via a spell (to not have to go back to town)) stacks the items for you. You give him all the items of the same type you want stacked and he gives you back a stack back rounded up or down as needed. (For arrows and bolts)
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Tried that too, and the problem with that still remains. NPC's treat a stack of arrows as 1 arrow, regardless of how many in the stack. There's no way to read the ammo on arrows from the script side, and the trade system does not take it into account.
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Thothie said:
Tried that too, and the problem with that still remains. NPC's treat a stack of arrows as 1 arrow, regardless of how many in the stack. There's no way to read the ammo on arrows from the script side, and the trade system does not take it into account.


Uh.. There's a var on stackable things for how many for how many are remaining... Would be very simple to add another $get() property :S
 

HumanSteak

New Adventurer
RiP
Joined
Jan 5, 2006
Messages
900
Reaction score
0
The Man In Black said:
Uh.. There's a var on stackable things for how many for how many are remaining... Would be very simple to add another $get() property :S
DOIT!
1 big stack of each kind of bolts and arrows would really kickass.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
The Man In Black said:
Thothie said:
Tried that too, and the problem with that still remains. NPC's treat a stack of arrows as 1 arrow, regardless of how many in the stack. There's no way to read the ammo on arrows from the script side, and the trade system does not take it into account.


Uh.. There's a var on stackable things for how many for how many are remaining... Would be very simple to add another $get() property :S

I figured adding a $get() for them would be easy enough (I added one for the potion #drinks no too long ago) - but setting stacks on arrows stacks that are not deployed, that'd be another beast entirely. I also can't think of a way to get the # of arrows in stacks that aren't deployed for the same reason - the item doesn't exist if its inside a pack, beyond a name in your inventory, so far as the scripts are concerned. So it'd have to be adjusted code side.
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Well, we've got a recursive search-pack function.. It could be possible, but hacky, to have it delete all matches for the arrow while keeping track of how many to give the player, then, when the time comes, give the player a stack that large. I know you already have a delete thing in the search - does it work properly?
 

HumanSteak

New Adventurer
RiP
Joined
Jan 5, 2006
Messages
900
Reaction score
0
So if we had 2 stacks of 25 bolts in our hands, then put them in the bag, would they merge together?
Oh nevermind since the first one would go in the bag... Maybe if there's a way to transform then as we hold them like hold 25 bolts in your hands, then take another one from the bag, to make it in a stack of 50 instead of two of 25.
I only suppose that if you hold them in your hands, they "exist"
Tell me if I'm not helpful or annoying :wink:. Just trying to help.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
The Man In Black said:
Well, we've got a recursive search-pack function.. It could be possible, but hacky, to have it delete all matches for the arrow while keeping track of how many to give the player, then, when the time comes, give the player a stack that large. I know you already have a delete thing in the search - does it work properly?
I'm not sure if it works right when ye must search for duplicate items (hence, bank issue). It also doesn't seem to update the client entirely properly, which is why if ye bank an item, yer third person anims tend to go fubar.
 

Jelly

Adventurer
MSC Developer
RiP
Joined
Nov 25, 2005
Messages
1,909
Reaction score
15
Age
32
Location
You are here --> X
The egyptian god of knowledge said:
Dicey bit being that an item in a pack isn't "active" - it doesn't really "exist" - and that make's it impossible to modify or properties from

:!:
So THAT is why you have to hold the item in your hands, when you bank something. :D The little pieces are starting to form a bigger picture in this puzzle.
Would it be possible to make bags 'hands' instead of just bags, so that the items would actually be there. Then you could make them non-usable, only accessable. :idea:
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
No, the items are non-existant for a reason. Every active item is an entity and script… So if all your items were active, assuming you have 70 items – it’s basically the equivalent of spawning 70 monsters. Suffice to say, lag/crash.

That’s not exactly the bank’s problem either, as the bank doesn’t need to get properties off your items nor modify them – it just needs to rip them from your inventory. There’s a couple of reasons that the bank only takes things from hands. Main reason being that there’s no good way of giving you a menu for every item in your inventory (prototype bank tried to do this by categorizing weapons, but it was too complicated). It’d be nice if it was a “store” and it worked like any other vendor (which is how the original bank system worked), but there’s no easy way to pull that off either (at least not that doesn’t result in bjorked characters, apparently).

Complications arise from that too though. Script system has no way of scanning just your hands for inventory by default, and the trade payment system has no idea where the item actually comes from. It can tell if an item is NOT in your hands, or IS in a pack, however. This is why we have the infamous (amongst the devs) “Not-Not in hands” bank line. Bank-think basically goes, “It’s not-not in your hands, and not in a pack, thus I can take it from ye.” – otherwise the bank doesn’t know what item it is taking. But I digress.

Main trick is to find a way to read the # of ammo/quality of items in a player’s inventory. From the code side the only way I can think to do that is basically spawn every item in your inventory that matches the incoming item’s name, read the ammo/quality properties, delete said items, and modify the item going in based on the gathered data. I suspect that would be very problematic. It’s bad enough the way we pull item’s proper names involves spawning temporary instances of an item, doing the same with multiple items, with data tied to the character, I suspect, would not work as well.
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Thoth, I sent you the fix MONTHS ago for making "only in hands" :S
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
I thought you gave up on that, finding the $item_exists function too frightening. :/

I don't seem to have any RTF related to this.

Although even if we fixed the not-not in hands bit, the problem still remains that the payment system could take the inventory item from anywhere, lest we make a new payment_handsonly type o thing.
 

Shurik3n

New Adventurer
MSC Developer
RiP
Joined
Aug 15, 2006
Messages
1,357
Reaction score
0
Age
34
I think combining arrow/bolt stacks seems feasible. I suppose I could combine them when the character is first loaded, however, the only way I can think of to do this would surely add to the intensity of the ReadItem1() function - this would probably only happen the first time they are combined though. Then adding something to combine them when picked up, would have to change the way you grab arrows out of stores though. Making it so they don't actually go to you hand, hence no need to create another item. Just take the quantity data of the arrow stack in the store/chest and apply it to the matching stack, then destroy it from the chest.

I may drop what I'm doing for the item loading (which isn't much) and pursue this instead.

EDIT: Eh... how about I just make a script command that will compare the items in a players hand (to see if they are the same bolt/arrow type) and take their quantity data, add it together, delete the items and create the new one with the new stack size. Have some npc talk call this and bam, combinable stacks

Infact, I might expand on this (a lot) and make some sort of fletching system... Imagine some recipies to make your own arrows :O. Torch in one hand, wooden arrows in the other - combine to make fire arrows. Lesser ice blade + wooden arrows - ice arrows (gib for greater ice arrows !!).

The only hard bit of this, for me, is the script side part. I would want to make these recipes handled script side instead of hardcoded. Thoughts?
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Thothie said:
I thought you gave up on that, finding the $item_exists function too frightening. :/

I don't seem to have any RTF related to this.

Although even if we fixed the not-not in hands bit, the problem still remains that the payment system could take the inventory item from anywhere, lest we make a new payment_handsonly type o thing.

Wasn't an RTF - It was just a simple function that I sent via MSN
 
Top