Category Archives: Game Development

Upcoming Balder release – 0.8.8.6

Its been crazy weeks since I decided to pull 0.8.8.5, but it was for the better. The result is that the rendering speed and quality has gone up quite dramatically. The next version of Balder will be 0.8.8.6 and will contain at least the following: 

– Optimized framebuffer management

– Optimized drawing/rendering

– Optimized lighting

– Proper polygon clipping against the viewport 

– Completely refactored way of handling objects, no duplication in the type hierarchy for Balder, like in 0.8.8.0.

– New controls : NodesControl, NodesStack – similar as Canvas and StackPanel works with 2D elements in Silverlight

– New geometry types; Box, Cylinder, Plane

– Transparency for objects / materials

– Introducing the concept of View, you can now create custom cameras

– DebugLevel is no longer flag-based, but a self contained object with properties for all Debug options

– Rendering is now synchronously – gives better framerate in most scenarios, but hogs up rendering event. Ongoing process.

 

Its been crazy since december with a lot of work being put into Balder and more to come. I don't have a date yet for when I'll have the release, but I'll try to push it as soon as I'm content with the result. 

 

Upcoming Balder release – 0.8.8.6

Its been crazy weeks since I decided to pull 0.8.8.5, but it was for the better. The result is that the rendering speed and quality has gone up quite dramatically. The next version of Balder will be 0.8.8.6 and will contain at least the following: 

– Optimized framebuffer management

– Optimized drawing/rendering

– Optimized lighting

– Proper polygon clipping against the viewport 

– Completely refactored way of handling objects, no duplication in the type hierarchy for Balder, like in 0.8.8.0.

– New controls : NodesControl, NodesStack – similar as Canvas and StackPanel works with 2D elements in Silverlight

– New geometry types; Box, Cylinder, Plane

– Transparency for objects / materials

– Introducing the concept of View, you can now create custom cameras

– DebugLevel is no longer flag-based, but a self contained object with properties for all Debug options

– Rendering is now synchronously – gives better framerate in most scenarios, but hogs up rendering event. Ongoing process.

 

Its been crazy since december with a lot of work being put into Balder and more to come. I don't have a date yet for when I'll have the release, but I'll try to push it as soon as I'm content with the result. 

 

Balder 0.8.8.5 pulled – why ?

A couple of days ago I published a new version of Balder; 0.8.8.5. It had a bunch of improvements in it, especially when it comes to the Silverlight Control support. I had to pull the release mere hours after its release. The reason for pulling it was that I did a lot of optimizations in the rendering, or at least I thought I did. Turns out that when running on a very fast Dual core or Quad core computer, it was faster – but on slower machines, it turned out to be quite slow. 

Instead of reverting the entire optimization, I've decided to actually get the performance up quite a bit. I've been working on a new rendering pipeline that would increase the performance dramatically, so no time like the present.

The biggest change however with the release was the Xaml support. In the Development branch over at GitHub you will find source code with the rendering pipeline being the same as in version 0.8.8.0, but with all the new Xaml support. So if you can't wait for the optimizations and want to get your Xaml right from the start – you should go pull the latest on the Development branch and compile the binaries yourself. In fact, it should be fairly simple to do it, just download it and run the build.cmd file from a command prompt and it will output a Drop directory with all the binaries in it.

Balder 0.8.8.5 Release is out

UPDATE 8th of July 2010 : 0.8.8.7 is out – read more here.

UPDATE, 16th of December 2009 : Release was pulled due to issues with rendering. New release will be pushed soon.

Its that time again, yet another release of Balder. You’re probably thinking – whats going on? Pushing releases close to every week.

Well, this release had to be pushed out fast, the reason being that a couple of days after the previous release I realized that the Xaml support introduced felt good while using it, but clearly had its limitations and also maintainability issues when working with the library.

In the previous release I introduced the Xaml support as Controls in the Balder.Silverlight assembly, which seemed like a fair place to have it, seeing that Xaml/Controls are a very specific platform option that Silverlight supports and should not be present in Core. Problem with that was that we now had two object hierarchies to maintain, one just reflecting most of the properties already found in Core and doing some crazy magic to maintain these hierarchies. Needless to say, this approach is very error prone and hard to maintain.

Dependency Properties

The main reasons for not pushing the Control support into Core was the fact that I didn’t want DependencyProperties leaking into it all over the place and not wanting types to derive from DependencyObject or any other Silverlight specific type. So what I came up with is to make the types in question partial and implement the Silverlight specifics in a .Silverlight.cs file – which then could be skipped for other platforms. Then for DependencyProperties, I wrapped everything up in a generic Property type that has a Specific Silverlight implementation that again can change for other platforms.

The result is a more maintainable codebase, and a better experience when using it.

Speedups

Another reason for pushing for another release was the fact that I did some heavy optimizations. Earlier when doing optimizations, I worked mostly with Silverlight 2 and Silverlight 3 Beta. For SL2 I created a RawPngBufferStream, since no WriteableBitmap was available there, and for SL3 beta, the WriteableBitmap was quite different than what the final RTW version had going for it. Long story short, I ended up with a multithreading scenario that gave quite a performance boost.

After looking at this for quite some time, I found that it would be better to have multiple WriteableBitmaps and do triplebuffering with these and use different threads for different purposes (Clearing, Rendering, Showing). Turns out that this was quite efficient, only problem was that synchronization turned out to be a bit of a problem. So I did a test with doing all the operations synchronously in the CompositionTargets event, and it gave a serious performance boost. That combined with some optimized ways of clearing surely seemed to do wonders.

The new release is available fromhere.


Speaking at Software 2010 with Petri Wilhelmsen

On the 9th of February, Software 2010 is kicked off. Petri Wilhelmsen and myself will be holding an hour on game development with managed code using Microsoft Xna and Silverlight (featuring Balder). We will be focusing on 3D development and cross-platform using .net.

Really looking forward to doing a co-op with Petri.

For more details and signup, go here

Speaking at Software 2010 with Petri Wilhelmsen

On the 9th of February, Software 2010 is kicked off. Petri Wilhelmsen and myself will be holding an hour on game development with managed code using Microsoft Xna and Silverlight (featuring Balder). We will be focusing on 3D development and cross-platform using .net.

Really looking forward to doing a co-op with Petri.

For more details and signup, go here

Balder Logo + Tutorials

On monday (30th of November 2009) we had a new release of Balder, version 0.8.8.0. Since then I've been busy getting tutorials up on the site for not only the new stuff but also covering usage in general. All the tutorials are available here.  

Also, for the release I decided it was time to get a logo for the project, so opened my favourite 3D modelling software and photo/image editor and had a go, and ended up with the following. 

Balder 0.8.8.0 Release is out

UPDATE 8th of July 2010 : 0.8.8.7 is out – read more here.

Its been a busy month getting all “loose” ends in the Balder project tied up. Hopefully we haven’t left anyone still in here.

For this release we’ve been focusing on bug fixing, cleaning up the APIs and getting better “native” Silverlight support through Xaml. The release and details about it can be foundhere.

Xaml support has been very important for this release, and not only exposing objects and initialization in Xaml, but also being able to manipulate it. The end result is now that you can do a lot of the magic in Xaml without having to touch base with C# at all. For the next release there will be even more focus on this, getting better support for Blend design-time, storyboarding and general editing experience in Blend. But also the support for MVVM style development, so one can get better separation in the code.

We are in the midst of creating tutorials for this new release, as there are major changes and new features that needs some explaining.


Balder gets declarative

We're getting closer to the BETA mark for Balder, and we're starting to get most of the features we want in for version 1 ready. The latest feature is the ability to declaratively through Xaml get Balder up and running. Current release is versioned 0.8.7 and can be found over at the Balder page at Codeplex.

By adding the following namespace declaration in your Xaml file:

[code:c#]xmlns:Core="clr-namespace:Balder.Core;assembly=Balder.Core.Silverlight"[/code]

You now get a set of extra controls that can be used.

First off is the RenderingContainer:

[code:c#]
<balder:RenderingContainer x:Name="_renderingContainer" Width="800" Height="600" BackgroundColor="Black"/> 
[/code]

You need to specify the Width and Height, as that is used to setup the display properly. The BackgroundColor property can be any color, including transparent – which is great if you want to mix with existing Silverlight controls on your page. 

The next control we've added is the Mesh control, it enables you to add any Mesh from a file/resource to the RenderingContainer. You do this by accessing the Nodes property on the Container and putting up a RenderedNodeCollection and put your Mesh(es) within that.

[code:c#]
<balder:RenderingContainer.Nodes>
       <balder:RenderedNodeCollection>
             <balder:Mesh x:Name="_audi" AssetName="audi.ASE"/>
        </balder:RenderedNodeCollection>
</balder:RenderingContainer.Nodes>
[/code]

For now, there is a limited amount of DependencyProperties exposed, so manipulation via Storyboards aren't possible today, but will be very soon. The only way to access this is by hooking up the Updated event on the RenderingContainer and implement codebehind logic for it, something like this:

[code:c#]
private float _angle = 0f;

private void Updated(RenderingContainer renderingContainer)
{
    _audi.Node.World = Matrix.CreateRotationY(_angle);
    _angle += 0.5f;
    _renderingContainer.Camera.Position = new Vector(0,-5,-20);
}
[/code]

Last but not least, to get it all working, you need to initialize Balder. In your App.xaml.cs file, during the Application_Startup event, you need to add one line of code. It is very important for now that you add that line before your page (RootVisual) is created and set.

[code:c#]
  private void Application_Startup(object sender, StartupEventArgs e)
  {
   TargetDevice.Initialize();
   RootVisual = new Page();
  }
[/code]

I you want to use it the "conventional" way – non Xaml based, you need to add a similar line of code, but that line of code needs to be added after the page has been created. This is something that makes absolutely no sense and is something we're trying to fix and make it a lot more sense. Our goal is to get rid of that line of code all together.

A little note, we're not trying to mimick the WPF 3D namespaces at all, we're going our own direction. We don't feel the urge to replicate those, as the purpose of Balder is very different. 

Speaking at NNUG Trondheim, 29th of October 2009

I will be speaking at NNUG Trondheim next week about how one can go about creating games using managed code with focus on Xna and Silverlight. The user group meeting is a cooperation with Javabin. 

If you happen to be in Trondheim on the 29th of October, stop by for a great evening with Anders Nordås talk about patterns and myself for the gaming section.

You can sign up and read more over at NNUG