mattsemar / dsp-personal-logistics

MIT License
10 stars 7 forks source link

Items in Buffer ignored while requesting #4

Closed ghostorchidgaming closed 2 years ago

ghostorchidgaming commented 2 years ago

Hey again! I noticed that when I have items on arrival, I also have the same items in my buffer that can immediately be used, if I select "Add to Inventory".
Shouldn't the plugin pull from the Buffered items first instead of requesting more from remote? I end up with thousands of duplicate items otherwise.

Example with solar panels:

20211017000146_1

mattsemar commented 2 years ago

So, the UI is a little confusing here, and you're right that you can kinda cheat by sending them to your inventory immediately, but the way it's implemented is like this:

  1. plugin notices requested item is not in buffer
  2. it takes 1000 of the item immediately from stations and adds them to buffer (since we're using virtual drones this happens instantly)
  3. after 59 seconds have passed, it removes the 1000 from buffer and adds to inventory

So, what I can do is make it so the items added to buffer in step 2 are hidden, and not shown, but I haven't tackled that yet. I'll take a look and see if I can get it in the next release.

ghostorchidgaming commented 2 years ago

That makes more sense. I kept spamming Return to Logistics thinking I was helping clear my buffer for new arrivals XD

mattsemar commented 2 years ago

Wow, this turned out to be a great bug report. I didn't realize it, but anything over 1k requested items were being generated out of thin air (oops). I didn't really notice it because I don't typically do that, but the plan all along was to have lower throughput than actual logistics stations (they can get up to 10x vessel capacity incoming at a time). The idea being that if you want to get a lot of items quickly, it's best to have them available on the local planet to draw from.

So, the fix I'm going with for now is to just hide any items that are in the buffer but that still have incoming requests. Before I landed on that, I tried to do something where buffered items were "locked" but it got to be too much to manage.

At any rate, I created a preview release here if you want to test it out. r2modman has an "Import local mod" option under Settings. Don't worry if you don't have time, I'm planning to release it later tonight after I've the nextrelease branch a last review

mattsemar commented 2 years ago

Ok, I released the next version. Please let me know if you're still seeing issues, it's a bit hard to test everything at this point