This question regards speed, efficiency and lag reduction. Since most PC inventory searches for items in a script seem to search a characters inventory starting on the first page, would encouraging folks to place various checked for widgets (like language tokens) and quest items on their first page decrease script runtimes by reducing the shear number of things checked? If so, would it be significant enough to ask folk to change their inventory management schemes?
Inventory Searches
Débuté par
kalbaern
, déc. 08 2011 03:09
#1
Posté 08 décembre 2011 - 03:09
#2
Posté 08 décembre 2011 - 03:35
I am not currently in a place where I can check this out.
But It has been my experence that the items are checked in a LastIn FirstOut format with the position in the inventory display not counting for much.
A similar question would also be what is faster when searching for an inventory for several items. One loop of GetFirst/Next or several GetItemPossessedBy calls. The GetFirst/Next get extra overhead from the VM. The PossessedBy makes one loop through the inventory each call with less VM overhead. I don't know the answer to that one either. Would make an interesting study though. It could be as reveling as the GetObjectByTag discusion.
But It has been my experence that the items are checked in a LastIn FirstOut format with the position in the inventory display not counting for much.
A similar question would also be what is faster when searching for an inventory for several items. One loop of GetFirst/Next or several GetItemPossessedBy calls. The GetFirst/Next get extra overhead from the VM. The PossessedBy makes one loop through the inventory each call with less VM overhead. I don't know the answer to that one either. Would make an interesting study though. It could be as reveling as the GetObjectByTag discusion.
#3
Posté 08 décembre 2011 - 03:46
As a player, I hate getting a bunch of items that I must carry, that do not do anything but hold some scripters check box.
As a scripter I understand the need to check a item to see if something happens.
I tend to use the PC skin to hold all info, and the campaign database to hold all conversational type info.
As far as your question, it has been my experience as a DM, most players have no sense of organization when it comes to their PC inventories. If you give them bags, for specific things, they will cram them full of something else. If you say keep these things on your first page of your inventory, they will place them on the second to last page, because they have no idea what a first page is. Most players believe that any help out rule, but not enforced rule, does not apply to them. Simply a fact of gaming I guess.
What lags out in terms of inventory seems to come when there is more than 3 containers in the inventory, when the inventory is nearly full of little junk, and really only shows up, when the PC logs in and out of the server. Using the smaller containers, say the misc small, and misc thin items from CEP tend to push it down to 2. the more items, the more lag. In crafting mods, it can be a nightmare. Stacking does seem to help, but if the inventory is full of stacks, it can be even worse.
good luck!
As a scripter I understand the need to check a item to see if something happens.
I tend to use the PC skin to hold all info, and the campaign database to hold all conversational type info.
As far as your question, it has been my experience as a DM, most players have no sense of organization when it comes to their PC inventories. If you give them bags, for specific things, they will cram them full of something else. If you say keep these things on your first page of your inventory, they will place them on the second to last page, because they have no idea what a first page is. Most players believe that any help out rule, but not enforced rule, does not apply to them. Simply a fact of gaming I guess.
What lags out in terms of inventory seems to come when there is more than 3 containers in the inventory, when the inventory is nearly full of little junk, and really only shows up, when the PC logs in and out of the server. Using the smaller containers, say the misc small, and misc thin items from CEP tend to push it down to 2. the more items, the more lag. In crafting mods, it can be a nightmare. Stacking does seem to help, but if the inventory is full of stacks, it can be even worse.
good luck!
#4
Posté 08 décembre 2011 - 07:28
Assuming your premise about inventory loops starting on the first page is correct, then yes, assuming you break; out of the loop when you find what you're looking for. Like Lightfoot, I'm curious about how many items you need to be getting before a loop becomes a better alternative. If I have a few spare minutes I may do a test run to test your premise and that question as well.kalbaern wrote...
This question regards speed, efficiency and lag reduction. Since most PC inventory searches for items in a script seem to search a characters inventory starting on the first page, would encouraging folks to place various checked for widgets (like language tokens) and quest items on their first page decrease script runtimes by reducing the shear number of things checked? If so, would it be significant enough to ask folk to change their inventory management schemes?
Funky
#5
Posté 08 décembre 2011 - 08:11
Think I'll craft some negative traps after loading my inventory in a set pattern to test the last in, first out. Could very well be "where" you place something is moot then.
#6
Posté 10 décembre 2011 - 01:28
This really shouldnt be problem. AI does much more crazy stuff every second so thats it.
Of course its a good prevention to reduce number of system items like "targetting wand", "id card", "emote wand" etc. and also use high stacks for 1x1 items so player can carry more items like herb in one stack which is count as a one item in loop. I am admin on a server where players are creating keeper characters instead of using persisten banking and they usually carry more than twenty full bags of different stuff along with full inventory. And there is a script in OnEnter that removes all temporary item properties from all items - and its fine.
Of course its a good prevention to reduce number of system items like "targetting wand", "id card", "emote wand" etc. and also use high stacks for 1x1 items so player can carry more items like herb in one stack which is count as a one item in loop. I am admin on a server where players are creating keeper characters instead of using persisten banking and they usually carry more than twenty full bags of different stuff along with full inventory. And there is a script in OnEnter that removes all temporary item properties from all items - and its fine.
#7
Posté 10 décembre 2011 - 07:24
I did a quick test. The position in the enventory has no effect on the order the items are returned. Moving the items in the inventory does not change the order they are returned in. Moving items in and out of bags in the inventory does change the order however.
If you really wanted to worrie about how fast the items are found and you are using the GetFirst/next method you could add a SerachCount to your search for the item. If the SearchCount went over say 20 items. Recreate the item in there inventory and create a new one. that would keep the items towards the tio of the loop. It would however move the item around in the PC inventory, Something that they just might not like.
If you really wanted to worrie about how fast the items are found and you are using the GetFirst/next method you could add a SerachCount to your search for the item. If the SearchCount went over say 20 items. Recreate the item in there inventory and create a new one. that would keep the items towards the tio of the loop. It would however move the item around in the PC inventory, Something that they just might not like.





Retour en haut






