One thing we know, based on over a century of data around the world: increasing density of housing has little effect on affordability, in the long run. More often than not, it has the opposite effect. More simply, we do it backwards: we claim--based on in-migration 'projections' that are nearly always overestimates--that there's a shortage and we must build our way out of it. Example: 20 years ago, Portland estimated a million new residents by 2025. Growth in that period: 105,000, in large part due to annexation.
This leaves out the realities of how things get built. Private developers do the work, for profit, most often for investment groups. If it doesn't 'pencil out', nobody will build it. And this is why 'affordable housing' demands, codes, agreements all get bargained down in the end. They have for decades in Portland, despite repeated promises of 'this time, we really mean it'. Developers hold the cards. I could list dozens of projects of thousands of units.
'But government can build/partner!', you say? No, that rarely works either, especially in Portland. 'But this is law and it must be adhered to!', you say? No, that's not true. When it comes to building, everything gets negotiated, and there's nothing that gets bargained harder on than public entities trying to set housing prices.