Equivalent-Exchange-3 icon indicating copy to clipboard operation
Equivalent-Exchange-3 copied to clipboard

Show amount of items available in tablet

Open ghost opened this issue 10 years ago • 16 comments

Just a thought, you could have a configurable option to show the amount of items that could currently be made (i.e. just put a number where the stack amount usually goes) just an idea.

ghost avatar Oct 18 '15 20:10 ghost

Im sure that the math involved would cause way to much lag. The table would have to have a calculated number for each item or a number for each item in the tablet selection portion of the gui.

This would probibly be a lot harder to impliment than you think considering the number would be dynamic.

If item value == 8192 And the ammount of emc in the tablet is 999999999999 Then the number of items you could pull out == 122,070,312.49987

If you have that much emc, you could get any item in your tablet unless you add custom values. (999999999999 is a possible number) so if you have this much emc in your tablet, it would have to generate a number for every item.....

But if you modify the idea to only calculate when hovering over the item in the gui, then this would be easier on your pc. And if you show it on the tooltips like the stack and single stack already does, it would probibly work better. On Oct 18, 2015 4:04 PM, "Andrew Graber" [email protected] wrote:

Just a thought, you could have a configurable option to show the amount of items that could currently be made (i.e. just put a number where the stack amount usually goes) just an idea.

— Reply to this email directly or view it on GitHub https://github.com/pahimar/Equivalent-Exchange-3/issues/1012.

reapersremorse avatar Oct 19 '15 04:10 reapersremorse

@reapersremorse :+1:

ghost avatar Oct 19 '15 06:10 ghost

The calculation could run in another thread.

Am 19.10.2015 um 08:30 schrieb anti344 [email protected]:

@reapersremorse

— Reply to this email directly or view it on GitHub.

iTitus avatar Oct 19 '15 08:10 iTitus

It wouldn't work if they ran in another thread since the calculation timing needs to be accurate.

ghost avatar Oct 19 '15 09:10 ghost

If it were acurate enough in another thread, then it would still cause lag spikes when searching or opening the tablet with a good ammount of emc in the tablet. Also if each item had a number on it then you wouldnt be able to see the numbers after you get more than 100k emc, the numbers would run together... On Oct 19, 2015 4:49 AM, "iTitus" [email protected] wrote:

The calculation could run in another thread.

Am 19.10.2015 um 08:30 schrieb anti344 [email protected]:

@reapersremorse

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/pahimar/Equivalent-Exchange-3/issues/1012#issuecomment-149148818 .

reapersremorse avatar Oct 19 '15 12:10 reapersremorse

The numbers would never get that high if you predetermine the amount of slots available in the player's inventory

ghost avatar Oct 19 '15 12:10 ghost

A line in the item's tooltip would suffice. When hovering, the thread could be started and the result can be buffered.

iTitus avatar Oct 19 '15 12:10 iTitus

I thought that you were talking about setting a number for each item in the GUI. I already said that it would be best if the number of items should be in the tooltip.

Wouldnt there still be a large use of RAM when buffering for each individual item? If it works it would be pretty useful.

On Oct 19, 2015 8:05 AM, "iTitus" [email protected] wrote:

A line in the item's tooltip would suffice. When hovering, the thread could be started and the result can be buffered.

— Reply to this email directly or view it on GitHub.

reapersremorse avatar Oct 19 '15 12:10 reapersremorse

Sounds like a good plan

ghost avatar Oct 19 '15 12:10 ghost

The number of EMC in the tablet is known, and the EMC of an item(stack) is known. This is just a simple division. An overflow check beforehand may be necessary. Maybe buffering/threading is not even needed. Lazy is the key here: only calculating when showing the value.

iTitus avatar Oct 19 '15 12:10 iTitus

Threading and buffering sound like unnecessary features for this kind of thing. As we know, premature optimization is the root of all evil. Calculating only when showing the value would be the best option here. Lag might still be a problem since the calculation would be done before every frame.

ghost avatar Oct 19 '15 13:10 ghost

I'm a bit late to the party, but I just had a thought. Wouldn't it make more sense to show the number of stacks that could be made, as constrained by the number of available slots in the players inventory?

That way you'd never have to do a larger string that something like "12, 45" for 12 stacks and 45 more items.

ghost avatar Oct 19 '15 14:10 ghost

Good thought ;)

Am 19.10.2015 um 16:55 schrieb WolfAmaril [email protected]:

I'm a bit late to the party, but I just had a thought. Wouldn't it make more sense to show the number of stacks that could be made, as constrained by the number of available slots in the players inventory?

That way you'd never have to do a larger string that something like "12, 45" for 12 stacks and 45 more items.

— Reply to this email directly or view it on GitHub.

iTitus avatar Oct 19 '15 15:10 iTitus

I like this idea, I'll try to make it a reality in the Minecraft 1.9 version of EE3

pahimar avatar May 22 '16 18:05 pahimar

I would shy away from making this another thread. Spawning a thread is probably a lot more expensive than computing total / cost for all the items on the page (especially if you're using BigInteger for string mathematics).

bk5115545 avatar Jun 23 '16 13:06 bk5115545

There's no need for this to be done in a separate thread. It's a cheap operation.

pahimar avatar Jun 23 '16 18:06 pahimar