Best way to procedurally generate city
Hi, I am new to the forum. I don't have much experience with Unity, and I have searched about this extensively on the internet, but I haven't found a solution for this specific case.
My plan is to design a game that has a procedurally generated city. In this way I can randomly vary the building shapes, heights and textures used. I do this externally, since I am more skilled in programming in Python than in c#.
So far, I have written a program in python that generates a list of cubes, it saves their location, scales in every direction and rotations into a .txt file. Then I wrote a script in c sharp that runs at the start of the game. It creates primitives with the cubes' parameters by the use of cube = GameObject.CreatePrimitive(PrimitiveType.Cube)
as it is reading the .txt.
It works perfectly, the only problem is that it doesn't bake the lighting since this runs at runtime.
But now I am interested in adding different textures to each side of the cube (I would like the cube to have windows on the sides and concrete on the top for example), as with the other properties of the cube, all the textures chosen, tiling, etc. will be managed by python and "communicated" to Unity through the .txt . To do this I followed a suggestion I read in the forum, I created a cube made of 6 quads and replaced the code above with: cube = Instantiate(voxel);
. This runs really slow.
But anyway, I am unsure if this is the way to go. I wouldn't like the assets to be loaded at runtime, I would also like to control the texture tiling so that taller buildings have more windows, and sometimes there will be buildings next to each other, so the mesh should be simplified, the cubes should be organized hierarchically, etc. The txt file should be enough to store all the information needed for the primitives, I don't think it really is a "limiting factor", I don't need millions of triangles. What do you think is the best way to proceed?
Your answer

Follow this Question
Related Questions
How to texture meshes with the same texture scale on different mesh sizes? 0 Answers
Mesh collider 0 Answers
2d Sprite creation at 0,0,0 with camera at 0,0,0 but renders wayyy off screen 0 Answers
3D PGC Terrain + Handcrafting Certain Areas? 0 Answers
How to simplify(decimate) mesh of generated terrain? 0 Answers