Dissolving item stacks in parallel or serial #210
Replies: 3 comments 9 replies
-
The problem with parallel eating is even if most of the items are eaten, if a drone drops it, it can still be used by other players normally since the amount remains unchanged. The problem with serial eating is you can't handle fractional health very well. |
Beta Was this translation helpful? Give feedback.
-
When you say fractional health, can you give an example of an item stack that has/would have it? Because if we're talking about an item that starts with 100 health, and it somehow gets 43.2 health, I think it's absolutely fine to just ignore that .2. In the scheme of things, it basically only results in a single extra tick of item dissolving, which is like 2 extra resources. |
Beta Was this translation helpful? Give feedback.
-
Just copypasting what I said in discord, please comment if you disagree: |
Beta Was this translation helpful? Give feedback.
-
Discussion for whether item stacks should be broken down in parallel or serial
Items have a health variable that determines their health. A stack of items is a single item with an amount variable, that has the health of a single item.
Item stacks being broken down in parallel would mean that if dissolving a stack of items for resources, dissolving the whole stack of items is based on decrementing total item health, scaled by the number of items. It would make dealing with fractional health of items simpler. The animation for dissolving makes a bit more sense too. The issue is that it isn't super helpful for player feedback, which can be remedied by adding an item health hud bar next to the reclaimer which shows the item's total health.
Item stacks being broken down in serial would mean that if dissolving a stack of items for resources, dissolving is based both on item health and decrementing current amount in the stack. When the health of the item reaches zero, the health is reset to its initial health and the amount is decremented. It makes it a bit more tricky to deal with fractional health items as item health is determined after compile time. The animation for dissolving doesn't make as much sense here since it seems the whole item is being dissolved when only one in the stack is, but this could be remedied by only applying the animation for when there's one item. This would be better for visual feedback if the item health hud bar isn't used.
Beta Was this translation helpful? Give feedback.
All reactions