What is the best way to make a city generator like this:
At first load (like when player first makes game)
Make all cities- houses and people
Houses would be like a class, having location and prefab…
People would be Name, House,Job…
The generator would not make the gameobject in game but would just make the info for later.
Then when player gets within range of the city (within site of some buildings)
The generator would (or another script) make the gameobjects appear (only the ones that he can see/within his sphere radius…)
Then when he leaves the level or quits/saves the generator would save it
What is the bast way to make this
If the cities are going to be big, how would you save it
How would you generate it at first load without crashing the game
…
Please help
Thanks
I think you actually pretty much answered your question. However, you need to have a lot of data available to you. All of your building blocks need to be defined. You must have some logical way to put them together. Information about people and stuff like that. Just housing that data is easy when you get the logic on how it all works. Later on, you use that logic to put the prefabs together and you get a city.
If you are asking if there is logic available and out there for you to use. Probably not in a coherent method. It’s the job of the designer and creator to build that logic.
Saving the data is pretty easy after you have it all together. I would suppose that building a serializable class to build your city would do 90% of it.
And if you build it right… it wont crash. 
Ok Thanks
One of my questions is how to make all the cities on first load like in minecraft not crash
This is one of my ideas- Show loading bar and have a script in a for loop that runs and in each loop makes a house then the same for people
Now if that for loop goes on for a long time (if there are a 1000 cities, about 90% are villages so 20-50 people, and the 10% has a max of 400-1000 people or more) would it crash the game
and is it better to add a Ienumerator that goes and makes a few at a time waits a sec loads more…
Unity will only crash if you make it crash. Program it right, and it wont crash. Using an IEnumerator to cycle through your building process is a great idea. You could also use Threading.
You can do it, you just have to be creative about how you get your information out there. Again, its all in the logic on how you build your city.
So here are a few questions:
Do all of the people need to be active?
What is the overall scope of your simulation?
Is this a MMO based simulation?
Lets look at a game called Grand Theft Auto San Andreas. This is 3 cities based over about 20 square miles of surface and not a single person in it. Using distance and culling it was fairly easy to put that much used space. In GTA4, they reduced the speed at which you could fly so that they could put more detail into the map and thus reduce building lag.
Now, GTA works because it loads assets at runtime. This means there was no procedural content. Having procedural content means less loading, but more building. It’s a trade off.
Ok thanks
My game is a open world rpg
This is how I imagine my system to run
The world would be split into levels to get from one level to the next you can travel down the road and then pick if you want to leave it if yes a loading screen pops up and says 20 days have passed…
Each Level would be split into locations
A location can be a city/forest/town/fort…
The locations can be spilt into sections (if it is a city there would be a lot of sections but smalls villages would not have it)
Every object has a lod system (small objects would not show up from far away but houses would but at a lower detail…)
So at first load the system would generate the world (I am debating if I should make world generate the same everytime, or have it different by time (this city existed in 1355 but not 1368…)
The system would have a built in feature that does all the making of people and houses and everything (in this part should I use Ienumerators to give the game a rest every sec or so)
Like what country-Spain
If Spain(name = one of the spanish names)
…
Then should I save as I go or save all at once after generating it
Then when person loads level every location loads the classes
Then when player gets within range each section starts making the objects
Then use lod, culling…
Then when person saves system uses the same as above…
Sounds ambitious, I sure hope this is not your first attempt at something like this.
Start in small parts. You are looking at the whole, what you need to do is start by figuring out just what your buildings will look like.
How will you put them together?
Build a diagnostic in a 3d app. That is probably the best way to start. Dont get all hung up in code, when you dont have the first part even started. If you insist on using code, use blocks and build your stuff as you need.
You mentioned Minecraft, is it a Minecraft clone? If so, you may want to search the forums here, there are alot of good ideas floating around on how to accomplish it.
It is a 3d realistic(not super realistic) Medieval open world rpg 
I have made almost all the basic-medium stuff (even have a climbing system like Assassin creed (not done stills needs to have the correct animations and timing…))
Right now I am focusing on the code (I have decent placeholders for animation/models…)
The things I am working on now are
World generator
LOD system
Culling
My location/section system…
And also shop system (not the ones where you just go up to a guy and press a button and he just stands there)
(but a shop with supplies/stocks/workers…)
In addition to that and systems like it I would need another script that controls what the people would be doing when the player comes so the shop script does not need to run so like at 5 people wake up (times depending on job, mood, persons behavior…) they eat, go to work, come home… and so much more with that
…
So I have done a lot and still have a lot to do 