Loot Chest UPS

by ptx0

UPS friendly, Space Exploration-centric fork of LootChestPlus. Supports all loot added to entity prototype (TheDeadBurn, Alien Loot Economy, Bobenemies). Attempts to accumulate uncollected loot in a game-engine-friendly manner. Adds Multi-Surface support for SE, allowing you to make things easier or harder.

Content
2 years ago
1.1
2.56K
Logistics

i [RESPONDED] Too many items -or- That's all she'll 'old, cap'n!

2 years ago

The event-based trigger is awesome! However, when using a mod like Bitercide, which kills everything in a massive radius, sometimes so many items drop simultaneously that there isn't enough room in the chest.

Brainstorming a few ideas/improvements...

(1) Give loot chest 65530 slots like Infinite Buffer Chests, to better absorb surges of items.

(2) Make the Loot Chest larger, like Warehousing Mod sized, to fit more loaders/inserters for players going the belt route.

(3) Config option to destroy excess items if a loot chest is placed but there isn't enough room.

2 years ago

Ah, I see #2 is already on your roadmap.

2 years ago
(updated 2 years ago)

well, i could have an option not to print the warning. it'll effectively be an infinitely large chest then (but no UPS impact from making it have hundreds of slots).

2 years ago

ok, so, i looked finally at the code for this (I got a head injury last Saturday) and Pi-C refactored the warnings on 1.1.10 so that you can go to Player settings tab and disable the warnings printed.

it'll just store the list forever and, when entities die, it will attempt to insert whatever it can into the chest that had accumulated since the last time.

i've done this on a test map. you can disable the warning, and eliminate a whole 50,000 enemies, and the chest will just silently keep adding and unloading items.

there's a downside to this approach, since we're not using on_tick handler to find if there's room in the chest (to save CPU), if you don't have entities dying, the chest does not attempt to re-fill.

Pi-C β˜†
2 years ago
(updated 2 years ago)

Sorry, I wasn't subscribed to new threads and noticed this one only now.

it'll just store the list forever and, when entities die, it will attempt to insert whatever it can into the chest that had accumulated since the last time.
…
there's a downside to this approach, since we're not using on_tick handler to find if there's room in the chest (to save CPU), if you don't have entities dying, the chest does not attempt to re-fill.

Using on_tick all the time is excessive. What do you think of this approach?

  • Move the hidden storage from a table to a script inventory.
  • When something dies, add the loot to the inventory, adding slots if it isn't big enough. Activate on_tick.
  • In on_tick, try to unload the hidden inventory into the loot chest and decrease inventory size by the number of empty slots.
  • Listen to on_script_inventory_resized and deactivate on_tick when event.new_size == 0. (EDIT: We'd probably also need something like a counter to make sure that all players' hidden inventories are empty before turning off the on_tick handler.)
2 years ago

i don't like the idea of having any on_tick in it at all, tbh, a button to try dumping into the box would be better.

Pi-C β˜†
2 years ago

a button to try dumping into the box would be better

Agreed. But even just one button causes considerable overhead because you must handle a GUI (which entails handling events for joining/removing players and for button clicks). It would be easier to provide a command. This way, we could quickly get the basic function implemented and build the GUI around it at our leisure. (I could even imagine a more extended GUI, with separate buttons for the different items on the storage list, so that one could choose what items next to move to the loot chest.)

2 years ago

ah, now you're speaking my language. though an optional button for accessibility would be best - i have disabled friends who find typing to be difficult, and i'm always trying to include them in things.

2 years ago

Oooh, taking that gui per-item idea and running with it, you could extend it further...

  • Blacklist / whitelist items to be moved into the loot chest (maybe partially borrowed from the deconstruction planner gui). Excluded items get instantly deleted instead. This simulates "Leave those on the ground to despawn" without the UPS penalty.
  • Priorities. Taking Pi's idea of manually selecting what to dump, the player could set a priority number and the mod would always try to dump into the chest in that order.

Out of scope for this thread, but Pi sparked the ideas. :)

2 years ago

items left on the ground never time out or despawn, however some mods might mark them for deconstruction. those deconstruction planners time out after 15 minutes by default, and after that then they're just items on the ground.

2 years ago

Oops, I musta had corpses on the brain. :)

2 years ago
(updated 2 years ago)

items left on the ground never time out or despawn, however some mods might mark them for deconstruction. those deconstruction planners time out after 15 minutes by default, and after that then they're just items on the ground.

Would it be possible to add a comand to clear ground in loaded chunks only to clear any artefact laying on ground. To pickup items on the witelist before chest is placed if the setting that makes them lay on ground is enabled. Should the comand be runed before it's placed just give the player a message "No chest placed" or "No chest found" Please sad face.

Pi-C β˜†
2 years ago

Just uploaded a new version. You can now use these commands:

  • /LC-list-loot-chests
  • /LC-show-hidden-storage
  • /LC-empty-hidden-storage

No command takes any arguments, and the names should be self-explanatory. Have fun! :-D

New response