August 15, 2012

DBP 2011 to DBP 2012 a year in review.

by Niklas Hansson

So when a title is re-entered into DBP a year later, a sensible question is to ask “What happened ?” or “What went wrong ?”. So what did happen ? Why was it re-entered and what did we do for the last year ? Is it any different now ?

These are all valid Questions and I will try to answer them in this and perhaps coming posts (I don’t know if I can fit all into a single post so we’ll see). But first out what happened and why didn’t we release the project during the fall ? There is a couple of reasons but to understand them you have to understand how we entered DBP last year.

While preliminary work was done on the project from nearly the winter we had one big issue, we had no artist working on the project, leaving us with mostly coder style art (tons of love to my wife for actually putting together the models for me with just a basic 3dsmax course at her back). While what we had allowed us to perform our first focus test at may 18:th (yep less than a month left to deadline this is scary shit) we had big problems especially because to even get the art together for that test we needed help of an external artist.

We learned the hard way that getting a good artist is hard , because they are all hired. In the end an old friend from my Massive days said he would help me out, but only until dream build play as he had prior commitments after that. So he got on board around beginning of may. 1.5 month to deadline.. We opted to get the focus test up and running and done quickly so we could collect feedback and create better maps. So he made a couple of parts and we had a test, we just made a few changes to the code base to support triggers and objects moving along with platforms, and all crashed and went to hell.

We worked it out while Jonas continued working on the new art pieces, as you may imagine we was in quite a hurry. But to make a long story short what we sent into DBP last year represented around 2 months of hard work and a ton of testing, but it was not exactly like everything fell in place and became the game we wanted, it was more of a promise of a game.

So from here and forward the logical route would be to polish the game,extend it and then release it. However we were once again without an artist, at first this didn’t matter that much as there was a lot of things to fix, not all lights cast shadow in the DBP verision for example because we were afraid of running out of memory and had no time to fix it, reflection and ambient light was global for the entire level, model usage and lighting was sub par in a lot of areas. Looking at the trailer now feels kind of sad. However there where good moments like this one.

So we polished the levels fixed our script crash, polished the visual and lighting and made an official trailer and press release and then we hit the brick wall again we had definitely prettied the game up quite a bit. But the pieces we worked with was hard to build with and the focus tests of the game showed to much promise to throw it away with a quick release so we started looking for artists and showing off the game at lan parties. All to get more peoples impressions of it so we could make it better.

After a while I got in contact with a couple of ex students from The Game Assembly which for one reason or another at the moment didn’t work in the industry. It took quite a while to get going however and adding new people to the team. We didn’t start working towards the art that is in the new build until January 2012, and while last time we was happy with any art we can get this time the need for art direction was clear so we spent a lot of time making certain we were working in a coherent direction. After a few months we quickly realized that we wouldn’t be able to finalize the game before DBP this year,having one person almost full time with 10 years of industry experience vs two ex students was quite different in terms of productivity, so we decided to enter it again. At this time around march we still didn’t have any new maps due to not having enough models to build them.

July 3, 2012

Dream Build Play Tech Postmortem

by Niklas Hansson

At the end of a deadline for any project a certain amount of tiredness always arises, but more than that a feeling of disappointment “What that all we did ?”,”Couldn’t we have done more ?”. The bigger the project the more pronounced these feelings raises.

With Project Temporality we want to prove that XNA can be used to create XBLA style lush 3D environments. We hope that the steps along that path that we have trodden will inspire others, and help show the potential of XNA and managed development, you really can do whatever you put your mind to. And we hope that you do agree we reached at least a part of the way to our goal, we have a long way to go still but now it seems possible.

So we want to talk a bit about the techniques we used in PT. To make our visuals distinct and not just standard “sci-fi pretty” we had to make a lot of technical base decisions to reach our goals. One goal of our rendering technology was to try to avoid as much as possible the hardness/harshness that much real-time graphics have in their lighting and edges. This was really important to us as we wanted to have a vibrant but soft look in the game.

One of our base techniques is exponential shadow mapping, thats the reason why our shadows look soft and smooth and neither really sharp or worse pixelated as we are used to in most games. We will upload an example of the XNA shadow mapping sample ported to using exponential shadow maps later on just got to write up some extra explaining text. Exponential shadow mapping (ESM) just like variance shadow mapping builds on the idea that if we could blur the shadow map texture instead of performing blurring in the per pixel look up like in Percentage Closer Filtering(PCF) we can perform a much greater blur effect and those create smoother transitions than we could afford else. It also has a really nice property as long as you don’t update the shadow buffer you won’t need to re-perform the blurring which makes the soft shadows almost free on non updated shadow maps. Also the blurring can be done as a separable blur filter which means it’s well adapted to the strengths of the XBOX360 platform with it’s low ALU performance.

These images are booth from the XNA shadow mapping sample using a 2048×2048 resolution texture, now the sample in itself could benefit from numerous improvements but it still works out well for this comparison as they both suffer from those problems. The one difference I have added is that I allow the ESM shadow to go to black instead of just multiplying with 0.5. On the old solutions the shadow looks low-res and jagged but with ESM it looks smooth, it can be made look even better with some tweaking but this was enough for a sample. For our goal of having a soft smooth world without jaggies using ESM was a no brainer especially since it doesn’t double shadow texture usage like Variance Shadow Mapping does.

Another technique that is a big part of our look is our temporally reprojected multi-resolution screen-space ambient occlusion(SSAO) and bounced light solution. SSAO is really cool and helps a lot with visuals however it is not without it’s share of problems one being that it only picks out creeks and small scale occlusions. This mean that if there is occlusion on a larger scale the algorithm has problems handling it. This is due to the fact that you need a huge amount if samples to to get good coverage.

We solved this by performing SSAO at three different resolutions, we down-sample parts our Gbuffer to these resolutions. This allows us to use much more far reaching SSAO without running into a samples limitation. Because we get a much better cache-coherency on the GPU due to the samples still being close to each other on the texture map. We also get to scale away small ridges etc that doesn’t matter to our large scale occlusion. Then we combine the data from the 3 different resolutions to create our final ambient occlusion term.

However even with this technique it would cost to much to run it on the Xbox360 with a good sample quality, so we also use a temporal re-projection technique that tries to match a pixel on the screen with a pixel on the screen of the last frame and reuse SSAO data from that frame if possible. This allows us to use a huge amount of samples because we can amortize the cost over multiple frames. The way this work is that we save data from the last frame then for each pixel on the screen calculate a world space position. Then reproject it using last frames view and projection matrix to find a pixel on last frame screen. We then verify that it’s the same pixel by comparing the position of them(done using depth due to cost issues) and then select if we are going to use that value or not. In fact what we do is that we use the old value and a new one and rotate the samples every frame this means that even if we had only 4 samples per frame we can get 32 or even 64 sample quality and if we up our sample count we can increase the quality even more.

We hope you agree that the effect of the technique is very visible on the right part as the left one looks very flat, and I also believe you will feel the softness and the range of it as quite different compared to normal SSAO techniques. We definitely feels that this was worth the amount of time we had to spend on tweaking it and working hard to make it possible to get it running on a 360, we should mention that our technique uses both normals and depth for every pixel and could be seen as a simplified model of the Bunnel disc algorithm, it is based upon Practical SSAO but with a lot of tweaks and fixes. And of course multi resolution makes a huge difference.

Another important part of the technique is our per pixel re-lightning scheme. To show this one off i have opted to use the classical crytek spoonza as this is an extra per pixel technique the results obviously won’t be as impressive as with for example cryteks LPV technique but this is just a part of what gives PT that special look and feel. This could be done with just a small change to our SSAO code, but actually making it fit into the pipeline and work properly so it didn’t just made corners brighter was a lot of work.A naive implementation of this is actually worse than no implementation. After we have applied direct light and emissive light we do our ssao pass and while we do calculate ssao for our pixels we also calculate for each pixel how much if the other pixels light would be reflected upon this (under the assumption that the pixels are fixed area discs in 3d space)

The part of this that we are the most happy about isn’t actually the bounced red light from the draperies even though it breaks up that large shadow nicely, but we have other systems to handle that kind of bouncing in PT. It’s the small subtle details how bounced light makes the bottom of the pillars brighter than the top. Small details like the wall above the arches are brighter because light had bounced on them. You can also again see the effect of our large scale ssao on the pillars to the right side. This image is actually from quite early code but due to all the different systems working together in PT we thought using this instead better demonstrated the effect.

The final part of what gives PT it’s look is our global bounced light solution including localized and blurry reflections. Our basic engine is a fully deferred render capable of handling hundreds shadow casting lights in a level (though we learned that artistically that it’s better with a lower number) Projected texture and so on, all feed into a physically based shading model (that will be the topic of a separate post) but we aren’t using that as our primary source of light most light of what you see is bounced light either bounce specular light or bounced diffuse light.

We do this using a Box projected system of environment mapping where the map is projected upon a box shape representing the environment. For each pixel we calculate a reflection vector using that position and the eye vector. But instead of using this for our cube-map lookup we instead fine the intersection point of the box from that position using it’s vector and use that position on the box as our reflection vector. This allows us to get accurate reflection of objects that look natural like the picture below.

For blurry reflection we use a form of mip-map convolution, we basically use a similar method to ATI cube-map gen with angular extents but we use a phong lobe for the weighting of the samples when we down-sample to get a reflection that matches properly to the specular size in the game. And then when doing the texture lookup in the code we use the micro-facet distribution (roughness of the surface, similar to the old gloss term in non physically based shading models) of the pixel to select which mip-map we use. This is imperfect due to the fact that our look up is antitropic so we do some fudging and interpolation at the lower mip-maps to hide the error.


If you watch the image above you should be able to see a radical difference in the clarity of the reflection this is due to different glossiness values on the surface.

Except for this we also used a similar method for bouncing light in the scene, it is a limited method because occlusion can only happen at box boundaries but it still worked out well for us, we use the position and the normal of the object to find out where it intersects the box and then weights that vs a vector that goes from the center of the box to the object to get a final lookup position and use that value as it’s local ambient value for that pixel. To get a nice smooth light distribution we perform 5 light bounces all in a linear HDR space. Which is basically just rebuild the cube-maps but using the old cube-maps as input to the world we could do more bounces but after 5 it’s not possible to see a difference anymore. If there is an interest in this we could probably do an article for this too but it’s a bit more complex than the shadow mapping.

In the images above the left images represents the result of the direct lightning and the rest of the light comes from our bounced light representation, we are quite happy with the results which works well even in large rooms.

We hope you have enjoyed this view of what makes Project Temporality tick visually, there is of course a ton of more stuff but this is the most important systems that we also think the least amount of people are using at the moment. We wish we could have gone into more detail on some parts but then this entry would never have been finished at all.

June 14, 2012

Post DBP Update

by Niklas Hansson

So we have been quiet for a while here. Mostly because we have been hard at work for our dream build play entry for this year. You would have believed that this would have been a walk in the park especially since we had a year since last time. However we have since then changes the basic tech and all the content in the game.

And getting something representative together with all these changes has been tough grueling work. while a lot of things had to fall by the cutting floor due to the tight deadline a lot of things also come together.  The demo contains 6 brand new levels with mostly brand new puzzles.

Lasers and mirrors are for the first time visible outside of our locales, And puzzles build on temporarily fielded objects. We hope that now that we have gotten over this hurdle we will be able to share a lot more with you on the development and what we are doing.

For now I give you our new DBP trailer it is slightly  blurry and choppy due to video compression issues we simply didn’t have time left to experiment with different export options.

May 8, 2012

Build #4-#5

by Niklas Hansson

It was a while since the last update here. Mostly because we have been to busy actually working on the game to make an update. Since we decided to enter Microsofts Dream Build Play competition we got a harsh deadline looming above us. We have been successful in moving to the new content and are producing levels in it. It’s just all the small details that takes time coming together.

However we have some nice news. Our second trailer has pushed above 5000 views which is quite nice.

 

Not as much as we are aiming for in the future of course :) But still nice to see it continue to climb over time. Except for that we are in a big getting things done phase. We hope we will be able to show you more soon,

August 28, 2011

The DBP explanation of our project

by Niklas Hansson

Since it is already public we thought we should re post it here. It might clear up a lot of misconceptions about the game. so here we go

About Project Temporality

Project Temporality (PT) is a game looking at the genre Portal pioneered, an action oriented puzzle game. But with our own unique twist. We have based our entire gameplay around time manipulation and used it in conjunction with traditional platform elements to create a new compelling experience.

The basis of PT is its timeline concept which basically means that you aren’t limited to one existence or one sequence of actions. You have the capability to create new copies of yourself (at any given point in time) and while control is transferred to the new copy the other copies keep doing what they did earlier at that time.

Of course due to time paradoxes if you skip backward beyond the starting point of a timeline and then start another one. It will replace the other timeline. This is combined with traditional button controllable platforms and doors to keep the player from just relaying on the time part.

To keep him on his feet we have also added the concept of time points. Time manipulations are not free. You have a limited amount of points to spend so you will have to look for the most efficient way to solve a puzzle or you will run out of them.

After first playing through our story driven single player mode the player will be able to go online and speed run through the level to compete with his friends.

Since reading journals or listening to messages doesn’t take any time the player could speed run already on his initial mode. But it is easier to use the dedicated speed running mode which does away with all those text popups and allows you to focus on running.

This works out due to the fact that you can also use time points to accelerate yourself, meaning finding the perfect timing or the most efficient puzzle solution allows you to move through the level quicker.

All this goes together with the basic thought that instead of being another nameless protagonist you are yourself. You are the hero. This is evidently visible by the fact that you play as your own Avatar.

August 28, 2011

Our DBP trailer is officially 1337

by Niklas Hansson

All right so some of here are big nerds and we couldn’t help noticing that the original version of our dream build play trailer just made 1337 views, or a leet number of views if you want to think of it that way. You can also notice that if you have a digital clock it is also l337 one minute every day :)

Of course the new trailer has already dwarfed the DBP trailer which is nice because it does look a bit embarrassing with today’s standards.

We will make a couple of new updates soon.