3 ms·
Any chance of JSON recipe manifest? Tangential: does anyone know a good (preferably open) dataset of crafting recipes to use for game mechanics?
by avaer 9y ago
Any chance of JSON recipe manifest?
Tangential: does anyone know a good (preferably open) dataset of crafting recipes to use for game mechanics?
- alexcasalboni 9y agoYou can download these files: - resources: https://littlealchemy.com/resources/base.560.json https://littlealchemy.com/resources/base.560.json - names: https://littlealchemy.com/resources/en/names.560.json https://littlealchemy.com/resources/en/names.560.json Then you can run this Python code to extract/merge into one single file: import json with open('res.json', 'r') as f, open('names.json', 'r') as ff: res = json.load(f) names = json.load(ff) for res_id, res_name in names.iteritems(): print("%s:" % res_name) for id1, id2 in res[str(res_id)].get('parents', []): print("\t %s + %s" % (names[str(id1)], names[str(id2)])) Expected output: glacier: ice + mountain cart: wheel + wood nerd: human + glasses doctor: human + hospital wagon: cart + horse newspaper: paper + paper paper: wood + pressure
- deleted 9y ago[deleted]
- minus7 9y agoI wanted to see it in graph form, so a wrote I did pretty much the same but printed a dot code and piped that into dot. It was a disaster: A huge, unreadable mess. Try yourself if you're feeling adventurous: import json with open('base.560.json') as f: base = json.load(f) with open('names.560.json') as f: names = json.load(f) print('digraph {') for elnum, name in names.items(): print(f'e{elnum} [label="{name}"];') for elnum, body in base.items(): for el1, el2 in body.get('parents', ()): print(f'e{el1} -> e{elnum};') print(f'e{el2} -> e{elnum};') print('}') # python3.6 code.py | dot -Tpng dot.png
- MatthewWilkes 9y agoI once had the idea of generating them on the fly using mechanical them. Unfortunately, the quality of results was so bad I had to abandon it.
- redfast00 9y agoCheck out https://github.com/redfast00/element-alchemy-cheater https://github.com/redfast00/element-alchemy-cheater. I reverse engineered a bunch of these element alchemy games and extracted the recipes.