You can get Voxel Farm now. For more information click here.

Tuesday, July 26, 2011

Screenshots of Building Scopes

As promised here are a few screenshots of building scopes over the terrain.

This is only a bunch of boxes now, eventually buildings will appear there. Also the density may be too high for the type of game I have in mind. So be aware this is work in progress.

The first image includes a previous rendering of the same area so you can get a feeling of the scale of these towns.








34 comments:

  1. Buildings,Buildings,Buildings!!!

    ReplyDelete
  2. This shit is so cool, tho it makes me jealous that I can't even get my Simplex noise code working.

    Keep on the good work <3

    ReplyDelete
  3. That is dumbfoundingly cool. Even as little boxes you get a feel of towns and cities. I can't wait to see how you're going to give them details. Presumably different cultures will have different styles?

    ReplyDelete
  4. I agree that those seem a bit dense, as it becomes more difficult to simply enjoy (extremely beautiful) scenery. There could be several factors that weed some of these out though during generation, if you don't want to reduce the density at city creation.

    Some cities and towns end up dying because people migrate to cities with more resources, some die because of war, and some die because of starvation/thirst/cold/disease/low birth rate/etc. These could be built at broken-down, primitive, or abandoned housing; or it could be represented as a footnote in a history "the town of Kericka fell to starvation in the year 10." where it is simply assumed any housing has been destroyed or decayed.

    Anyways, beautiful work.

    ReplyDelete
  5. It does seem way too dense because the cities are about one city-radius apart. That doesn't seem plausible for what I assume is a fantasy setting.

    ReplyDelete
  6. do you fill all space in the city with houses and roads, or are there also some open fields for vegetation (trees, crops etc.)

    and as always: great job :)

    ReplyDelete
  7. Will there be villages? Like cities but half of the buildings removed. Also, at least what I've experienced, you normally can't see a city from another city.

    ReplyDelete
  8. Yes, it can be thinned out at several stages. A bird's view may not be the best to pick town size and density. I will probably wait until I can really walk around in this world. It will really depend on how far you can see, forests and mountains will occlude nearby towns. Also what the world expects you to do. In a traditional RPG each city will host a bunch of quests, but I'm even sure I'll be doing something like that. A large town may be boring if there is not much to do in it.

    ReplyDelete
  9. It's so dramatic to see the way your system handles buildings right on the cliffside. Very fitting for a fantasy world.

    It make me wonder, though, if you intend to let the presence of buildings alter the landscape. Given how rare flat stretches of land seem to be, it would make sense that some ground would be cleared to build these cities. In a low-tech world, that would probably have a high cost associated with it, much like building the roads.

    Fascinating and impressive work, as always.

    ReplyDelete
  10. @Anonymous: Building will alter the landscape, but only enough to fit in.

    There are two main scenarios: they carve into the ground until the base of the building is flat. This will be the case for most smaller buildings like houses.

    The second scenario is for expensive buildings like castles. They level its base by building up. It could be a monolithic solid base, gigantic columns or archways, or even a hive-like formation made of smaller buildings. This will depend on the culture.

    ReplyDelete
  11. Have you considered rendering the screenshots at higher resolution and scaling them down afterwards to prevent jagged edges? Or some other form of antialiasing. The technology behind your world generator looks awesome, but the screenshot quality brings the result down a notch.

    ReplyDelete
  12. The buildings look pretty huge to me. Most towns and cities have a small number of large buildings (large businesses, guild halls, , churches, government), and a huge number of similarly-sized small buildings (houses).

    It looks like you generate the roads first, followed by squeezing the buildings in around them. My suggestions is placing a couple (1-4) of large buildings in town first, then building roads around them, and then filling in the smaller buildings around the roads, as you do now.

    Some cities may want walls, especially capital cities. Walls can follow a road-like algorithm, where they avoid going up steep elevations. They also contain gates at each road (may be a good starting point), and some towers at each end, and anywhere the wall turns a whole lot, but with a maximum tower density.

    I'm not sure how you plan on giving different areas a different cultural feel, but the angle of roofs is an easy way to give a totally different feel to an area, along with different door shapes (romanesce arch, gothic arch, square, 45* beams).

    ReplyDelete
  13. @Jason: Well there are no buildings there yet, just boxes that will be fed to the architecture system. Any idea you may get about actual buildings from just looking at the scope boxes may be wrong.

    In some cases these boxes will be broken down even more to crate small slum-like houses, in some other cases several boxes will be put together to create larger buildings. Also, the height of the box does not mean anything right now, except for how much dirt the algorithm needs to dig or pile up to level the base.

    On top of that, I'm not even sure if I should have a lot of small houses just for realism. If I created large slums on every city, would you go visit them? Some of that area would be better spent on a nice castle with lots fancy spaces and shinny things to collect.

    My goal is to generate an entertaining experience, not an accurate city simulator. A realistic city density may get in the way of fun. But it is too early to choose either approach.

    I think I will avoid city walls for now. I actually want the architecture to have a lot of openings for two reasons: I want the AI path-finding to be simpler, and I want natural light to hit as many places as possible, since it will likely be the only source of illumination in the radiosity solution.

    About different cultures, this operates in multiple layers. The grammars for buildings will be different, which will produce very different spaces, then the actual components like windows, doors, columns will also be different.

    ReplyDelete
  14. @halka: Thanks for the suggestion. Most of these screenshots are not after the pretty factor anyway, they are just to show the results of an algorithm. But algorithms can be pretty too, I will improve this in the future.

    ReplyDelete
  15. I love this notion of "grammars of buildings." It makes me wonder: what are the most distinctive elements of a grammar of buildings?

    Some candidate elements for individual buildings:

    Size relative to people: small, moderate, grand
    Spread: vertical/small footprint, horizontal/large footprint
    Angles: 90/120/135 degrees, random angles, circular, oval
    Wall materials: clay, logs, planks, stone, brick, metal, plastic
    Wall color: light, dark, mix
    Wall thickness: thin, moderate, heavy, mix
    Roofing materials: leaves, thatching, wood, tar, shingles, metal, plastic
    Roofing color: light, dark, mix
    Roof pitch: flat, moderate, steep, mix
    Ornamentation: plain, moderate, rococo
    Condition: maintained, decayed

    Buildings near each other would also need some group constraints:

    Regularity: nearly identical, roughly similar, wildly different
    Packing: loose, moderate, tight
    Population distribution: even spread, one cluster, several clusters

    I'm sure I missed some important elements. Any thoughts on what other elements would play a large role in determining what buildings in a village/town/city would look like?

    ReplyDelete
  16. @Bart: Right they are lovable. Grammars can be used to describe anything that has structure, a spoken language is one example. They have also been used to describe plants and other forms of living organisms. I will use them not only for buildings, also for weapons and creatures.

    It is easy to mix up the grammar with the "vocabulary". Most of the things you have listed are not actually in the grammar. If you compare this to the English language, the grammar says a sentence most likely has a subject, a verb and a complement. The fact that the subject may be "dog", "chair" or "Susan" is not part of of the grammar.

    It would actually be possible to follow the English grammar with entirely made-up words, which would mean nothing, but still resulting in grammatically correct sentences.

    This architecture system has to sides, the grammar and the "instances", which is like the words. The first three items in your list will be determined by grammar. The rest will come from the instances.

    Maybe this does not make sense now, but soon, very soon...

    ReplyDelete
  17. @MCeperoG, I picked up a degree in Computer Science some 25 years ago through which I became painfully familiar with the formal concept of a "grammar." ;) So I do understand you. (I was also using L-systems to draw dragon curves back in 1984, which was fun.)

    Still, I did use the term "grammar" in a conventionally loose way before, so your response was completely appropriate (and helpful). I'll also add that I've never been more than a merely competent programmer; I'm in awe of what you're accomplishing here.

    I'm looking forward to seeing how this develops!

    ReplyDelete
  18. @Bart: I apologize for being such a grammar nazi

    ReplyDelete
  19. Will there be potential for ruined/abandoned cities and towns? I think too many wouldn't work but a few here and there where a bad settling decision was made or where a fire or some other disaster occurred would be nice.

    ReplyDelete
  20. @Narrow: Yes, it is possible although I have not tried this yet.

    ReplyDelete
  21. Will you be able to put in town squares?

    ReplyDelete
  22. For larger towns I should be able to have a town square, also depending if the culture has them.

    ReplyDelete
  23. Slums might be bad, by being too real, but I don't know what gameplay you want.

    You will probably want to make roads more likely paths as the distance to travel increases either way. It would be really cool to see some actual traffic on the roads in the finished product.

    I fully admit that large walls (like in Oblivion) would be a huge problem for lighting (and realism). Any defensive strucutres (castles, forts) generally have walls, though they may be more integrated into the way that single building is built, instead of dealt with differently.

    Overgrown roads leading to the foundations and rubble of a city might add some real depth to the world.

    Crazy Idea: Since you are going into so much detail with the simulation, could you allow the player to do whatever it is they do, then age the world 100-1000 years, and have a new character do their thing in this world. I know this suggestion is hard since it has to occur partially at generation time, and partially afterwards, and also requires a lot of planning on your side.

    I realize that you probably have a better idea about how you want gameplay to work than I do. I've been assuming that you are building a bethesda-like or bioware-like RPG, or a 4x (explore expand exploit exterminate) game. This makes sense, given that sandbox game is wining the poll.

    ReplyDelete
  24. @Jason: Your crazy idea is actually very good. I have considered creating different time-slices of the world for the player. A bunch or ruins in one slice may become a fancy city for a previous slice.

    The problem with this is the cost of generation. For a single time-slice I will need to devote many hours of computation. Generating the amount of detail I want is not something that can be done in the player's system.

    In a few years from now, maybe.

    ReplyDelete
  25. RE: cost of generation: have you considered on the fly generation (or depth-first generation, anyway)? I don't know how much of the details in one location would be dependent upon details from another location, but it seems that you ought to be able to focus in on one area and build out as the player explores. Or was it just calculating the effects of the player's actions on the alternate time-slices which was computationally intense?

    Amazing work.

    ReplyDelete
  26. @Andy: Imagine you are in the top of a mountain. You will be able to see very far. One pixel in the distance may be partially green because of the ground vegetation, and partially gray because there is a little stone under. All that complexity has to be generated before you hit the mountain top. For the amount of detail I'm creating, real-time won't cut it. I need to generate the entire world before anyone connects. I may have to set up a few machines in a LAN to crunch numbers for a month until the entire world is ready for the first viewer.

    The alternative is to reduce the amount of detail and do real-time generation on the player's machine. This is what Shamus Young is doing in his Project Frontier. If you are clever about simplifying the world, it is possible to achieve a very entertaining experience... but I'm not so clever.

    My approach is not different than a traditional game. If you think of a traditional game, its virtual world also has to be crafted before the game ships. I'm just bypassing the grunt work of artists.

    ReplyDelete
  27. On that topic, how long is it taking to generate at the moment?

    ReplyDelete
  28. Those cities on the top of the mountains seem not-natural, but those in the valleys actually remind me some real towns i have recently seen...

    By the way that's an Amazing work!

    ReplyDelete
  29. @Matthew: I have not generated an entire world yet, but I can estimate how long it would take.

    My worlds are split into cells, each cell is 6m x 6m x 6m. Inside a cell, geometric detail can go down to 2cm x 2cm x 2cm, and the material detail down to 0.1cm x 0.1cm.

    The geometry for each cell has to be generated from volumetric data, then textured using different materials, lighted, simplified and reprojected so details in the high resolution model are preserved in the low resolution model. All this takes an average of one second per cell.

    Now consider an area similar to the first WoW pack: 12km x 12km. That is 2000x2000 cells, which is 4 million cells. A single cell is only 6 meters high, so if there is something like a tree or a building, more cells need be computed in the vertical. If you average this for a typical world, it is around 2 vertical cells on every location. That brings us to 8 million cells.

    Each cell was one second to compute, the resulting time is roughly 90 days. If I use 3 machines, it can be done in 30 days.

    This is with average hardware: 4 GB RAM Intel i5 ~2.8GHz, 512MB ATI 4770.

    ReplyDelete
  30. You could do all the generation work in advance, on your machines, as long as the player can only move backwards in time.

    ReplyDelete
  31. @Jason: That's right, but each time-slice will take me a month. I rather add new zones. If I find some innovative gameplay that justifies time-travel, maybe... but just thinking about that makes my head spin.

    ReplyDelete
  32. Your blog is a real inspiration, in an industry where stagnation seems to be rife. I am also involved in procedurally generating worlds, albeit at a much, much smaller scale than you are (and in 2D), and with a heavier focus on gameplay aspects. Although I envy your ability to focus so heavily on the generation as you do, since it's the best part.

    I'm wondering if you've seen this: http://www.vision.ee.ethz.ch/~pmueller/wiki/CityEngine/PaperBuildings

    ...It may be of interest to you in your quest to construct realisitic cities.

    ReplyDelete
  33. @Handcrafter: Yes, those are the guys who made City Engine. I think their website is www.procedural.com. I'm doing something different for the cities, but the ideas in their research helped me a lot.

    ReplyDelete
  34. Hi!

    This is my first post in your fantastic blog, and I wanted to start saying that I think is mind blowing.

    I also wanted to comment on something you said earlier: "On top of that, I'm not even sure if I should have a lot of small houses just for realism. If I created large slums on every city, would you go visit them? Some of that area would be better spent on a nice castle with lots fancy spaces and shinny things to collect."

    I can only talk about my own experience, but I'm one of those guys that do love exploring every inch of some virtual worlds (Oblivion comes to mind), and I'm sure I'm not alone out there ;). I love raiding castles and big structures, but even small ones can hold some interest. So, unless you're targeting an specific gameplay style that requires only castles and shiny things to collect, I think you should consider exploring as an integral part of whatever you're making, if it suits you.

    Of course, only my two cents :)

    ReplyDelete

There was an error in this gadget