Posts Tagged ‘FGF’

Building an Xml Serialization Provider

 
October 13th, 2008 by John Sedlak

While building Galactic Wars 3 version 2.0, I quickly ran into a serious problem with Xml serialization and more specifically deserialization. A few months ago I rolled my own solution for serializing data to and from Xml because the built in classes were bloated and yet not feature rich. A week or two ago I managed to get my class (XmlProvider) to compile for the Zune and Xbox 360. But there was still a problem…

  1. References

    The first problem (the reason for the creation of XmlProvider) was that the built-in classes could not handle references. Every object had to be serialized straight through from top to bottom. Thus if you had an object with two properties that referenced the same object (in memory), the object would be serialized twice.
  2. Inheritance

    The new problem is that with XmlProvider, deserialization was based on the information given by property attributes in your code. This is limiting because you may not know at compile time what exact type of object your property will be holding a reference to. In Galactic Wars 3 this is a problem when I am saving the profile of the user and want to save his specific ship.

So what is the solution? Start from scratch of course and solve these two problems at once! The first one is easy: provide a mechanism with which to uniquely identify any objects in memory and in Xml. We can then build a cache which we can reference from as we find objects with references. The solution to the second problem is also simple: rely on the type name in the Xml rather than the type on the property’s attributes. Read the rest of this entry »

FGF 1.2 Available

 
October 4th, 2008 by John Sedlak

Get it on the FGF page! This should fix the problems from the previous version.

Thrust v1.2

 
October 4th, 2008 by John Sedlak

Before people start reporting problems with Thrust v1.1, let me say that version 1.2 is already on its way. I have caught a few bugs in the InputManager that are demanding a quick release. I will also be including some new GUI functionality.

In the meantime, catch up on the tutorials and samples about using the Focused Games Framework.

FGF Beta, Folder Kill Installers

 
September 30th, 2008 by John Sedlak

I have put up a new version of the Focused Games Framework for download. This release includes Thrust v1.1 and Vodka Alpha files. I have also released X86 and X64 installers for Folder Kill. Below is a more complete list of the changes made.

Thrust

  • Created Content Pipeline Project
  • Terrain Content
  • Cleaned some StateObject & Menu code
  • Added repeat states for GamePad
  • Added Xbox 360 projects
  • Added Camera components
  • Added Console component
  • Diagnostics
    • Added Stats component
    • Added Thumbstick Throttle Component

Vodka

  • Created core Vodka project
  • Added core interfaces
  • Implemented a few providers
  • Added Services project.

Finally, I urge you to keep an eye on FGDN as I continue to add to it over the next couple of months.

Get Colored!

 
September 2nd, 2008 by John Sedlak

Implemented the start of color maps today…

Terrain Seams and HUD Tools

 
August 30th, 2008 by John Sedlak

One of the problems with developing a game for the Xbox 360 is the inability to know exactly what the safe zone is for the TV you are playing on. For that reason, I am including a HUD adjustment tool in the next release of FGF (Thrust). Here it is in action, a simple move of the left joystick will increase or decrease the amount (percentage) of width between the edge of the screen and the HUD. Each axis works independently since some TVs may be worse on one axis.

HUD Adjuster

You may also notice that in the above screenshot, there is a fairly obvious rip in the terrain! We cannot have this in a game, so I have gone ahead and implemented some simple seam fixing. Here is the result:

Seam Fixed

Seam Fixed - Wireframe

More On Vodka: Design

 
August 21st, 2008 by John Sedlak

One of the principals learned from designing my own Content Management Systems over the year was that deploying a CMS with a built in set of functionality is fine, but takes way too much work due to how different common functionality is. For instance, a forum is programmed quite differently from a poll or survey. In the last CMS I developed (FGCMS 2.0), I attempted to crack this problem by utilizing a hierarchial structure which could automatically be loaded from a database. What this mean was that I could extend a base class with new properties and functionality and store the new data in a new table. While this was wonderful from an extendability point of view, it was absolutely horrid from a consumer’s view.

Instead of having to program individual features, I had to program individual pages, static pages. This, of course, isn’t good because with every change to a class definition came a change to every associated page. The upkeep on this is terrible and what ended up happening was that I never got to implementing the pages for much of the backend functionality.

With Vodka, I am taking a step back and attempting to understand the problem from multiple perspectives. On one hand, XML based content is amazing for developing websites because XSL sheets can transform each piece of content into HTML without the need for static pages. On the other hand, having tangible .NET objects is priceless when it comes to code readability. Let’s face it, operating on XmlNode objects is not a fun procedure and is definately not maintainable. Furthermore, from a security stand point, I want to implement item live (and up) security that is customizable to the nth degree. While this may not be possible, it will be possible for most common uses. This desire comes from working with SharePoint, where security is powerful, but hard to use. It is hard because there are only a predefined set of roles for each item and it isn’t easy to understand security in a grander scheme. You can’t grab a look at what rules are overriding others.

vodka1

Here you can see that Vodka employs the very common three tier approach. The separation of data from logic from UI applications is clearcut. The reasons are fairly simple too:

  • Simple to maintain
  • Plug and Play behavior
  • Common backend accross all applications
  • Data format independency

But there is more to this than meets the eye. As shown above, the Business layer contains two sub layers: Simple Objects and Complex Objects. The goal of these is to provide a common ground of functionality with a split view of the data. On one side, the Simple Objects layer provides the Consumer layer with Xml based data. This makes developing websites, RSS feeds, and more incredibly simple. The other side is Complex Objects, which takes what I have learned from FGCMS 2.0 and bumps it up a notch. The core idea with the Complex Objects is that developers will want to and need to use tangible .NET objects with properties and methods. This fills that gap.

So how does this all work? Two words: Provider Model.

For now, let’s consider an implementation without security. The goal then is to represent data somewhere in memory, and be able to translate this data into other forms. Mainly the two forms in Vodka are Xml strings and .NET objects. Because data will be stored as an Xml string with attached metadata, it makes sense that the Simple Objects provider will always be a necessary step. The data provider model, then, takes data from some sort of memory (SQL Server, etc.) and translates it into a .NET object with metadata and an Xml string. A second step takes this object, and translates it into a Complex Object with properties, methods, et cetera.

vodka2

The great thing about the provider model, of course, is that each provider is fully customizable. You are free to use built in providers or develop new ones as new needs/technologies arise. I plan to implement at least an SQL and Xml File Data Provider as well as a simple Xml deserializer / serializer Translation Provider for the first true release of Vodka.

Vodka

 
August 7th, 2008 by John Sedlak

I have started, or rather restarted, a project under the codename of Vodka. This project is the replacement for FGCMS, or Focused Games Content Management System, the backend that has driven my sites for many years (until this site, anyways). The goal of Vodka is to create a simple and extendable CMS that is entirely based on XML and XSL technologies.

It is being written in ASP.NET on the .NET 3.5 platform. I am using Visual Studio 2008 and SQL Server 2008 to write the backend, and plan to employ a lot of slick AJAX/Silverlight controls to provide both the frontend and backend user interfaces. Right now I have been working on a simple content management architecture that takes XML content, transforms it using XSLT and spits out HTML. Check the screenshot below of an early prototype.

Vodka Prototype

Vodka will be built as part of the Focused Games Framework, so look forward to seeing a small portion of it in the next release!

More Progress: Map Formats & Extras

 
July 27th, 2008 by John Sedlak

While working on the map format for the FGF terrain rendering, I decided it would be a good idea to get a few other components out of the way. I have thus created a simple “stats” component which will keep track of random statistics (FPS and Average FPS right now) from the game. I may add to the functionality to include logging and uploads (Bungie-like stats anyone?). I have also added a console component (back from Xna5D, or was it Dx5D?). It is pretty simple right now but allows me to enter some commands to change some of the basic properties in the test program like output color, rendering mode, etc.

Hungry like a...

As for the map format, I am going to keep it extremely simple. You have heightmaps and you place them in the world. The first map format will also contain a simple global lightmap, however I may add the ability to have multiple lightmaps so you can quad tree these as well. I will add to it as the needs for more functionality sky rocket to include things like placeable objects and enemy start locations, et cetera. For now though, a simple format is a good format for both me and you.

Terrain Rendering To Make A Comeback

 
July 4th, 2008 by John Sedlak

Terrain rendering will be back in Thrust (FGF) for the next release. I am working on getting it to production status and add in lighting, quad tree support and more.

Sector 119 - Let thy heaven\'s light may shine upon thee. Sector 119 - Humans are fragile.
Sector 119 - Darkness surrounds you.