Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X
Images

Update

Update

My good god, its been three months since I posted an update here. Wait. That’s how I stared the last blog post. I’ve not been very good at updating this thing really. I’m sorry. Well, I don’t think you really care that much – plenty of other things going on the internet.

I’m here to say Redacted isn’t dead. It’s still alive, and kicking. It’s just going to be a little different. After BuildR, I’ve been working away at the game and it’s slowly coming along. It’s not going to be a city (not the first version at least). I’m trying to keep it simple for now and get the basic gameplay going. Not much more to say at the moment but when I have some more things worth sharing, I’ll post them.

Images

Procedurally Creating the Interior of a Building

Procedurally Creating the Interior of a Building

Over the last couple of weeks I have been working on generating the inside of buildings. The buildings in the game need to have rooms and interiors. Every building should be filled with possibilities, not just a handful. I’ve been reading many, many, many articles, watching loads of videos and trying to digest as much knowledge on the subject. I came to realise this problem was not much different from dungeon generation in Rogue-like games. Each floor of these buildings is like a level in a dungeon, just going up instead of down. Roguebasin became a very useful resource and will continue to be as this project continues.

First up was to tackle room generation. Watching that Subversion video over and over again, I came to realise they were subdividing spaces and then deleting walls somewhat arbitrary. It created very nice rooms. The common theme I keep seeing in procedural content generation is that simplicity allows for complexity. I settled on a simple Binary Space Partitioning to create the basic rooms. Using the structural pillars of the building to draw a base room unit, I would divide and divide again until it was either too small the divide further, or it randomly decided to stop. The building core would have to be accounted for so I started to four super rooms that surrounded it. These super rooms contained all the room units on the floor that would then be split to create something like the above layout.

Next I would generate all the walls that partition these rooms. Each wall had two points that defined it and these points will come in handy later. I then iterated through the walls and deleted a percentage of them to give some larger, interesting rooms and cleaning up loose walls after.

Next up was calculating the depth of these rooms from the core. The above image displays this, starting at white for the core. It goes red through to violet, nearest to farthest respectively. The depth will be handy for further generation and later on when assigning goals within the game.

I needed to generate corridors next. These will link up most, but not all rooms directly to the core. Initially, I attempted a really simple algorithm. I looped through all the rooms converting one of its free walls into a corridor. I avoided small rooms that I had labeled as cupboards/store rooms and any walls touching the external parts of the building were ignored. I then checked if there were any obvious gaps in the corridors and plugged those. I ended up with the above which was adequate for my purposes until I tested it on some other seeds. It fell short too often so I ditched it.

Instead I used the basic Dijkstra Map process over all the wall points. Starting from the outside walls, each corridor would attempt to work it’s way back to the core choosing the shortest path. This was more than adequate and gave rise to some very interesting floor plans. Finally, I looped through the rooms from the core, adding doors into walls and corridors until every room became accessible. The above is a final layout with geometry created.

There are some further additions I need to look into. I can definitely improvement the corridor design, like backtracking and selecting a different path if it can’t get close to the core. Corridors should prioritise larger rooms. There could be less doors or maybe slightly smarter door placement. For now – this will do!

Images

On Architecture

On Architecture

So when building a city, architecture is a very big question. I’ve always been an admirer of it, ask me when I was 5 what I wanted to do, and the response would have been ‘an Architect’. So when it comes to choosing a style that fits the scope, scale and style of the game, I had to do a bit of research…

One key point to make is that all buildings with have explorable interiors. Every floor, lift, stairwell and room will be generated. This is a departure from most city generators that concentrate on creating exterior content. This is also another reason why all my buildings will be convex rectangles to keep calculations simple and fast. My work so far is the basic creation of a building, there is a lot more to do to the externals to make them more interesting.

            

The city is going to have three styles of architecture; The Chicago School, Le Corbusier and the International Style. These all fit within the simple squared building that will occupy the Redacted world. Their structures are easy to produce procedurally compared to say Postmodern or Art Deco. The sharp angles and lines also increase the sense of order. A large theme in redacted is the nature of reality and what can we trust. The player will view the world reconstructed by his drone pilot program and a lot of information will be redacted for security purposes. I remember the set designers on the Matrix motion picture used a lot of right angles and squares in the Matrix world to reinforce the sense of artificial construction. These styles are also quite cold and functional, adding to the sense that the world is like this and you’re on your own.

 

Images

Building Plot Subdivision

Building Plot Subdivision

In most cities, a plot of land isn’t always occupied by a single building. Large buildings may do this – but a city won’t include many large buildings. So i need to divide some plots and into smaller pieces of land. I looked into many methods to do this and implemented a couple, settling on one in the end. There are three goals it needed to achieve. It must produce decent results that look real enough and produce only rectangles. Again, I kept this simple by avoiding irregular and non convex shapes. It must also do subdivide the plot quickly; in a city of hundreds of buildings, I couldn’t afford this algorithm to take it’s sweet time.

The method of room subdivision in this paper caught my eye. It would be very flexible, ensuring all plots had a road as I could grow the plots only from points where it met a road. It would also produce some nice irregular building shapes (as irregular as rectangles can be). So I set about implementing it to see some results. The hardest part of it was ensuring that the plot grown was a rectangle. This method was geared to creating irregular and concave plots. I realised quite quickly though, that this growing process was very expensive. I stupidly thought I should grow it metre by metre, not thinking that a small 20 by 20 plot would need at least 400 iterations, let alone a 100 by 100 metre plot. I was also never happy with the methods of ensuring it remained a rectangle. I ditched it.

I went back to the drawing board (thinking board?). This is too complex and i need to simplify the problem to get my result. In the end I settled for something far simpler and very quick. I would only divide a plot three times at a maximum and I would basically cut it at a random point through the length in a straight line. It was far simpler and quicker. The algorithm selects a plot big enough to be split and splits it a number of times either horizontally or vertically. I was happy with the results but a key improvement would include ensuring that cuts would not strand plots from roads as we can see in the above example.

Images

L-System based road generation

L-System based road generation

The first thing I started building was a city generator. After studying papers online, watching many videos and how Introversion software went about it, I built up an idea of what was needed and what I would avoid. I’m just one guy and my surname isn’t Delay so I kept it real simple. The road system is set to a grid so there are no curves or even diagonals in the city. Keeps all the maths simple.

There are many systems for producing a road system and many factors you can take into account. I ignored most of them mainly to keep the scope small and to keep complexity down. I settled on an incredibly simple algorithm to generate the road structure. It would essentially draw snake roads changing direction perpendicularly based on a seeded random generator. It would spend a lot of time retracing it’s steps to create city blocks. The outcome was pretty good with such a simple system and resembled something of a city.

Modifications to this included using multiple road iterations instead of just one so the road system flowed from the center. Otherwise there was a tendency to create linear city. I also randomly removed roads and modified others to make them alleys to keep it interesting. One final thing to implement will be to remove dead ends to improve gameplay later on. Dead ends are always frustrating unless you want to build a maze.