Once upon a time there was a mad scientists who wanted to conquer the media.

Yesterday, in fact, there were several of them ("mad" as in in "angry," not "mad" as in "cuckoo") among the 200-odd scientists who attended a three-hour panel discussion on "Science and the Science-Fiction Writer" at the Shoreham sponsored by the American Association for the advancement of Sciene (AAAS.)

After introductory talks by these science-fiction writers, there was a free-form discussion between panel and audience in which ideas flew in all directions like sparks from a destroyed control panel on "Star Trek." One idea that sparking up was the many scientists are unhappy about the way they and their work are portrayed on movies and television.

David Gerrold, the panelist with the most television experience (script editor for two series, author of "When Harlie Was One" and 14 other books), agreed wholeheartedly.

"Television is the only perversion left in American today," Gerrold said in answer to a question from the floor. "It should not be done in polite society; it should not be discussed in polite society; it should not be done among consenting adults. If it is done at all, it should be done alone, in the darkness, and you should wash your hands afterwards."

One of the problems with science fiction on television, he noted, is that "science fiction is a drama of ideas.

Ideas, in and of themselves, do not photograph well." The people who write, produce and direct television programs, he added, "suffer from an impoverished world view; they do not even have an idea of Newton's three laws of motion."

He recalled one science-fiction script submitted to him (and rejected) in which "the story began by telling us that all life on earth was is dire peril because there was about to be an eclipse of the galaxy.

"I do not know how we can change the attitudes of people in the television and film industries . . . I do know that we must see a change, because these attitudes are being passed on to the population."

Ben Bova, editor of Analog magazine, told the scientists that their field gets "a lousy press; a Russian satellite falls on Canada and scientists get clobbered . . . your opponents get Genesis mentioned in biology textbooks, and not one of you have even tried to get Darwin mentioned in the Bible."

In movies, he lamented, "scientists are portrayed as having moral sensitivities no higher than a Hollywood producer's."

Bova found it "sobering" to think "that most Americans never meet a scientist . . . The closest they ever come is a high-school science teacher, and maybe that's why scientists have such a bad image."

When Bova asked how many in the audience had seen "Star Wars," nearly every hand went up, and almost half as many admitted having seen it twice. "Despicable," was his comment, and when a large number indicated that they had also seen "close Encounters," he concluded that "You're a very affluent bunch."

At its best, he said, science fiction "turns people on to science," and he suggested that as a whole the readers of science fiction are much more sympathetic to science than the general population."

One of the scientists in the audience suggested that the AAAS might have a committee that could make it hard for television stations that give a distorted idea of science to get their licenses renewed, but Gerrold suggested that a carrot might work better than a stick. Minority organizations of blacks, chicanos, women and gay people all have committees that the networks consult when a script is related to their interests, he noted, and the AAAS might well do the same for the scientific community. "When people tell a television network, 'This is wrong,' he said, 'they appoint a vice president to listen to you. They don't want anybody to make waves. All they want is to see the money keep rolling in."

The media image of science was only one of the topics that came up in the discussion. Here are some of the othters:

In his opening remarks, novelist Frank Herbert (best-know of his "Dune" trilogy) talked about the self-doubt that is a hallmark both of writters and of scientists, and despite which "we plunge ahead."

To relate properly to their insecurity, he said, writers and scientists must "learn how to move through a landscape that seems insubstantial, that shifts and changes as we move through it."

One problem, he said, is that of language: "The universe does not understand our language; it does not respond appropriately to questions we ask it in our language. I suggest that we cannot blame this on the universe."

For writers, he suggested, some of the most basic words pose problems; the verb "to be" polarizes attitudes and blinds our perceptions to the ways things can simultaneously be and not be. Even the definite article is a stumbling block.

"I don't believe in 'the' future," he insisted, suggesting that in the present we are at work on scenarios for an unlimited number of possible futures.

He suggested the addition of a new symbol to the language: the use of the letter "R" for relativistic situations, in recognition of the existence of mutually contradictory systems. Then, he said, "If someone asks whether you think the Arabs or the Israelis are right, you can answer, 'R'."

In answer to a question on what they thought organized science should undertake as its next major project, Gerrold suggested that a high priority should be building a hotel on the moon. Once there is a tourist trade in outer space, he said, industry will mobilize to cater to it and the development of space will accelerate.

On the present problem of quality in televised science fiction, Gerrold predicted a breakthrough when videodiscs become a commercial reality. At that point, he said, televsion will "fragment into something new."

Network television, he suggested, "is like a theater with 40 million seats. If you have a show that fills only 20 million seats, the show is a failure. But if you can find 1 million people who are willing to pay $5 for an episode of 'Star Trek' on videodisc, that gives you a budget of $5 million for that production. When they were made, each 'Star Trek' episode cost $200000; today, they would cost $400,000 but there is still a lot of margin there. The videodisc will mean the opening up of minority markets in television viewing."

Another encouraging development for fans of science fiction, he said, is the emergence of a new generation in film and television with a better orientation to that genre. He noted that the entire production crews, both for "Star Wars" and for "Close Encounters," were made up of people under 40.

He also suggested that audiences seem to be able "to tell the difference between the competent and the incompetent in science fiction. They show it by watching the good shows and not watching the bad ones."

Among ths scientists in the audience was science-fiction writer Jerry Pournelle, who suggested that with the arrival and consolidation of computers in the home, which will give owners the potential of being hooked into access networks for all kinds of written and video material, the publishing industry itself may be destroyed in 15 years.

"In fact," he added, "I know one scientist who is working on ways to bypass the human eye and ear and give the brain direct acecess to the computer. He expects this to be a reality within about 20 years."

Bova suggested that such developments might mean the end not of publishing but of printing, and it may mean a real boom for writers.

"When you get out of te business of moving tons of paper and simply move electrons around," Bova said, "you may be able to sell books to people for a nickel apiece."

The interchange seemed, somehow, to confirm a remark Bova had made earlier in passing: "You look in the paper every morning, and you see science-fiction stories. They are poorly written for the most part; they don't always turn out right."