My Background
A couple of years ago “Sir you are being hunted” was released, and it brought with it a classic British stiff upper lip, robots that drink tea, and this amazing tech they called procedural generation. Around this same time, computer programming still seemed to me that it was a large complex and insurmountable challenge. In spite of this I set my ambitions high, much higher than my level of skill at the time. Though I never played “Sir you are being hunted” it inspired me, and I set a lofty goal for myself. I was going to build a procedural generation engine that made complicated cities, with interiors, roads, bridges, hills, parks, path finding, physics, and 64x MSAA.
In the years since, my goal has changed a little, in part because I learned what MSAA was, but mostly because I didn’t really understand what I was trying to accomplish. At various times I made it more ambitious, less ambitions, became intimidated and abandoned it, or made great strides forward. During this time I also honed my programming and mathematics skills, helping me tremendously. Recently, I’ve made progress toward accomplishing this goal, and I’m writing because I want to share some of these accomplishments, and what I’ve learning creating them with the rest of this community.
My Recent Accomplishments
The biggest stride forward I made in long time was the creation of this building
The technique that I used to generate this building is called constructive solid geometry. The building was created by making 3D blocks that represent the exterior, interior, and windows of the building. The SCG system then uses some algorithms I developed to split the blocks, and project the textures on their surfaces. It creates a 3D building with an interior, exterior, collides, and navigation meshs. The system is moderately fast, and can generate at least 10 buildings like this per second (on my i5 cpu). The code runs on another thread, so it won’t impact the frame rate for most users. A big advantage of the SCG system is that it can solve any object that can be made out of convex blocks. This room has about 100 blocks, but a room with fewer windows would have much less.
Here is an older example. This version of the SCG system was fatally flawed, because it’s implementation made it impossible to add uv coordinates to the model. It did support LUA script though, for real time code adjustments. Eventually I decided that LUA code was too slow to support this kind of system, and I scrapped the idea. This was mostly because the LUA script constructor in moonsharp took 100 ms to complete, bottle necking the system considerably.
The Future
In the future I will post more about this system, and detailed explanations on the algorithms used.
If the system becomes advanced enough, I may even publish it to the asset store.
Additionally, I would like to know if there is interest in youtube videos covering the subject.
Anyone who is also interested in the technology, leave a response letting me know what you’re interested in most.
-RJ Reynolds