August 27, 2015 By: David Tse
This last week I was mostly moving and setting up all my stuff at my new place, but the week before that I made some significant progress on the world generation pipeline. I missed the last weekly because of the moving so I’ll talk about the progress I made the week before. I’ll also be doing the daily updates on twitter again starting today now that I’m done moving and back to full time work on the world generation pipeline.
Picture of my new room/office.
If you remember in the last video I posted the cities were being generated as if they were the size of continents. That was just for testing the generation to get it to an ok point, but now this week was focused on squeezing all that down and getting them to generate at their proper scale.
Screen of terrain tiles all jumbled.
The first thing I had to do to get that working was split the terrain generation into tiled chunks so I could actually render them at the proper scale because opengl generally frowns upon anything over 16k and the world size right now just for testing is 1,000,000 meters by 1,000,000 meters. I will probably scale it up in the future after everything is working, but for now a million feels like a good number.
Same tiles now correctly placed.
Once the terrain was tiled and rendering I had to spend a little time on the debug rendering. Being able to move around the map and zoom all the way down to one city is vitally important when working on the generation algorithms. After all that was finished I shifted to moving all the city road generation code into its own stage and getting it to render at the proper scale.
Road Scale and Interstate Integration
The first step in scaling the roads down was integrating the interstates and the previous stages of the generation pipeline. So just like the rest of the work I’m doing right now I created a temporary, but working, population map. Right now it is just a simple circle around every city. In the future they will be randomized with noise like everything else.
Zoomed in screenshot of city road generation. Green Circles are temporary population, connecting lines are temporary interstates, and yellow lines are the roads.
In addition to exporting the population map I also exported the temporary high level interstates which need integrating with all the city roads. For now the high level interstates are just lines connecting cities. In the future they will wind through the map avoiding mountains, elevation change, and other terrain factors.
Same generated world as previous screenshot, but with view of the whole world instead of really zoomed in.
After that I just had to move over the system to its new stage in the generation pipeline and add a catalyst road at every city. There were some bugs and system issues that came up when changing the scale, but it was designed with this massive scale in mind so it wasn’t too hard. The only issue is generation speed. When we need 10s of millions of road segments generation efficiency starts to become a problem. That’s what I’m going too focused on next, moving the generation to multiple threads and optimizing the gen algorithms.
That’s pretty much what I did the week before last. It was a shorter week because of the move, but now I’m all set up and back at it 100%. So this next week I’m continuing the work on the pipeline integration and I should be moving back into the actual game world testing pretty soon now. Like I said at the beginning of the update I’ll be starting the daily updates again on twitter so be sure to head over and follow me!