You may have noticed quite a few posts over the last month about the city generation tools I’ve been working on. So far it’s been quite an interesting challenge so far andΒ I thought it would be a good idea to track its development in a blog instead of solely on Twitter. So without further ado…
150,000 streets. 120,000 buildings, 30 seconds π Happy with the optimizations today #gamedev #madewithunity pic.twitter.com/nunaXVIgfW
β Danny Goodayle (@DGoodayle) November 30, 2015
November 30th
Began development of building generation system within the city, it currently “builds” out from the side of the road and creates a rectangular shape. If that rectangle overlaps over buildings or streets it simply doesn’t create the building in that zone, if the rectangle doesn’t overlap it creates a mesh. This mesh is just based on the floor plan and extruded out to a random height. I also multi-threaded the code in order to speed up the generation time, you can see it in the video embedded in the tweet with the output in the bottom left. Once it’s finished it outputs the finished mesh data back into the main Unity thread where it’s presented to the user.
December 5th
Began removing the particle rendering hack out of the road rendering. Before this point every single road was created by rendering out particles along their path until it reached the end of the road. Now it creates a mesh along its path, effectively stripping tens of thousands of triangles out of the scene and causing a noticeable performance increase (~10 FPS to ~70 – 90 FPS). Β
#madewithunity #gamedev pic.twitter.com/KwW7TQusTc
β Danny Goodayle (@DGoodayle) December 5, 2015
Having way too much fun tweaking this now. Last one of the night #madewithunity #gamedev pic.twitter.com/1bdfymIFdV
β Danny Goodayle (@DGoodayle) December 6, 2015
December 6th
Finished implementing the road mesh generator, tweaked the visual style to fit more with the vision I’m after. I’ve also fixed up the landscape generator, turns out it was causing quite a large memory leak with one mis-type (.mesh instead of .sharedmesh). Β
December 7th
Plots of land are now a thing in the cities, thanks to the Clipper LibraryΒ I was able to offset (thank you @JasperStockerΒ for pointing out the right word!) the road path into sections of land. These plots are then turned into buildings by dividing up the plot into “parcels of land” and then generating buildings on them depending on their zone type. This effectively removes the previous building generation system and the huge load it took on the generation time as it doesn’t need to check the building plots against each other as we know that the parcels of land are valid ahead of time.
Updated with plots. Thank you everyone for your help today! #madewithunity #gamedev pic.twitter.com/R4qvqBS3Ri
β Danny Goodayle (@DGoodayle) December 7, 2015
35 Second generation time, 25,000 streets, 75,000 buildings (Based on plots of land) and 60 fps. #madewithunity pic.twitter.com/COknBmVvFi
β Danny Goodayle (@DGoodayle) December 8, 2015
December 8th
This is when everything felt like it was coming together, up until this point the cities were limited to being a certain size, mostly due to the complexity of the road meshes and the lack of effective culling. At this point I had been able to add in a very basic culling system to generate and remove off-screen meshes using the quad-tree system I had previously implemented.
December 11th
Further toying with the visuals and implemented a basic LOD system to help with the frame-rate. Beginning to really fall for this styleΒ at this point.
Hey @unity3d, city generation has changed a little bit since that π #madewithunity pic.twitter.com/Z8vo4mFO2W
β Danny Goodayle (@DGoodayle) December 11, 2015
December 15 – 16th
Playing with camera transition styles to help you navigate around the generated city.
More zooming π #gamedev #madewithunity pic.twitter.com/IGyh51U2Cd
β Danny Goodayle (@DGoodayle) December 16, 2015
Enhance… Enhance.. Enhance.. #madewithunity pic.twitter.com/LOcmlG8Euh
β Danny Goodayle (@DGoodayle) December 15, 2015
Last one! Glitch effects and procedural cities π #madewithunity pic.twitter.com/RoOv8wpxVK
β Danny Goodayle (@DGoodayle) December 15, 2015
A quick flyover #screenshotsaturday #madewithunity π Generated purely from code using a single random seed π pic.twitter.com/PbqnsQteEt
β Danny Goodayle (@DGoodayle) December 19, 2015
December 19th
That’s everything so far! This was my last tweet about the project before heading off for the Christmas holidays.
Congratulations!
Have a cat, you’ve made it this far!
β Danny Goodayle (@DGoodayle) December 30, 2015
Recent Comments