minetest / minetest_game

Minetest Game - A lightweight and well-maintained base for modding [https://github.com/minetest/minetest/]
http://minetest.net/
Other
1.43k stars 578 forks source link

[Feature request] Change stack size from 99 to 96 #1724

Closed MisterXtreme closed 7 years ago

MisterXtreme commented 7 years ago

Why?: Because you can't divide 99 equally, as for changing it to 100, that would work, but you 96 is a number that can be halved over & over, without any "leftovers"

raymoo commented 7 years ago

102 divided by two is 51 so you can only halve it once.

MisterXtreme commented 7 years ago

Whoops, you're right. Looks like 96 is a good number. As for backwards compatibility, even if the max number of a stack is there, it only limits how much you can collect and store, existing stacks of 99 will still be 99.

paramat commented 7 years ago

Because 3 digits would be a problem this seems to have been deliberately chosen to be the largest 2-digit number. What advantage is there to repeated halving?

MisterXtreme commented 7 years ago

I was just thinking it makes inventory related shenanigans easier, I do admit though that I don't know how many/if people would actually want this, only that I personally do.

octacian commented 7 years ago

I think that this can be configured using a setting in minetest.conf. Check the example minetest.conf files in the core repository. Maybe not though. Also check the Lua API (sorry, too lazy to do myself).

Also, you should update the OP and change the title of this issue. On the concept of changing to 96, I'm personally neutral. It could be a great improvement as one wouldn't have to deal with leftovers when writing more complex inventory-related mods.

paramat commented 7 years ago

Sorry changed my attitude to this, not opposed, am neutral. I must admit 99 is not a nice number, and 96 can be divided many ways into 3s and 2s, so it gives me 'numerical satisfaction'. But then i have a bias towards 2^n and 3*2^n numbers.

sofar commented 7 years ago

Just leave it as is for now. After the release we can pick a strategy perhaps.

rubenwardy commented 7 years ago

Needs engine support as there's no good way to set a default stack size

Fixer-007 commented 7 years ago

Here is my idea, use 72, it divides nicely. But no idea how it will be in actual gameplay:

default

P.S. and introduce that awesome inv management features from MC

MarkuBu commented 7 years ago

You can set a max stack size, but didn't work for all items.

I still support a stack size of 72. It is a perfect number to split stacks. You can split it to two stacks, four stacks or nine stacks without a rest.

I also think it would be good to increase the player inventory. Than you can carry more different items. Currently the inventory is 8x4, so 32 different items. I think 9x5 would be better.

currently you can carry 3168 items. With 9x5x72 it would be 3240, a little bit more than now and 45 different items

Nevertheless, it should be possible to set a global max stack size for all items

MarkuBu commented 7 years ago

@Fixer-007 LOL, that was synchronous

MisterXtreme commented 7 years ago

Hmm, even better would be if a sub-game/mod could define the max size, I don't know if that is possible, but it would mean that different subgames/mod could have the stacksize set to what they want, which probably makes more sense then "forcing" one size via the engine. Thoughts?

MarkuBu commented 7 years ago

It is possible to change the max stack size, as I mentioned. But not for all items. Dyes for example can be stacked to 99, even is max stack size is different

Desour commented 7 years ago

Hm, wouldn't players think, that new stacks wouldn't be filled up to the limit?

ghost commented 7 years ago

Engine change needed? Really?

I mean. Even a simple two line mod can change the default stack size for pretty much all items/nodes (except some of the hardcoded values that ignore the stack_max value of the items/nodes).

I don't see why that needs an engine change.

MarkuBu commented 7 years ago

I don't see why that needs an engine change.

Because there are some hardcoded items?

ghost commented 7 years ago

Making hardcoded items configurable (or, not even that. It only would be fixing the bug that the function does not respect stack_max) count as engine change? To me an engine change to would be something fundamental, like properly flowing liquids, or proper lighting.

The issue should be moved or re-opened here, yes, but making hardcoded values respect a configurable value is a bugfix, to me, not an engine change.

MarkuBu commented 7 years ago

Engine change is everything that has to be changed in the minetest code (not minetest game). And to change the max stack size for example for dyes has to be done in the engine, because stack_max is ignored by dyes and can't be changed by a mod

So, engine change needed!

ghost commented 7 years ago

So it's only another word for "not in our scope" (where "our" is minetest_game)? Okay, makes sense then.

rubenwardy commented 7 years ago

Engine change needed? Really?

Yep. There's no way to set a default stack size if items have already be registered, so we need engine support for this. You could hack it and override all 99 stack maxes, but that's a hack.

MisterXtreme commented 7 years ago

OK, issue created for Minetest Engine here: https://github.com/minetest/minetest/issues/5730

ghost commented 7 years ago

There's no way to set a default stack size if items have already be registered

You can always change the individual stack size for registered stuff which works in most cases.