KBVE / kbve

KBVE Monorepo
https://kbve.com/
11 stars 12 forks source link

[Concept] : [ItemDB] - Expiration Ticks / Item Lifecycles. #2391

Open h0lybyte opened 1 month ago

h0lybyte commented 1 month ago

Core Concept/Theory A clear and concise description of what the concept is. Ex. It would be cool if [...]

Certain items within the player's inventory should have an internal expiration , while equipment and general armor should have a durability system. We can handle this through an item lifecycle with an async tick system!

This should not be a major focus right now, but I am going to create a ticket to remind myself that during the migration of the ItemDB to the IndexedDB aka out of localStorage, we should try to make sure that the tick system is included during that process.


Alternative Ideas Is there any other way this concept could be used?

It will help control the inventory management and make certain objects harder to horde. This is mainly an anti-pack rat mechanic, ideally discouraging players from grabbing too much food.


Alternative Examples/Sources Are there any other references that you can provide?

Well we can test case this with the fish, since its easy to catch, it should have a short expiration timer.


Additional information Add any other context or examples of this concept here.

No additional information as of right now. Ideally we would create a new item handler for this.

h0lybyte commented 1 month ago

We will also have to rework the core itemdb into the Dexie , migrating it out of the nanostore and cache the item images as well.

h0lybyte commented 3 weeks ago

The tick / expire will be offloaded to a web worker https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers