It's all in your head, Part 12
- Chris
- Introversion Staff
- Posts: 1172
- Joined: Sat Nov 25, 2000 7:28 pm
- Location: Cambridge, UK
- Contact:
It's all in your head, Part 12
Subversion has had a tough ride during the latter half of 2008. During that time we shipped Multiwinia and we also did the Chronometer project, so time has been short. Work has still occurred on Subversion, but a lot of it is internal – difficult to demonstrate, and more concerned with the inner workings of the project than externally flashy stuff. So I don’t have a huge amount of cool new stuff to show, but this blog was never about showing the polished finished article – it’s about the development process of an Introversion game.
So, enough excuses, on with the update!
(xvid codec required)
The first half of the video shows the latest version of the Subversion city generator. It now operates in a very different (and much better) way. Once the road network has been finished, a new system takes over – which I’ve called the Geometry Generator. This system is responsible for running all the different procedural generation algorithms in turn as they are required, generating all of the data of the city and pushing it onto the graphics card in realtime before your eyes, starting with a road network and ending at the buildings and skyscrapers.
Some technical details for those interested: This system operates on a hierarchical data structure that represents all the 3d geometry in the world. It searches that data structure, looking for “stub” nodes that haven’t yet been generated. Lets say it finds a node of type “Park” with an outline, and nothing else. It then searches a database of generation rules, looking for anything that can help it generate a park node. Once it finds one it will run that generator and add more detail into the park – such as trees, a lake, a few paths, etc. Those objects then become new child nodes in the hierarchical data structure, and can be generated in more detail later if the rules exist and if you want that much detail. So you could write all the generation rules for Park/Lake/Path/IcecreamVendor/Swings/Slide/Bins etc, going into stupid levels of detail, and the GeometryGenerator would just take care of it for you. You can generate higher levels of detail for objects near the camera, and throw away unnecessary high detail a long way away. This system can be extended easily – if I decide that streets are suddenly vital to Subversion, I can write generators for Street, Road, Pavement etc and add more detail to those previously empty nodes – streetlamps, bins, chairs etc.
One thing I’ve found : you can generate data at an astonishing rate. This system can generate data at a max of around 10,000 polygons per second (its half that in the vid because fraps is very cpu hungry), but it’s not particularly optimised at the moment. In a couple of minutes this system can build a city with over a million polygons. The previous city generator from a year ago couldn’t do anything like this. Firstly I was using openGL display lists, which wouldn’t even be able to render 1M polygons at a decent frame rate, never mind have generation occurring at the same time. I’m now using Vertex Arrays, or Vertex Buffer Objects if your gfx hardware supports it, which are an order of magnitude faster at rendering. Secondly there was no way to update display lists dynamically, but I’ve now figured out a reliable way to update Vertex Arrays with new graphics data every frame, which is why you can now see the city growing in realtime before your eyes – that’s the Geometry Generator, pushing newly generated geometry onto the graphics card in realtime. And thirdly, I’ve made the whole generation system multi-core, freeing it up from the render loop and making good use of my dual-core cpu. All three of those breakthroughs have occurred in the last six months, making this system possible.
The second half of the video shows the work-in-progress generating the insides of buildings. Right now only three bits of detail exist : support columns, elevator shafts (empty), and stairwells. But crucially, and this is where the real magic has happened : the insides of the building now use the same Geometry Generator system as the city and the same data structures, meaning the whole thing has been unified. So instead of generating Parks and Streets and Buildings, we are now generating Floors and Windows and Stairwells, but the underlying system is the same. The transitions still need a lot of work – you would be forgiven for not believing me, but you can click on any building in the city view, and the Geometry Generator will spawn that building’s shell and generate all the data inside the building dynamically. The result is that the buildings all look like they are half-finished construction sites, with just the frameworks and shells of the buildings, and none of the office details. Obviously lots more to do here.
So that’s where things are at the end of 2008. You may be wondering, what happened to the elevators and the buttons and the lua scripts and stuff? Most of that material was moved out of the project while I integrated the Geometry Generator from it’s prototype into the main codebase, and things are still a little bit untidy, but they will be coming back next. I’ve got a clear first playable in my head now, although we are a long way off still, and simulation of the insides of the building is next on the list once I’ve got some basic geometry working. I’d also like to see the transitions from City to Site handled better – ideally I’d like the Site to appear in the city view, inside the buildings you just clicked on, but we’ll see – it may be too much of a render burden, but it would look pretty cool.
So, enough excuses, on with the update!
(xvid codec required)
The first half of the video shows the latest version of the Subversion city generator. It now operates in a very different (and much better) way. Once the road network has been finished, a new system takes over – which I’ve called the Geometry Generator. This system is responsible for running all the different procedural generation algorithms in turn as they are required, generating all of the data of the city and pushing it onto the graphics card in realtime before your eyes, starting with a road network and ending at the buildings and skyscrapers.
Some technical details for those interested: This system operates on a hierarchical data structure that represents all the 3d geometry in the world. It searches that data structure, looking for “stub” nodes that haven’t yet been generated. Lets say it finds a node of type “Park” with an outline, and nothing else. It then searches a database of generation rules, looking for anything that can help it generate a park node. Once it finds one it will run that generator and add more detail into the park – such as trees, a lake, a few paths, etc. Those objects then become new child nodes in the hierarchical data structure, and can be generated in more detail later if the rules exist and if you want that much detail. So you could write all the generation rules for Park/Lake/Path/IcecreamVendor/Swings/Slide/Bins etc, going into stupid levels of detail, and the GeometryGenerator would just take care of it for you. You can generate higher levels of detail for objects near the camera, and throw away unnecessary high detail a long way away. This system can be extended easily – if I decide that streets are suddenly vital to Subversion, I can write generators for Street, Road, Pavement etc and add more detail to those previously empty nodes – streetlamps, bins, chairs etc.
One thing I’ve found : you can generate data at an astonishing rate. This system can generate data at a max of around 10,000 polygons per second (its half that in the vid because fraps is very cpu hungry), but it’s not particularly optimised at the moment. In a couple of minutes this system can build a city with over a million polygons. The previous city generator from a year ago couldn’t do anything like this. Firstly I was using openGL display lists, which wouldn’t even be able to render 1M polygons at a decent frame rate, never mind have generation occurring at the same time. I’m now using Vertex Arrays, or Vertex Buffer Objects if your gfx hardware supports it, which are an order of magnitude faster at rendering. Secondly there was no way to update display lists dynamically, but I’ve now figured out a reliable way to update Vertex Arrays with new graphics data every frame, which is why you can now see the city growing in realtime before your eyes – that’s the Geometry Generator, pushing newly generated geometry onto the graphics card in realtime. And thirdly, I’ve made the whole generation system multi-core, freeing it up from the render loop and making good use of my dual-core cpu. All three of those breakthroughs have occurred in the last six months, making this system possible.
The second half of the video shows the work-in-progress generating the insides of buildings. Right now only three bits of detail exist : support columns, elevator shafts (empty), and stairwells. But crucially, and this is where the real magic has happened : the insides of the building now use the same Geometry Generator system as the city and the same data structures, meaning the whole thing has been unified. So instead of generating Parks and Streets and Buildings, we are now generating Floors and Windows and Stairwells, but the underlying system is the same. The transitions still need a lot of work – you would be forgiven for not believing me, but you can click on any building in the city view, and the Geometry Generator will spawn that building’s shell and generate all the data inside the building dynamically. The result is that the buildings all look like they are half-finished construction sites, with just the frameworks and shells of the buildings, and none of the office details. Obviously lots more to do here.
So that’s where things are at the end of 2008. You may be wondering, what happened to the elevators and the buttons and the lua scripts and stuff? Most of that material was moved out of the project while I integrated the Geometry Generator from it’s prototype into the main codebase, and things are still a little bit untidy, but they will be coming back next. I’ve got a clear first playable in my head now, although we are a long way off still, and simulation of the insides of the building is next on the list once I’ve got some basic geometry working. I’d also like to see the transitions from City to Site handled better – ideally I’d like the Site to appear in the city view, inside the buildings you just clicked on, but we’ll see – it may be too much of a render burden, but it would look pretty cool.
Last edited by Chris on Sat Jan 03, 2009 7:18 pm, edited 2 times in total.
It's rather impressive to say the least, especially how you have it all feed into itself for the generation of, well everything.
One question still remains. What the hell is it?
One question still remains. What the hell is it?
Uplink help: Read the FAQ
Re: It's all in your head, Part 12
What? Was it finished? Scrapped? Are you releasing it soon? What?Chris wrote:we also did the Chronometer project,
Some people talk because they have something to say. Others talk because they have to say something.
- Ace Rimmer
- level5
- Posts: 10803
- Joined: Thu Dec 07, 2006 9:46 pm
- Location: The Multiverse
faemir wrote:Also, what was the chronometer project?
It's another Introversion project about which we know even less than Subversion
Rkiver wrote:One question still remains. What the hell is it?
Since this thread needs more wild speculation, I'm going to say that it is in fact a Metagame. Therefore, and unbeknownst to us, the game was already released and these blog posts are a part of it.
Hence the title "It's all in your head"!
Who is online
Users browsing this forum: No registered users and 17 guests