If you watch Deadwood on HBO, have you ever marveled at how the

colorful dialogue is produced for all the characters?
How is it done? Who can figure out the scenes with multiple, complex characters as well as what they are saying?
Today I learned that the brilliant writer David Milch goes into a room with his staff, lies on the floor with a pillow (because he has a bad back) and starts talking, creating the dialogue for say, Swearengen, then Trixie, then E.B.–and all the words are typed on a keyboard and appear on a big cinema-size display.