Boy this was a tough one. I always knew it was coming, tried to postpone it for as long as I could.
In the past I had succeeded creating complex buildings out of L-Systems. While it was fast, it was for a different approach to world generation. It was for static game worlds like Skyrim's. I had the luxury of time.
In a world that generates as the viewer moves, most of the time I had for generation was already taken by the terrain and trees.
Architecture is something you cannot just instance. You want buildings to be different, even if they belong to the same class. I needed the actual grammar programs to run in real time, its polygonal output voxelized and then merged with the rest of the voxel data.
You may think going from polygons to voxels then back to polygons is an awful waste of time. It had been, except for the fact I needed changes made Minecraft-style to also work over buildings. When you are wielding that pickaxe you don't really care if that rock in front is a natural formation or a cathedral wall.
At the end I did manage to make it work. As usual most of the solution went into creating indices to accelerate the actual work.
I had to make compromises. For starters, the voxel resolution in the realtime engine is much coarser than what I had for the pre-computed worlds. This meant a lot of the detail in buildings had to go. This also applied to the following levels of detail. Detail had to be removed in all levels.
I also saw I needed simpler grammars just so the system could keep up in lower-end hardware. I found it common to have thousands of different buildings in a single scene. The solution I found was to pass the LOD parameter to the building grammar at evaluation time. It made it possible, but now the building programmer has to worry about creating different views for the same building.
I am still very happy with the results of something I feared almost impossible. There is room for improvement, and this is a good thing. The hard part is over.
I leave you with some screenshots of a single tower grammar that appears scattered everywhere. Please do not mind the lack of actual cities, or the fact it is the same tower over and over again. This is rather a test for the system. I will be posting some videos later.
Following one man's task of building a virtual world from the comfort of his pajamas. Discusses Procedural Terrain, Vegetation and Architecture generation. Also OpenCL, Voxels and Computer Graphics in general.
Monday, December 3, 2012
Sunday, November 18, 2012
Come see me at Recursion
There is a reboot of the demoscene going on in Montreal. A large event is planned for this weekend (Nov 23, 24 and 25) at Concordia University.
Here is the schedule: http://recursionparty.org/horraire/?lang=en
If you look closely, you'll see I will be doing a seminar Saturday 24, at 3:00 PM. As usual I will talk about procedural things. I will also show the realtime demo from the last videos and screenshots.
Sunday, November 11, 2012
A System of Caves
A true exploration and adventure game-world needs a decent system of caves.
Caves are exiting. You do not know what lies next. It could be that motherload you have been tracking for hours, it could be a band of nasty creatures.
Caves are also beautiful and interesting. I like it when caves surface and create openings in the face of mountains, or when a large portion of ground has collapsed and you can see part of the cave's profile like a giant ant farm.
Over the past few weeks I did many attempts on creating a good cave system. It is a lot more difficult than it seems, especially if you want to generate them in real time.
I tried different solutions until I hit what I thought it was the winning formula. The key wast think of the cave system more like a dungeon in a castle, pretty much like roguelikes do in ASCII. You end up with a system of narrow tunnels that connect in meaningful ways and often lead to large interior spaces. It is then possible to give an interesting rhythm to the system. You can count on the system to reward the explorer with awesome crypts after enough tunnels have been explored.
Another challenge was to create the connections between the caves and the surface. I wanted caves to be fun and beautiful, and actually help you get around the world. For instance they often serve as shortcuts below mountains.
I also had to pay close attention on how the caves played with the rest of the terrain. If you had all the time in the world this would be hardly a problem. To generate this on-the-fly and make sure there are no odd floating bits, it is kind of tricky.
I leave you with a series of screenshots showing some caves I have encountered in my travels. At the end you will find a wireframe video that shows the profile of a cave system. I hope you like them.
Here is the video:
Caves are exiting. You do not know what lies next. It could be that motherload you have been tracking for hours, it could be a band of nasty creatures.
Caves are also beautiful and interesting. I like it when caves surface and create openings in the face of mountains, or when a large portion of ground has collapsed and you can see part of the cave's profile like a giant ant farm.
Over the past few weeks I did many attempts on creating a good cave system. It is a lot more difficult than it seems, especially if you want to generate them in real time.
I tried different solutions until I hit what I thought it was the winning formula. The key wast think of the cave system more like a dungeon in a castle, pretty much like roguelikes do in ASCII. You end up with a system of narrow tunnels that connect in meaningful ways and often lead to large interior spaces. It is then possible to give an interesting rhythm to the system. You can count on the system to reward the explorer with awesome crypts after enough tunnels have been explored.
Another challenge was to create the connections between the caves and the surface. I wanted caves to be fun and beautiful, and actually help you get around the world. For instance they often serve as shortcuts below mountains.
I also had to pay close attention on how the caves played with the rest of the terrain. If you had all the time in the world this would be hardly a problem. To generate this on-the-fly and make sure there are no odd floating bits, it is kind of tricky.
I leave you with a series of screenshots showing some caves I have encountered in my travels. At the end you will find a wireframe video that shows the profile of a cave system. I hope you like them.
Here is the video:
Sunday, November 4, 2012
Into the sandbox
This is a follow up on my earlier post, where I announced a new take on my engine so it could be used for games like Minecraft.
Here is a video of me building a nice house on a hillside. The video is a bit long (38min) even if it plays at double the speed. You may want to get some snacks.
Here is one shot of the house, it is far from finished, but I really like the view out of the bedroom:
Here is the video:
The video shows how anything from the world can be removed. You can also add new blocks, which are all square, pretty much like Minecraft.
But unlike Minecraft, you can use tools to smooth out the blocks creating nice curves and slopes. The idea is to work initially in squares, then smooth it out as needed. Smoothness and slopes comes in a second phase. Otherwise it would be too difficult to place them and control the resulting shapes. I think it is the best approach possible. It combines the simplicity of square blocks with the rich appearance you can find everywhere else in this virtual world.
Something else about the video. Right at the beginning you can see a green progress bar. This is how long it takes to get into the world, no matter if you are starting it from scratch.
This video was taken from a i5 with 4 cores, running a Radeon 4770.
I continued to work on the house after I stopped recording. The save data for the entire world is around 300K.
As usual I look forward to you opinions and questions.
Here is a video of me building a nice house on a hillside. The video is a bit long (38min) even if it plays at double the speed. You may want to get some snacks.
Here is one shot of the house, it is far from finished, but I really like the view out of the bedroom:
Here is the video:
The video shows how anything from the world can be removed. You can also add new blocks, which are all square, pretty much like Minecraft.
But unlike Minecraft, you can use tools to smooth out the blocks creating nice curves and slopes. The idea is to work initially in squares, then smooth it out as needed. Smoothness and slopes comes in a second phase. Otherwise it would be too difficult to place them and control the resulting shapes. I think it is the best approach possible. It combines the simplicity of square blocks with the rich appearance you can find everywhere else in this virtual world.
Something else about the video. Right at the beginning you can see a green progress bar. This is how long it takes to get into the world, no matter if you are starting it from scratch.
This video was taken from a i5 with 4 cores, running a Radeon 4770.
I continued to work on the house after I stopped recording. The save data for the entire world is around 300K.
As usual I look forward to you opinions and questions.
Saturday, November 3, 2012
What if I told you...
Yes, I know I said I would not do it. But it was hard to resist the temptation. After all I had all the required pieces, so why not?
All the videos I have posted recently were captured from this new engine, codenamed "VoxelFarm Realtime". It means all you see here is generated on-the-fly, as the viewer moves. It takes less than 15 seconds to boot an entirely new world, which can be larger than Planet Earth.
You can also carve, dig, and build into everything you see. You are not restricted to square shapes anymore. The blocks you can add are no different that the same blocks you already see in trees, rocks. Organic and all kind of angled surfaces are very much possible.
Now the cat is out of the bag, more on this to come.
Subscribe to:
Posts (Atom)














