What I'm asking is how many months would it take for around 50,000 people to build an urban medieval settlement that is circular and surrounded by a wall made of brick/stone to protect against magic monsters? First, they'd have plenty of materials because most of everything would be made of mud(bricks) and wood, and maybe some stone and they are nearby to a mountain with a bunch of stone and a large forest. Second, the size of the settlement is approximately 18 square kilometers in area. Each person would be able to collect resources for and build a moderate sized building in about a few days. Also, they cannot work at night because of magic monsters. Food is also plenty.
Let's make some assumptions
- No magic is used to build the town.
- All 50,000 people are men age 18-25.
- The only tools to start with are medieval-era hand tools, which weren't too different from hand tools today.
- The land is au naturale, meaning nothing has been previously done to it.
Next, let's dispel a myth
- The idea that one person during the medieval era could collect the necessary materials and build a structure in a couple of days is, if you'll forgive my bluntness, pure fantasy. To be fair, you didn't define the building. It could be a one square meter outhouse. But I'm assuming you're thinking something bigger. Can't be done.
Mud bricks aren't made from any old mud. You want 20%-50% clay in that mud. You also need sand, straw (or grass, or pine needles), water, sunlight, a mold for the bricks, of course... and five days. (Source) And that's using just one mold to get just one brick. You'd need thousands of molds (probably tens of thousands) and you need to build them before you can make your bricks. It would require weeks just to make the bricks needed to build a single structure of moderate size.
As you read through this you'll hopefully realize that you could bring a lot of this kind of stuff with you, ready to go, if you have animals. But that also has a price. I'll mention animals momentarily.
Timber or lumber?
If we're using lumber (think "planks"), then you're talking about setting up a saw mill. Probably a dozen saw mills. Which means you need a nearby river to power the saw mills. We can assume the blades, files, and tools needed to build the mill came with the 50,000, but just building the mill will take time. It can't be done in a couple of days, especially when all the initial wood products are being shaped by hand.
Of course, you could opt to use the "log home" method and forego lumber, but that's a less efficient use of materials, which is a fancy way of saying you need to cut down more trees. You're going to need a lot of trees. Wait till I mention your wall, which won't initially be brick.
You're cutting down trees and moving mud. You could dedicate some of your 50,000 to that task, but let's assume they brought horses or oxen. Of course, that means you're feeding and caring for the animals. You could just set them to graze, but you're still having to dedicate people to their care and use. Even with animals, it takes time to clear the 18 km^2 and to gather additional resources from the local forest.
Water, sewer, and the problem with uneven ground
50,000 people (and animals...) require food, water, and at least the most basic sanitation. You can't just (e.g.) carry the water or half your 50,000 will be dedicated to supporting the other half. That means canals, ditches, and/or aqueducts. It means more ditches to carry sewer away from the town. It means having to fill in at least some of the uneven land to guarantee that the water and sewer go where they're supposed to, and enough flat(ish) areas to build all those buildings on.
Now, you could have people dedicated to various support issues (I'll mention that in a moment) and more to cutting timber and building the saw mills, and more still to making bricks, but just getting to the point where it makes sense to start really building things means...
You'll notice we haven't actually built anything but a few saw mills...
That's a bit of an exaggeration... but not much. You're not days into this project. You're months into this project, and most of your 50,000 are still sleeping on open ground. At least somebody has thought to plant some crops (irrigation!) and so far you've been lucky that only some of your people have died from monster attacks. Oh, yeah, some of your 50,000 must be dedicated to security (at least at night) until that wall has been built (not counting the people dedicated to animal care, food production, administration, etc.). You could build the wall first. Probably should. But 18 km^2 worth of land means a wall that's more-or-less (assuming your community is a wonderfully perfect circle) a 15 km long wall. Your average pine tree trunk is 1 meter in diameter, so you need 15,000 trees (or an unfathomable number of bricks) to build the wall.
I can't take it anymore
It won't take months to build this walled town. It will take years. The only way to make that go faster is to use far (far!) more people than the town itself will be able to house and to bring an astounding amount of prepared resources (food, lumber, nails... Oh, nails... you're going to need blacksmiths, miners, more animals...).
Here in the U.S., Habitat for Humanity can build an entire modest house (1200 sqft) in one day. BUT! They're using a combination of skilled labor and unskilled help (the unskilled help is expected to invest up to 500 hours...) and the number of involved people is dozens, they have all the resources (trees, rocks, mud, ore...) already converted to their immediate needs (lumber, stone, bricks, nails...) and they've coordinated the delivery of everything they need before the construction day begins. They're using power tools, not hand tools — and lest we forget, doing this in a single day isn't actually normal, even for Habitat for Humanity. It usually takes a team of people a week, if not a month, to complete a home.
So... years. I could be wrong (and would love to be proven wrong!), but at this point that's my story and I'm sticking to it.
But I made some assumptions that I didn't list
I assumed that you want a fully-functioning town that won't need repair the very next week due to shoddy, do-it-as-fast-as-you-can workmanship.
I assumed that the town must be self-supporting.
I assumed that there are no logistics outside the 50,000. In other words, nobody is sending food and materials (like replacement tools... that's a big deal) during the construction phase.
There are a lot of things you could do to get that town built quickly (say, within six months), if you're willing to suffer the consequences. But, since you didn't indicate any of this in your question, I assumed the worst-case requirement of a long-term self-sustaining town.
Under the given circumstances (medieval period with magic monsters that only attack during night) there is no reason to encompass the whole settlement in a wall. More likely they would build a fortified central keep (or for that size of population a few scattered over the area) and return every night to the keep to sleep in safety.
An actual wall all around the town would probably take years after the town is mostly developed (which would also take years). I think you should count in decades until the town is in the state you describe (fully selfsufficient developed town with an complete exterior wall).
A possibility would to start with something akin a roman era fort. With a trained legion it took only a few hours to built up a fortified camp to start with and only a few months to built it into an actual fort (with a wooden wall!!!). From there on the village could grow over time with new sections of walls being built every few months.
I'm going to cite a very strange source in saying that in the Little House books, Pa manages to build a one room claim shanty in one day with only one other person. Granted, they used milled boards, but using my own experience building/ being outdoors.
Assuming that materials are plentiful, you might have a group of 6 people build a reasonable sized cabin in a day if the others could give them the resources required. So if a third of the people gathered resources the second third built and the last guarded that means you'd be able to have 2777 houses built in a day which has everyone with a house by the end of 18 days.
Of course, that's assuming that the 50,000 people are able-bodied reasonably trained men who each want their own house, if there are families the result would be different.
However, one last thing to note is planning. I don't see how logistics or monsters would be a problem, but having 50,000 people coordinate to build a town would be a nightmare. Who's managing everything and how are they going to get everyone to build in a circle. These questions while important for world building can be easily fixed by an intelligent leader or an already existing feature on the land which facilitates such construction.