From 17cdacbcc75ce4c037fdfaaaa1439362feeeb3c7 Mon Sep 17 00:00:00 2001 From: osmarks Date: Sat, 15 Sep 2018 21:02:12 +0000 Subject: [PATCH 1/2] Why there shall be no autocrafting --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86f7988..d4c6b30 100644 --- a/README.md +++ b/README.md @@ -69,5 +69,15 @@ For help using the client, run `help` or `h`. ## Coming Soon(ish) (maybe) * Audit log on server - see when items were moved. * Overlay glasses/introspection module client. -* Autocrafting (just a port from Dragon's). -* Autosmelting (basically autocrafting). \ No newline at end of file +* Autocrafting (just a port from Dragon's). (actually, no: see below) +* Autosmelting (basically autocrafting). + +## I'm Not Adding Autocrafting +When I was first thinking about autocrafting, it seemed simple enough - recursively go through a tree of patterns. This is because Dragon's crafting algorithm was incredibly naive. For Wyvern, I wanted to avoid manually transcribing recipes from JEI, so I got a recipe dump - a JSON file, containing every recipe available. This resulted in the naive picture no longer working. At all. Some examples which it would not work correctly on: +* Recipes which are their own inputs. +* Any sort of recipe loop, generally. +* Multiple ways to craft a thing. +* Those weird subjective situations, where a user wants to use one of 1000 oak logs and not one of 8 dark oak planks. Most autocrafters will pick the thing requiring the least crafting tasks - often this is not what is wanted. +* Parallelizing crafting across multiple assemblers + +In short, unless someone develops some fancy algorithm to figure out crafting paths (tree/graph pathfinding or something?), I can't really add it. \ No newline at end of file From 0f1707c75862941e97108689a46cc681a085aed8 Mon Sep 17 00:00:00 2001 From: osmarks Date: Sun, 23 Sep 2018 15:12:16 +0000 Subject: [PATCH 2/2] Update 'lib.lua' --- lib.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.lua b/lib.lua index 2017225..34d1062 100644 --- a/lib.lua +++ b/lib.lua @@ -27,6 +27,7 @@ local errors = { -- Converts an error into human-readable format errors.format = function(e) + if type(e) == "string" then return e end if not (e.type and e.type == "error" and e.data and e.error) then return "Provided error is not an error object." end if e.error == errors.INTERNAL then return "Internal error - provided info: " .. textutils.serialise(e.data) .. "."