-
Notifications
You must be signed in to change notification settings - Fork 406
Description
Your GTNH Discord Username
10110812111510597110
Your Pack Version
2.8.4
Your Proposal
Scanning an inventory via transposer.getStackInSlot() is extremely slow because it appears to wait ~1 server tick per call.
A 54-slot scan takes ~2.8s at 20 TPS. Please consider removing/reworking this delay
Test code
local function f1()
local storageSize = runtime.grid.transposer.getInventorySize(runtime.grid.side)
for i = 1, storageSize do
runtime.grid.transposer.getStackInSlot(runtime.grid.side, i)
end
end
local function f2()
local storageSize = runtime.grid.transposer.getInventorySize(runtime.grid.side)
for i = 1, storageSize do
-- runtime.grid.transposer.getStackInSlot(runtime.grid.side, i)
end
end
local function measure(fn)
local t0 = computer.uptime()
pcall(fn)
return computer.uptime() - t0
end
local t1 = measure(f1)
local t2 = measure(f2)
print(string.format("f1: %f, f2: %f", t1, t2))
Your Goal
OpenComputers has a very high skill floor if you want to use it efficiently for automation, and it’s also significantly more expensive than other automation options.
For comparison, SFM is cheaper and easier to work with (lower skill floor), yet its operations don’t have a per-call tick delay. From a gameplay/balance perspective this feels inconsistent: OC requires more investment and expertise, but is penalized with additional latency for basic operations, which doesn’t make much sense.
Your Vision
At the very least, this looks like a balance issue; at best, improving it would unlock additional practical automation methods.
Final Checklist
- I have searched this issue tracker and there is nothing similar already. Posting on a closed issue saying I like this change please reconsider adding it will prompt us to investigate and reopen it once we confirm your report.
- I understand this change request may not attract enough attention and thus not be implemented.
- I understand this change request may be rejected due to other community members think it's inappropriate.
- I believe this feature would make the pack better.