Manual for FDM !! Flags: You can use the "-geometry" flag as with other X programs. the "-instring" flag lets you insert keys into the keyboard buffer as soon as fdm starts. The "-root" flag makes fdm use the root window. The "-speed" flag controls speed, and takes an argument from 1 to 1000. Note that "#" does the same thing as the Enter key. __________________________________________________________________ Note: strings in the following document intended to be typed into FDM contain "#" to indicate the {ENTER} key and "=" to indicate the space bar. __________________________________________________________________ !! Get acquainted with FDM Invoke fdm with this command line: fdm -instring 1 You will see four lines, called threads, bouncing around the screen. Use the "+" and "-" keys to adjust their speed. Notice that they bounce off of each other and the border. This border exists on only two edges of the screen. You will see why FDM needs only two lines, rather than four, to contain the threads if you hit the "B" key. The border disappears and the threads wrap around from one edge of the screen to the opposite edge. Hit "B" again and the border returns. Now you should see that when a thread reaches the right edge of the screen, for instance, and finds no border line, it will try to wrap around to the left edge and bounce off of the border there. Any combination of one vertical border and one horizontal border is sufficient to contain the threads, as you will see if you hit the "R" key a few times to "rotate" the border. The threads can move around in many ways. Hit some keys from "1" through "7" and watch what the threads do. You are changing the threads' "types", which are described in the next section. You can combine different types of thread on one screen. Type "MN123#" ("#" means {ENTER} key: see "Note" above). Notice that while you are typing commands, like "MN123#", the threads stop moving. To see some other features of FDM, type "MN332#YERY3#SCED4CEOVY#KG#". (You can get the same effect by using the "instring" command line option, as in: fdm -instring "MN332#YERY3#SCED4CEOVY#KG#" ). Try the space bar and the "P" key as well. To exit FDM, hit Escape. !! The seven thread types There are seven thread types which govern the overall behavior of the threads: 1. a thread that curves to the left and right at random 2. a thread that does not curve, but makes sharp turns 3. a circle 4. a spiral 5. a wave 6. a thread that alternates between going straight and curving 7. a thread whose behavior is controlled by the Change-Sequence feature !! Following the keyboard chart (The following description refers to an older version of the file fdmkeys.unix). FDMKEYS.TXT is a chart of all the keys in FDM. Begin at the left hand side of the big box, following the vertical lines up and down, and the horizontal ones rightward unless they are marked with a leftward arrow, "<". As you go through a function name (like "Change" or "Type" or "{1-7}"), just press the first (capital) letter in its name, or if its name contains fancy brackets, press the key (or one of the keys) in the brackets. When you encounter the function "{select gp}", just go down to the left side of the smaller box and continue. Note that FDM ignores case, so that typing "C2i#T6" does the same as typing "c2i#t6". The left side of the big box, from which you can Make, Change, Rotate border, etc., corresponds to the mode FDM is in when you first start it up and the threads are moving around. Once you have followed a pathway of keystrokes to the right side of the big box, FDM returns to this beginning mode, making the changes you indicated. This mode is the only one in which the threads are moving, so if you see the threads moving you will know where you are in the keyboard chart. If you hit the wrong key, or for some reason forget where you are in the keyboard chart, just keep hitting enter and you will eventually return to this mode. !! Thread numbering and storage Sometimes it helps to know how FDM remembers its threads. Each thread on the screen has its own unique number, and the "n" threads on screen are always numbered from "1" to "n". When there are 4 threads on the screen (numbered, as you now know, from "1" to "4") and you delete the fourth one by typing "[", you have just killed it, but not wiped it from memory. If you then hit "]" to bring thread number four back, it will still have the same attributes it had before. A circle, for instance, will remain a circle, and this can be useful if you want to remove it for a while and have it be the same when it returns. But if you hit "]" several times, you may not know what kinds of threads to expect. What if you want to set some attribute even for these threads you have not yet created? To do this, you must know that when there are "n" threads on screen, threads 1 through n are said to exist, and threads n+1 through 120 (maximum number of threads allowed) are called "nonexistent". The next section explains how to modify existent and nonexistent threads. !! {select gp} (select a group of threads) The section of the keyboard chart set off in the small box at the bottom is used for selecting a group of threads on which you want to perform some operation. When you reach a "{select gp}" in the keyboard chart, the threads will turn gray. Thread number one will be highlighted white. You can move this highlight with the "+" and "-" keys. Hit the space bar to add the highlighted thread to your group. Threads that are in the group turn yellow. You can select threads by type. If you want to add all the circular (type 3) threads to your group, hit "T3". You may want to make a group of, say, all the threads except for number two. Rather than picking all the other threads individually, just put thread 2 in the group and then type "I". This feature, "Invert group", removes from the group all the threads currently in the group and puts the (existent) others in the group instead. Sometimes it is useful to use threads' unique numbers (see the previous section) to make groups, even if you cannot tell by looking at the threads what their numbers are. For instance, if there are four threads visible and you want two of them to chase the other two, you could avoid typing "+" and "-" and "=" by typing "C12#F34#", which is easier than "C==#F++==#" ("=" indicates the space bar: see "Note" above). You cannot select nonexistent threads by number. There are two ways to make all-inclusive groups. "All" makes a group of all the existent threads. "Every" makes a group containing both the existent and nonexistent threads. You will find that if you type "MNRRR#YAL" (Make-New-Random-Random-Random-Yes-All-Little) to create three little threads, and then type "]" to create another thread, this fourth thread will probably not be little. You would have had to type "MNRRR#YEL" to make even the future threads little. On the other hand, if you wanted the three threads you had made to chase each other in a loop (1 chases 2, 2 chases 3, 3 chases 1), then "CAL" (Change-All-Looped follow) would work but "CEL" would not, because "CEL" tells the third thread to chase the fourth, even though the fourth is nonexistent. Please Note: When you make a group of all the existent threads or more, you will be pushed out of "{select gp}" mode. This can happen when all but one of the threads are in the group (yellow) and you hit the space bar. Or it can happen when no threads are in the group and you do "Invert". And, as indicated on the keyboard chart, it can happen when you select "All" or "Every". Please Note: If you hit {ENTER} to "accept group" when no threads are in the group, FDM will NOT make an empty group. It will make a group containing the one thread that was highlighted when you hit {ENTER}. To make an empty group, you must use the "No threads" option. This is not a bug but a feature. It means that, to make a group with only one thread, you just have to highlight it and hit {ENTER}. !! Make This lets you either "Add" more threads or make a "New" set of threads. Either pick your own assortment of thread types or make the choice "Random". To add one circular thread to whatever is already on screen, just type "MA3#". To get one of each kind of thread on the screen, type "MN1234567#". For a random assortment of many threads, type "MNRRRRRRRRRRRRRR#". !! Change-Divisions (type 2 threads) Type 2 threads turn according to how many "Divisions" of 360 degrees you specify. For instance, a thread with its "Divisions" set to 3 will have a triangular look because it turns 360/3=120 degrees each time. A thread with 1 division will turn 360/1=360 degrees, meaning that it will just go in a straight line. Threads with 4 divisions look nice when their "Orientation" is set to "Vertical/horizontal", as you will see if you type "MN22#CAD4CAOVYAS". "Multiple" divisions allows a thread to turn at any angle it chooses, each time it turns. !! Change-Orientation (type 2 threads) For type 2 threads which have 1, 2, or 4 divisions, "Orientation" specifies whether they should be forced to move diagonally (at 45, 135, 225, or 315 degrees), forced to move vertically/horizontally (at 0, 90, 180, or 270 degrees), or allowed to go at any angle they like. For all other threads, the orientation setting has no effect. !! Change-Type and "{1-7}" "Change Type" simply lets you change the thread type of whatever group of threads you select. You can make them "Random" in the same way as with "Make". Pressing "{1-7}" from the left side of the keyboard chart changes the type for every thread. For instance, typing "3" is equivalent to typing "CET3". Either one changes all the threads (even nonexistent ones) to circles. Note that "3" is not equivalent to "CAT3", because "CAT3" only affects existent threads. !! Change-Radius (type 3, 5, 6 threads) This lets you specify how big the curves are for type 3, 5, and 6 threads, and for all "predator" threads. Radius 1 is the smallest and 9 the biggest, but the actual radius of the object in pixels is not directly proportional to the number you type in. As you would expect, the "Random" choice picks the radius at random. !! Change-Sequence (type 7 threads) The type 7 threads turn according to a sequence of turns. Suppose you enter in a sequence by typing "CAS9090#". FDM first adds up the numbers and divides them into 180 degrees: 180/(9 + 0 + 9 + 0)=10. The result is the number of times it uses each number in the sequence. In this case, the thread will turn right 9 degrees 10 times, then 0 degrees 10 times (going in a straight line), then right 9 degrees 10 times, and then 0 degrees 10 times (straight line). The thread has now turned 180 degrees and repeats the process over and over again. You will see a square if you turn the border off (the "B" key) and type "MN7#CAS9090#". Make the square bigger by typing "CAS900900#". It should be obvious by now that the type 7 thread is the most versatile. Type 7 even includes type 3: enter in "CAS1#" and you will see a type 7 thread act like a big circle. Dividing the sum of the turn sizes into 180 degrees always lets FDM make threads with 180 degree rotational symmetry. But what does FDM do with sequences whose sum does not go into 180? It rounds. And this causes each performance of a sequence to bring the thread around by something slightly less or more that 180 degrees, making the thread's shape rotate. For instance, generate a square with "CAS800800#". Notice not only that it rotates, but that it rotates in the opposite direction from the thread made with "CAS700700#". You can also use negative numbers, as in the default sequence FDM starts out with, "CAS6-666-66#". The "-" in these sets of keystrokes only modifies the number following it, meaning that positive (rightward) turns are more convenient to input than negative (leftward) turns. If you want to make a shape, you may save typing by taking the negative of each member of the sequence (i.e. "CAS6-666-66#" is easier than "CAS-66-6-66-6#"). !! Change-Follow You can tell one group of threads to follow another. Just type "C", select a group (predator), type "F", and select a second group (prey). A predator thread will go after a single other thread. The prey, unless it has been assigned a prey of its own, will behave according to its normal attributes, such as thread type and "Radius"; that is, it makes no attempt to "escape" when it is being chased. A predator thread will override its thread type and chase its prey, although you can still control it considerably, for instance by changing any of the Boolean attributes in the "Yes/No/Toggle" section of the keyboard chart. To stop a group of threads from chasing, "Change" them to "Follow" "No threads" by giving them an empty prey group. Typing "CEFN" is the quick way to turn off following entirely. Because each thread can only be assigned to follow one other thread, FDM has to figure out the assignment of prey as follows. The first member of the predator group is told to follow the first member of the prey group. Then the next member of the predator group is told to follow the next member of the prey group, and so on, until the end of the predator group is reached. In choosing a "next member" of the prey group, FDM just picks the next one in order in the group, wrapping around to the start of the group when it reaches the end. For instance, if you type "CEFNC1234#F56#" then thread 1 chases thread 5, 2 chases 6, 3 chases 5, and 4 chases 6. If you type "CEFNC12#F345#" then 1 chases 3 and 2 chases 4, but nothing chases 5 because the predator group was smaller than the prey group. If you type "CEFNC#F#", then thread 1 will chase itself. Typing "CEFE" makes each thread follow itself. !! Change-Looped follow To make thread 1 follow thread 2, 2 follow 3, and 3 follow 1, you do not need to type "C123#F231#". Type "C123#L" and FDM will do it for you. !! Yes/No/Toggle (Boolean attributes) Each thread has six Boolean (on/off) characteristics. Turn one on by typing "Y", selecting a group, and typing the first letter of the attribute's name. "N" turns an attribute off, and "T" switches it. The attributes are: 1. Self bouncing ON: The thread bounces when it hits any part of itself, or when it makes a movement of less than a pixel. To FDM, these conditions are equivalent. This feature looks best with type 1 and 2 threads. OFF: The thread is allowed to go through itself. 2. Realistic bouncing ON: The thread bounces off walls (of the grid or screen border) according to "angle of incidence equals angle of reflection". It also tries to bounce off of threads at 90 degrees, rather than 180, but this does not always work. OFF: The thread bounces off everything at 180 degrees. 3. Kill walls ON: The thread destroys the walls of the grid. OFF: The thread does not. (Note: FDM turns "Kill walls" off for all threads when you turn the Grid off, but you can turn "Kill walls" back on if you want to see a thread make holes in the border.) 4. Little thread ON: The thread is very short. OFF: The thread is long. (Note: FDM clears the screen when you change this attribute.) 5. Tail following ON: The thread follows its prey's tail. OFF: The thread follows its prey's head. (Note: If the thread's prey is itself, FDM forces it to follow its tail.) 6. Vertical/horizontal following ON: The thread chases its prey partially in vertical and horizontal lines. OFF: The thread tries to go straight for its prey. !! Grid Threads bounce off the walls of a grid the way they bounce off the screen border. When you hit "G", you will see a grid. You can change the width and/or height of the "boxes" the grid is made of. Use "W", "H", and "B" to select which dimension(s) to change and "+" and "-" to make the changes. If you have changed width and height separately and want the boxes square again, type "S". You can change the density of a grid with the "[" and "]" keys. The maximum density setting is 100 percent. Bringing the density down to zero with the "[" key and hitting {ENTER} to "accept grid" is equivalent to turning the grid "Off" (see the "Kill walls" attribute above). In the grid-changing mode, you do not need to wait for FDM to finish drawing a grid before you can change the grid; FDM will make grid changes as quickly as you can type them in. This is good to know when you use boxes only a few pixels large. If the grid's density is not 100%, you may want to turn the border off and then clear the screen to make it look better. !! {+, -} (change speed) The "+" and "-" keys change the speed of the thread. !! Miscellaneous functions R: rotates the border. B: turns the border on and off. P: picks a new color palette. A: FDM can pick a new palette every time the screen is cleared. Hit A to toggle this feature. E: The threads can leave trails which they bounce into. Hit E to toggle this feature. FDM clears the screen automatically when threads become trapped in their own trails. {/, *}: these two keys decrease and increase, respectively, the curvature of type 5 threads. {[, ]}: When there are "n" threads on the screen, "[" will make thread "n" nonexistent and "]" will make thread "n+1" existent. !! Suggestions Play around with FDM. When stuck, you can always get out of a function on the keyboard chart by hitting {ENTER} several times. Designing your own type 7 threads with Change-Sequence is especially interesting. Try "MN223#CAR9CAD4CAOV" with erasing mode off and no border. Try many "Little" threads chasing one big one. !! Problems -- Because the algorithm for "Realistic bouncing" is not exact, threads with this attribute on can get stuck in small grids and seem to disappear. -- In the very smallest and densest grid, threads with "Kill walls" on can only kill walls upward and leftward. -- Threads following themselves, or threads in a "Looped follow" group, tend to migrate slowly upwards and leftwards.