March 19, 2012 0

The Sunburn Engine

By in Code

I really enjoy all aspects of game development. From building the tools to designing the story, each aspect of the process plays an important role in the final product. When I used to develop mainly in Flash, game engines were primarily focused on managing assets, levels, and 2d physics. It’s relatively straight-forward in 2d. However, when I made the move to XNA and 3d, that extra axis made games a whole heckuvalot more complex. The first aspect I focused on was developing a lighting/shadows system. As I researched and explored tutorials, demos, and sample code, I realized one major thing: I am no good at math. And I’m not talking 1+1=5. I’m talking about vector math and trig. Not to mention the theories behind lighting, reflections, and even physics.

Phong Shading Equation

While I really wanted to learn the techniques, they continually moved higher and higher above my head. I then started looking at game engines. With a very small budget (leaving Unity out for now), I found that Synapse Gaming’s Sunburn Engine fit all my needs and is actually quite powerful!

Orbitron: Revolution by Firebase Industries

Orbitron: Revolution by Firebase Industries using SunBurn

While their site tells you volumes about the capabilities of the system, I’ll just skim over some important features. First and foremost, each license requires you to display the Sunburn splash screen, so if you aren’t cool with that, this engine is not for you, though most major game engines require something similar anyways. Secondly, the engine works out-of-the-box on Windows, XBox, and Windows Phone 7. It also supports both 3d and 2d games with lighting available for both.

Read the rest of this entry »

Tags: , , , , , ,

February 22, 2012 0

Deferred Rendering Shadow Artifact

By in Code

I am currently in the process of writing a Deferred Rendering engine in XNA, compiled from a bunch of sources online. One source, The Cansin’s deferred rendering engine tutorial, supplied a good algorithm for calculating the shadow factor in generating the light map. Turns out, used in it’s raw form, the calculation generated some strange shadow anomalies.

Artifact produced from shadow mapping

I spent a great deal of time trying to figure out what exactly the issue was. Tried many different modifications of the equation to figure out an improved model, but to no avail. Finally, I realized that it was possible that some of the values were not matching the intended range of 0-1, so I added a clamp to the final value. Lo and behold, the problem is fixed!

Artifact fixed, rendered in full diffuse

Here is the fix, found in the lighting shader files where calculating shadow factor:

shadowFactor = min(1.0f, (lightZ * exp(-(DepthPrecision * 0.5f) *
               (len - DepthBias))));

Hopefully this will help fix any shadow mapping anomalies anyone experiences!

Tags: , , , ,

October 18, 2011 0

Research: It’s Like School but Not

By in Design

I think that one of the hardest parts about game design is coming up with an initial idea. It’s especially hard when you have your own self-imposed limitations (like doing all the design, dev, and art for the game). However, what’s cool about the design process is that it can be iterative if you let it. That initial idea is simply a driving force behind the future game itself and doesn’t have to be all-encompassing. For instance, the idea could be “watching paint dry.” In itself, a totally boring subject, but by creating the core mechanic of that concept, you will find new ideas and emergent gameplay… or not. That’s the beauty of the prototype.

If you do end up choosing an idea, question, or philosophy that reflects something not entirely abstract, it is important to understand and explore any existing knowledge about that topic. We know that watching paint dry is boring, but when it comes to simulating the idea, do we actually know what paint is composed of? What about the process of actually drying? In this exploration you may find new ideas that make the process a bit more interesting and they may lead you directly to the play of the simulation.

In game design I like to use the term “exploration” since it has none of the negative connotations that “research” has. In class, if a teacher ever mentioned the words “you,” “research,” and “paper” in the same sentence, everyone died a bit inside. Interestingly enough, if you interchange the terms, a research paper is more about discovery than it is about timeline.

While Wikipedia isn’t a widely accepted source, it is a perfect entry-point for exploration. Just do a search on your topic, and open all the tabs! Then you can go back and find the sub-topics that are the most awesome and focus on those. Each link provides more information about a topic, which will help you gain a broader understanding of the idea. Subsequent research will deliver the facts and power your train of awesomeness.

This is totally applicable to game design research because the initial idea acts like an entry point. From there, the design is a living thing and constantly requires nurturing and adjustments in order to become the enticing and playable solution. It’s all about how you execute the idea and fuse it into something that is fun. Or serious. Or ridiculous.

October 13, 2011 0

Writing a Converter for the GLEED2D Level Editor

By in Code

Working on a prototype means that if you can cut corners, you totally should. The goal of the prototype is to get a better understanding of your game while creating something that others can experience. For science.

After doing some research online, I had come up with a list of possible matches for what I needed. Problem with this, however, is that good level editors cost money and usually come with a whole game engine. Also, I’m cheap, so there’s that. GLEED2D was really simple and exported to XML. Which was good, except the level format didn’t match the one I’ve been using. Fortunately, the program also comes with a setting that allows you to run an app when a map is saved and pass the file path to the application.

Armed with this feature, I started building a level converter that took in the GLEED2D level path, serialized it into their level format, copied values into my own level object, then serialized into a new XML file. Ridiculous, I know, but waaaay less time than actually coding my own level editor. What ended up taking me the longest was trying to figure out why my converter wasn’t taking the command line parameters (essentially the level path). Turns out I just had to make the app a console app and it worked fine!

*Technical Jargon Below*

Read the rest of this entry »

Tags: , , , ,

October 5, 2011 0

Why Serialization Makes Life Easier

By in Code

Game engines, such as Valve’s Source Engine or Epic’s Unreal Engine, allow game developers to focus less on the mundane common functionality in a game and more on the actual game itself. These engines are multi-faceted and support a great deal of potential game structures. This means that, to some degree, the engine core stays intact while developers put their own art and special code as a layer on top.

Well that sounds boring, what does it mean?

What this means is that a game engine can be developed as a series of features. Features like shadows, particle effects, menu systems, animation, etc etc. These are all small seeming features, but if you have to re-code a particle system for every game you write, shame on you. Because of this, a game can be developed using the underlying level structure and stacked on top of the core game engine.

For example:

A simple level might look like (in xml):

<Level Name="My Level">
    <Entities>
        <Entity>
            <Position>100,50</Position>
        </Entity>
    </Entities>
</Level>

When I would do this in Flash AS3, I would then need to load the file into my game engine, read through each node, and fire off code based on the node and its contents. In object-oriented programming this can be a bit tedious.

Moving into C#, I found the Serialization package which, essentially, takes care of all of this for me. I can program an object in code, say a Car class, and then define multiple instances of Car just by using XML. This is handled either by compile-time content pipeline (built in support for 3d models, xml, images, etc) or by run-time XmlSerialization which can analyze xml-to-object or object-to-xml on the fly.

Thumbs upIn the xml example from above, after deserialization, I might end up with a Level object with a list of Entities inside containing one instance of an Entity class with it’s Position property set to 100,50. All without actually having to write a custom XML analysis system! This means that the programmer can easily create objects on the fly by simply loading and deserializing a document. This is also good because you can build extra tools to help edit and maintain levels to make it easier for level designers to do their good work.

Everybody wins!

Tags: , , , ,

October 4, 2011 0

That Blog Thing

By in Game Development

I’ve replaced my old portfolio site with something that will be a bit easier to keep updated. I think my last update from the old site was two or three years ago, yikes.

As a brief pre-cap, I have recently moved to beautiful Boulder, CO in hopes of pursuing a career in game design and development. My focus has been in Flash and AS3 in the past, but I have heavily moved into using C# as my primary language. As you will soon find out, I <3 C#. I will be posting about my explorations in code, design, art, story-telling, and production (assuming everything goes well or good). I will also post links to interesting game-related stories that I come across on the internets.

That’s all for now! Please feel free to give me feedback as it will help me with my process!

April 20, 2009 0

Epoxy

By in Games

Click to visit Epoxygame.com to download the game (Adobe AIR)

This was the final project of my career at Champlain College. The first semester was all about the design of the game. Josh Camire and I were the two designers of Epoxy and together we worked to produce a prototype. Our project was selected to move forward into production second semester. I acted as the only programmer on the team, helping with odd-jobs of miscellaneous necessities within the project.

Tags: , , , ,

April 15, 2008 0

Classic Snake

By in Games

Classic Snake game. Collect the apples and avoid the walls and your tail! Arrow keys control the movement.

Tags: ,

April 6, 2008 0

Asteroids

By in Games

Attempt to re-create the classic by Atari. Use the space bar to fire and the arrow keys to move and rotate. You can move forward and backwards in this one!

Tags: , ,

March 29, 2008 0

Comin’ Atcha

By in Labs

This is the result of an iterative development process that started with a single line built from sound channel values. Eventually I introduced some trigonometry to get a circular visual, and then later added the blurring effect.

Tags: , ,