They don't build houses like they used to. So goes the homeowner's lament, as basements sink, foundations crack and roofs sag. But there is comforting news: Courts and state legislatures are more willing than ever to compensate the home buyer for shoddy workmanship.

"Compared to the old days when the rule was 'buyer beware,' the situation has materially changed," says William North, general counsel of the National Association of Realtors. "We haven't gone to 'seller beware,' but we're getting closer."

Consumer advocates say that isn't close enough, for poor construction abounds. The nation's Better Business bureaus received 4,876 complaints last year about new-home construction. (This year's figures are much lower due to a depressed housing market.) The Federal Trade Commission says that 22 percent of 1,800 households it recently surveyed had new-home problems costing $700 to $2,000 to fix, and that 8 percent had troubles costing more than $2,000.

"The survey shows that there are significant problems with new homes," said Louise Jung, an attorney in charge of the FTC's investigation of new-housing defects. Jung said that although most home builders are competent, "our concern is that when problems do crop up, will builders try to take care of them?"

Until recent years, builders generally didn't have to. Courts ruled that it was up to the buyer to discover defects in the house, without any legal recourse after the closing. These days the courts are more likely to side with the home buyer.

"There are inevitably certain written warranties in sales," says Lester Goldstein, a Miami lawyer. "But courts have now ruled that there are implied warranties that say the home must be usable for its intended purposes. And that doesn't just mean that you can live in it. If it's supposed to have running water, it must have running water."

Goldstein and others cite a 1979 decision by the Illinois Supreme Court as an indication of the modd in many states.

In this case, Raymond and Delores Petersen paid the builders of their Lake Barrington, Ill., home $10,000 in cash and provided them with $9,000 of labor and materials. Before moving in, the Petersens found an array of defects, including a basement floor that was pitched away from the drain, improperly installed siding and a defective front door. They refused to accept the house and sued. The court awarded them $19,000.

In affirming the decision, Illinois' highest court said vast changes "in the method of constructing and marketing new houses" make the buyer beware rule unjust. With houses being mass-produced, the court said the buyer has few opportunities to inspect construction methods. The buyer, it concluded, "has a right to expect that for which he has bargained."

Homebuilders and lawyers think the courts have gone too far. "It may have gotten to the point where they're stifling development" said Theodore Shapero, a Chicago attorney. He noted an Illinois appeals court ruling last August that makes it tough for builders to limit their responsibility for defects, even if the buyer signs a written contract absolving the builder from blame. "That kind of risk takes away the entrepreneurial spirit," Shapero said. "It's bad law."

Whatever its merits, the trend is clear. And the efforts extend beyond the courts. The most important has been the Home Owners Warranty program, or HOW, a 10-year, new-home-buyer protection plan. During the first two years, builders guarantee certain prescribed standards; in the remaining eight years, the home is insured directly by the insurance program.

The homebuilders group estimates that 25 percent of all new homes are covered under the voluntary plan.

New Jersey has gone even further. The state requires builders to provide a warranty either through the state's own program or some other program, such as HOW. "States are going to be looking at New Jersey as what may be coming ahead," said Linda Kelleher, director of consumer affairs for the National Association of Home Builders.

Despite such changes in courts and state laws, most people agree that gains in home-buyer protection are slow going. Housing defects aren't the kind of issue that bands consumers together. Those who buy defective existing homes are especially vulnerable.

Meanwhile, the protection still depends on the location. According to a survey by the builders' trade group, the statute of limitations on defects ranges from about four years from the date of sale in Florida and Tennessee to 10 years in Texas and 20 years in Maryland.

The FTC's Jung notes further that while some courts require homeowners to prove that defects result from poor construction, others just say if there's defect, it should be fixed.

Even warranties, which get credit for protecting consumers against builders who go bankrupt and for establishing a defined set of standards, don't solve a lot of the problems.

"It isn't like regular insurance where you can prove you have some kind of loss and have it adjusted," said Robert Ryken, a Chicago lawyer. "You have to convince somebody there's a defect in the construction."

Some critics, moreover, bristle at the homebuilders' role in the Home Owners Warranty program. They want more private insurers in the market, offering different types of warranties at different rates. When builders themselves set the standards that must be met in a home, they aren't strict enough, says James Birdsall, a construction inspector in Point Pleasant, N.J. "To collect, a house just about has to fall in."