The logo of Microsoft's XNA platform, a framework for writing games in .NET

Why Beginners Should Start with XNA

Today, I watched an interesting discussion on gamedev.net where someone asked why everyone is recommending beginners to start off with XNA and C# whereas the entire gaming industry is based on C/C++.

I would have expected to read something along the lines of

“We recommend XNA because it’s very easy to learn and you will hit the ground running fast. It teaches beginners the kind of thinking required to lay out the logic of a program and doesn’t discourage them by forcing them to write boring console applications for months until they know the semantics of the language well enough to use a graphics library such as SDL, DirectX or OpenGL. Some people may not even want to enter the industry, so C# and XNA is a fine choice for them. Those that do can switch over to C/C++ after they’re fluent in C# and it will be a mostly easy going, incremental learning process.”

Instead, an ugly mess resulted with people firmly stating that .NET/Mono is the way to go for games, that the gaming industry is using it for prototyping, scripting and development tools and that the only reasons for not adopting C# yet are legacy code bases and unwillingness by developers to learn new stuff or to change proven ways. People began dissecting each other’s posts one by one and, well, if you’ve been on the internet some time, you can probably imagine how it turns out.

Read More

XNA Vector Font Renderer

I’ve been fiddling around with font rendering again this weekend. For my upcoming game, I wanted a cool intro effect like in some movies, where the displayed text is very very slowly expanding. But I couldn’t quite replicate that effect with the XNA SpriteFont class. Even with antialiasing turned on, the borders of the text were flickering. Using very large font sizes resulted in hopelessly oversized .xnb files with only a slight improvement for the unsteady borders.

So my new solution was to write a component that renders vector-based text instead of bitmaps. Extracting the vector data from a font was a bit harder than I had expected because fonts consist mostly of complicated second and third order bezier curves. I managed to break these down into plain straight line segments and am now in the possession of a content pipeline importer that converts .ttf fonts into arrays of line segments. Behold:

Screenshot of vector fonts rendered as outlines in 3D

Read More

CeGui#

If your game needs advanced GUI capabilities, CeGui# might just hit the nail on the head for you. Marketese aside, this is a seriously good GUI library with Buttons, ListBoxes, Scrollbars, ProgressBars, Sliders, ComboBoxes and more.

Screenshot of CEGUI# rendering its GUI into an XNA window

Being a port of the well known CeGui C++ library, it is not bound to a single graphics API but can instead be easily extended to run on a multitude of environments. Out of the box, it already provides extensions to be used with: XNA Framework 1.0, Managed DirectX 1.0, SDL.NET and Tao.OpenGL.

The only real problem for XNA developers might be that it does not yet work on the Xbox 360 due to several restrictions in the functionality of the .NET Compact Framework 2.0 that XNA applications have to build against on the Xbox 360.