the new cookbook

Started by LociOiling

LociOiling Lv 1

The new Foldit website changes how the cookbook works.

The Foldit game client still has a cookbook window which lets you run recipes, but you set up the cookbook on the Foldit website.

The new website lets you import your existing cookbook (the all.macro file) to get started.

The wiki will eventually tell the full story, but for now, I'll try to outline how the cookbook works in the new version of Foldit.

LociOiling Lv 1

When you're logged in to the new website, under Game -> Recipes -> My Cookbook, there's an "Import Cookbook" button.

The button lets you upload a cookbook file from an old Foldit client. The cookbook file is called all.macro, and it's found in c:\Foldit or the equivalent spot on your system.

The "Import Cookbook" button scans your all.macro file, and adds the recipes it finds to your new cookbook. The cookbook contents then show up on the "My Cookbook" page.

Once you've added these recipes, they're automatically downloaded to each Foldit game client you start.

You don't have to import an all.macro file. You can also browse recipes on the new website. Each recipe has an "Add to Cookbook" button on its detail page.

The cookbook import skips several types of recipes. Those will be discussed in a separate post.

LociOiling Lv 1

The "Import Cookbook" button lets you import your cookbook from an all.macro file. Not all recipes are eligible to be imported.

GUI recipes are no longer supported, so the import skips them.

Recipes written using the "V1" Lua interface are also no longer supported, and are skipped.

If you have any unshared recipes, they also won't be imported. For example, if you loaded a recipe from a file, and saved it in the cookbook as "foo", but didn't share it with yourself, your group, or the public, the cookbook importer will skip it. Only recipes which are already on the website can be imported.

At least potentially, if recipe existed on the old system, but was then deleted from the new system, it will be skipped.

If you've changed groups (or left a group), any recipes from your old group are also skipped, unless you're the one who shared them.

There are workarounds for these issues, but they vary in terms of complexity.

The "Import Cookbook" action on the website lists all the recipes it skipped, and the reason they were skipped.

(Edit: recipes deleted from the new system might be skipped. Needs testing.)

LociOiling Lv 1

The cookbook importer won't import GUI recipes.

If you're really attached to a GUI recipe, there is a Python program called MacroScanner that can import GUI recipes and convert them to Lua.

MacroScanner is available on GitHub: https://github.com/LociOiling/MacroScanner

Caution: recent bugs in Foldit have damaged many GUI recipes. Commands like "Restore Recent Best" would be dropped without warning, and actually removed from the GUI recipe.

LociOiling Lv 1

Lua V1 recipes use functions with names like do_global_wiggle_all and do_shake.

Lua V2 recipes have far more functions available. The functions have names like structure.WiggleAll and structure.ShakeSidechainsAll.

Long ago, Foldit master chef rav3n_pl created a Windows program to convert V1 recipes to V2. See https://fold.it/portal/files/FolditLuaConverter.exe on the Foldit website.

I've never used rav3n_pl's converter, but will give it a try soon.

The other approach is to manually convert the recipe.

The first step in either case is to use the current (soon to be old) Foldit client. Open the cookbook, then click on the "Edit recipe" icon next to the recipe you want to work on. Then click on "Save As". You may want to copy the recipe title at this point. Next, click on "Export", and locate a spot where you want to save the recipe. Paste in the recipe name, and add the extension ".lua", so you end with something like "Tvdl enhanced DRW 3.1.1.lua".

The resulting .lua can be used as a starting point for manual edits or rav3n_pl's converter.

LociOiling Lv 1

The cookbook importer may skip some other valid Lua V2 recipes.

Any unshared recipes will be skipped. While the old site is still active, making sure your recipes are at least "shared with self" will prevent this issue.

Any group shared recipes that you have from a former group will also be skipped. While the old site is still active, you can use the recipe editor, and do a "Save As" to give the recipe a new name. You can then "Share", followed by "Share with Me". The recipe is now stored under your name on the Foldit website, and should be migrated to the new system when the time comes.

If you miss the cutoff, you may still be able to start an old Foldit client, perhaps by selecting "play offline". (It's not 100% clear if this will work.) If you can get Foldit running, you should be able to use the recipe editor to do "Save As", then "Export" to save any skipped recipes to files. The recipes saved this way can then be pasted into a new recipe on the new Foldit website.

If all else fails, the source for all your recipes is still in the old cookbook file, all.macro. My GUI recipe converter can also read Lua recipes. It's on GitHub at https://github.com/LociOiling/MacroScanner. There are options "LuaV2" and "LuaV1" for dumping Lua recipes.

(MacroScanner is a command line program, so there are no dialogs, just command line options.)

LociOiling Lv 1

Compared to the old cookbook, the cookbook in the new Foldit client is very streamlined.

The cookbook has a familiar look, and you can click on a recipe to run it. Hovering over a recipe reveals two small icons. The magnifying glass icon takes you to the recipe's web page. The "play" button icon is another way to run the recipe.

Down at the bottom of the cookbook, there are three icons:

  • "refresh" to reload the cookbook from the website
  • "show recipe output" to open the recipe output window
  • "load local recipe" to load and run a recipe from a file

Hovering over the "refresh" button (recycling arrows) incorrectly states "browse/download shared recipes" as the function.

All the other functions have either migrated to the new website or gotten lost in the shuffle.

The recipe editor is gone. Recipes can now be viewed and edited on the website. An external editor is recommended except for very simple recipes.

The "browse/download shared recipes" button is gone. You just have to know that recipes are found on the Foldit website.

The "+" icon for creating new dividers is gone. Dividers can be managed on the Foldit website.

There's also no way to delete an existing divider. The "Import Cookbook" tool left me with a divider called "[empty]", which is indeed empty. It's not clear how to get rid of it.

The ability to cut and paste recipes to move them to a new divider is gone. You can do the same thing on the new website, on a recipe-by-recipe basis.

The ability to change the cookbook font size is gone.

The ability to delete a recipe from the cookbook is gone. You can adjust the contents of your cookbook on the Foldit website.

Since the recipe editor is gone, the ability to create small test recipes on the fly has changed. In the new world, create your test recipe in an external editor, save it, then use the "load local recipe" button to run it. It's a different workflow, but not really a big extra effort.

Bottom line, many cookbook functions have moved to the website. A couple, such as the font size adjustment, no longer exist.

LociOiling Lv 1

Previously, the file all.macro contained all your recipes.

In the new Foldit client, you'll find a "recipes" directory under the main directory, so "c:\Foldit\recipes" or the equivalent.

Every recipe in your cookbook gets downloaded to it's own file in this directory, with an ".ir_macro" extension and the recipe's node number as the name. So you might have "0000046122.ir_macro".

These ir_macro files are familiar Foldit property files, and appear very similar to the old single.macro file that contained just one recipe. The format is also very similar to all.macro, except there's only one recipe per file.

LociOiling Lv 1

In the new system, the cookbook is refreshed from the website each time you start Foldit.

If a recipe in your cookbook has been updated on the Foldit website, you'll get the new version.

This is very different than the old system, which always required work to get the latest version into the cookbook.

In some ways, always having the latest version may be good, but it's easy to imagine there will be exceptions.

There's a suggestion that recipe writers should always create a new recipe when there are significant changes.

On the other hand, if a recipe is crashing, an update which fixes the crash might not need a new name.