It depends also on the type of houses. It’s not the same a cabin in the woods and a house with a garden.
Yeah give my 5th floor apartment a back yard to garden in and the we’ll talk.
https://en.wikipedia.org/wiki/Community_gardening
Very common in and around the old Soviet style Eastern European blocs. The style of construction was known as “Towers in the Park” and was often paired with rail stops and local commercial centers for the convenience of pedestrians.
Check out Habitat 67 in Montreal - an architectural student solved this in the 60s. Apartments where everybody gets their own rooftop terrace. Given the funding, the original plan was for a 30-story terraced hill of mixed-use and apartments in an A-frame with public green space underneath that mixed the density of apartments with the benefits of single family homes.
Since everybody thought he was crazy, he only got a fraction of the funding for what he ended up building for the 1967 World’s Fair, but those apartments have the longest occupancy time of any building in Canada (some seeing 2 or 3 generations living in them) and a 5-year waiting list on units.
Last year, a 3d model of the original concept was released for Unreal Engine: www.unrealengine.com/en-US/hillside
https://en.wikipedia.org/wiki/Allotment_(gardening)
This is a solved problem.