How to build walls like in eg the Sims?

I need to let the user to be able to build walls similar to the system in the Sims. I also want the user to be able to place doors and windows AND be able to modify his/her creations .

Just building walls isn’t that big of a deal as I could just create a mesh for every wall built but what if the user wants to place a window in the wall? And what if the user wants to delete a segment of an existing wall? Do I somehow edit the mesh or should there be prefabs that are inatanced for every wall segment (say 1 meter length of wall) that can then be exchanged to a prefab with a window in it?

And if I go the route with having prefabs for “wall segments” then I end up with a lot of gameobjects in the scene, possibly generating a lot of overhead. I’m afraid that if I go ahead and implement a system that fills my requirements of being editable then I might end up sith something that has way too many gameobjects in a scene and is therefore unusable…

You’re right about generating a lot of overhead if every wall segment is an individual GameObject, I tried this route at first with my game and I didn’t scale up very much before the FPS shot to unbearable slowness. My experience is in 2D where the only thing I’d have to change are textures and not the actual model which is much simpler, but I can give some ideas.

One option I can think of is to treat each wall segment as an individual GameObject, and when one is created it checks if there are walls next to it. If there are, it’ll delete the two GameObjects and create a new single GameObject with a mesh modified to extend the original wall segment to be two wall segments.

The other option, which I think would be a little more complex, would be to treat an entire level as a bunch of giant cubes (chunks) like a Minecraft-style procedural generation made up of cubes. An individual wall segment would be one of these smaller cubes. Each of these small cubes could hold a number of vertices and triangles which you could manipulate to create the object in that smaller cube’s position.