Forum Index > Suggestion Box > Inventory optimization/Container use imp...
Page 1
Author
Thread Post
Worthlesshobo
Level 60
Joined: 11/13/2014
Threads: 1
Posts: 2
Posted: 12/22/2014 at 12:32 PM
Post #1
Hello all,
I had a suggestion that I think might help with server load and generally make players lives easier.
Lately I have been doing many missions and simply stacking the mission satchels in my inventory to be used later, so as to consume less inventory space. Today I decided to use them all, I found that it took quite a long time and it was slightly painful because each had to be individually used and the page needed to reload each time.
My suggestion is that an option to use multiple containers of the same kind at a time be implemented to ease the use of these items. This would not interfere with the need to reload the page afterwards. The one problem I think might arise is the one of inventory space. If a player has limited inventory space and tries to use 20 containers (Such as mission satchels) it may return more items then can fit in both equipment and inventory. Unfortunately without knowing the contents of the containers you cannot simply check the inventory space available because there are 2 separate inventories. One solution is to limit the use of containers to a number such as 5 and warn players to make sure they have the space in both inventories. Another solution would be to have the items send through the trade system by the site administrator (The same way the mission satchels are given.) so that it can check your inventory space when accepting the items. (or use a custom container)
Now like this it wouldn't help server load much because the server would simply run the method 5 times instead of once each time, however, assuming that these calculations are something similar to this:
Math.random() * 1000
And then is checked to see which range gives what item for the specific container. So say random returned 454 then it would check to see where that falls, maybe 450 < x < 460 is 16 strong_healing_elixir_II.
Following this formula it would be possible to preload these random calculations, maybe 1000 of them, save them to an arraylist, and write them to a file. (or whatever way you prefer/would work best for the server) That way the server could simply take the numbers from these already loaded calculations and would not need to calculate more every time someone opens a container. All that would need to be saved each time is number of the arraylist that the previous user finished at, or 1 random calculation could be used to find a starting point on the arraylist.
It may not sound like saving the integers to a file would speed up the server much, however every little bit counts, from experience you always want to optimize what you can as much as possible so that you have the resources you need for other places that cannot be optimized as much.
NOTE: This may not work for all containers as some will have different value limits, however multiple arraylist files could be saved. I had mission satchels in my mind when I thought of this so that is the example used in this suggestion.
NOTE: Math.random() * 1000 is probably not how it is actually coded when implemented in the system, it is just the most general way of getting a random number in Java and serves its purpose here just fine.
NOTE: The random calculations could already be preloaded, I'm not sure, it is merely a suggestion for the owners to promote server optimization in case they hadn't thought of doing it that way previously.
Thank you for reading my suggestion and please feel free to leave any thoughts on the matter below. If anyone has any questions on this I would be happy to explain anything further.
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,242
Posts: 15,406
Posted: 12/22/2014 at 4:57 PM
Post #2
Thank you for the thorough suggestion! =)
When we revamp the Inventory system, I will try to add some sort of "open multiple" feature.
As for your specific suggestions, the actual PHP code would run in fraction of a thousandths of a second. The only real stress comes from database interactions, but I would just consolidate it to grab everything it needs to grab with as few queries as possible.
As for the space issue, my newer code already plans for such instances and if it can't find inventory space, it just mails you the item. The older code is not quite as smart though lol.
Worthlesshobo
Level 60
Joined: 11/13/2014
Threads: 1
Posts: 2
Posted: 12/23/2014 at 10:16 AM
Post #3
Alright sweet! I look forward to the eventual update. :) Although one question that you may or may not wish to answer, what specifications does the server computer have? Just curious.
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,242
Posts: 15,406
Posted: 12/23/2014 at 8:33 PM
Post #4
The best that our Host currently offers. =)
Our future upgrades would be to add additional servers instead of upgrading the one that we have.
Confirm Action
Are you sure you wish to delete this post?
Confirm Action
Are you sure you wish to restore this post?
Confirm Action
Are you sure you wish to report this post?
Go to Top
This Page loaded in 0.009 seconds.
Terms of Service | Privacy Policy | Contact Us | Credits | Job Opportunities