PovChem!

Create POV-Ray animations of your Spacechem solutions!

Not quite automatically, though; you're going to have to enter your solution below. And the interface is bad; I'll just prepare you for that now.

(There's a small gallery at the end of this page if you're just here to see what it can do.)

Anyway, To get a nice POV-Ray animation of your Spacechem solution you'll enter it here and the page will run it through the same process it would get in the game... almost. There are a few differences, mostly for simplicity's sake:


To start, you will need the following:

How to use this thing:
  1. In section 1, replicate your solution's waldo programs and the placement of your reactor devices such as bonders, sensors, etc., on the reactor grid. This is, admittedly, the worst of this interface, but perhaps it's best to get that over with quickly.
  2. In section 2, create molecules and assign them to input sequences and output labels. (Technically, a single atom in a single molecule in a single input sequence is all that is needed to successfully create the bare minimum animated scene.)
  3. In section 3, generate and render a preview to make sure you've set everything as you expect, or set simulation and animation parameters and generate the full animated scene for your solution.
And in all cases, if you press a button and nothing or something other than what you expect happens, scroll way back up to the output log for some possibly useful information.

Check the gallery at the end of this page for a walkthrough video.

To reset absolutely everything, reload this page. On Firefox, you may need to do a hard refresh (Ctrl-F5).

An output log of what's been happening. Check back up here if something seems to go wrong:
The background will flash briefly on warnings and errors. Try it now:


Section 1: Place reactor devices and add waldo instructions in this section. Make it look like the solution you're trying to replicate, at least as well as it can on this HTML grid.

Click on a grid number to quickly select that cell.

What the grid currently looks like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80


Add or change something on the grid:
Grid position:
Object type:
Color:
Direction:
Atom (for sensor redirects):
Putting it there or taking it back out?
Clear the grid and start over:


Some notes:

Section 2: Set input molecules and add input and output labels in this section. You must have at least one input molecule, and an input sequence that includes that molecule, or the reaction will not run.

First of all, select whether your reactor has standard outputs ψ and ω or single large output ψ:


Now, use this thing below to draw a molecule. Select atoms with the drop-down menus and indicate bond strength with the checkboxes. Use the white areas only, unless you are drawing a label for large output ψ.



















































Now here's what you can do with that molecule:

 
 
 





Current α input sequence:




 
 
 





Current β input sequence:








Some more notes:

Section 3: And here's where you can get the results of all that.

Generate a preview scene to make sure all your reactor parts are in the right place (this will be a single, static image showing the reactor state before reactions begin):



Your preview .ini file is here:
(Note: the preview .ini file will be the same one every time; you won't need to save a new one for every different preview.)


And your preview scene file (.pov) is here:


Save them both somewhere, open the scene file in POV-Ray, choose a resolution in the top-left, click the "Ini" button along the top, and choose that .ini file you just made. Render it and compare the resulting image with what you expected to get. (Don't forget the include file!)

OR...

Simulate the reaction and generate the real, animated, thing-you-came-here-for scene:





Be sure to check the log output back at the top of the page for any warnings or errors, so that you don't spend several hours rendering a mistake.

And finally, here's your actual .ini file:
(Note: the actual .ini likely will be different each time, so be sure to save each new one.)


... and your actual scene file (.pov):


Save them both somewhere, open the scene file in POV-Ray, click the "Ini" button along the top, and choose that .ini file you just made. Select a resolution from the dropdown in the top-left, below the main toolbar, and then go find something else to do, because once you click "Render," your computer will be a bit busy.

You may want to try the "[Anim (test render) 640x360]" resolution first. This will produce a small and ugly animation of your solution, but it will produce it very quickly. This way you can verify that your solution worked correctly before you invest a lot of time rendering the real thing.

Troubleshooting

My long render failed halfway through
Yeah it might do that, perhaps a few thousand frames in. This appears to be a problem with POV-Ray. But all is not lost! you can resume your render from the point it failed. Here's how:
  1. Go to the directory where POV-Ray put its output images.
  2. Find the last image it produced and note the number at the end of it.
  3. Open your .ini file in your favorite text editor. If you don't have a favorite, you can open it in POV-Ray by clicking the "Ini" button on the toolbar and then clicking the "Edit" button in the "Ini file:" section.
  4. Find the section for the resolution you chose. This will be headed by one of the bracketed lines such as "[Anim 1920x1080]".
  5. Find the line in that section that begins "Subset_Start_Frame=". If you haven't tried this method before, the number after that should be 0.
  6. Change that number to the number you noted above and save the file.
  7. Go to POV-Ray and start the render. It will pick up from that point.
  8. Repeat as (hopefully minimally) necessary.
Of course, if you want to start over later, change that line back to "Subset_Start_Frame=0".

POV-Ray can't find "times.ttf" or Several characters are badly misaligned
You may not have the Times New Roman font (times.ttf) or you may have a different version than I do. Fortunately I have found a different suitable font from a free, reputable source:
  1. Go to Google Fonts and find the font "Noto Serif."
  2. Click "Select this font" at the top-right.
  3. Click the "1 Family Selected" tab that pops up at the bottom of the screen.
  4. Download the font. The download button is at the top-right of the box that expands from that tab.
  5. Unpack that .zip file; read and decide whether to agree to the license terms, as you surely do for all licenses.
  6. Assuming you agreed, copy the file "NotoSerif-Regular.ttf" to somewhere POV-Ray can find it, for instance to the same directory as the include or scene files.
  7. Open the include file (povchem.inc) in your favorite text editor and find the line that reads "#declare use_Noto = 0;"
  8. Change that to "#declare use_Noto = 1;" and save the file.
Your render should now proceed correctly. Or at least it should no longer have that problem.


That's all. Thanks for visiting. I hope this was useful and/or fun.

By Shmoot

Possibly necessary fine print: I and this project have no affiliation with Spacechem, POV-Ray, or anyone who made those. Also I probably should have considered earlier that there might already be something called PovChem that generates POV-Ray scenes of slightly less fake molecular models because of course there is. There's no affiliation with that or its creator either.