SPX has been built by taking code from OGUR and refactoring portions of it to be more useful for general game development with the XNA framework. One week ago I loaded OGUR onto my XBox 360 to see how it performed compared to the PC version. That test was intended as a way for me to see if the first of two graphical overhauls looked as good blown up on a big screen as it does on my laptop.

Boy oh boy did I underestimate how important that test turned out to be.

Starting out, I couldn’t even get the console specific project copy to build. Thanks to multiple blog postings I was able to find out that the Xbox runs a different version of the .NET runtime than what runs on the PC. This meant that I first would need to implement some features from .NET 4.0 in .NET 3.5 which OGUR needed to run. Only after I completed this task did I realize that the target runtime could be changed in the Xbox project without adverse effect. DOH!

As soon as the game launched on the console, I knew something was horribly wrong. OGUR had run on the Xbox in its early stages, but I hadn’t taken any time over the past two months or so to test on the console. I didn’t think there would be any major differences between the two platforms, especially since OGUR (and subsequently SPX) are built to dynamically handle both PC and the Xbox.

By leaps and bounds the most dramatic problem was lag. A button on the controller needed to be held down for literally seconds before any movement would occur. Don’t even get me started on the lack of response shown by the HUD for each player. This was a crippling blow to my momentum on the project.

Sitting on my couch, I knew there was no chance of me backing away from OGUR. With the engine nearing completion I couldn’t cut my losses and either build from scratch on another platform or simply pursue a different game altogether. There was certainly a temptation to quit in the back of my mind, but in hindsight my obsessive nature over this project wouldn’t have possibly let me stop.

What could have been a trainwreck for OGUR turned into an amazing bound forward for both the game and SPX. Over the past seven days, I’ve run countless memory and processing performance tests for OGUR both on PC and the console. I’m happy to say that after many hours and an entire weekend spent, OGUR is once again playable in the Xbox. In the process, I’ve added a number of useful helper utilities to SPX which I plan on pushing to the repo once I can grab another spare handful of hours.

 

 

“All work and no play makes Jack a dull boy.”

Truth.

An easy mistake I’ve fallen into time and time again is giving too much energy to a project I love. Without fail, this leads to burnout. OGUR is a very important game to me, so the time spent doing other things is equally important to the amount of time writing  the game’s code.

Now the underlying architecture behind OGUR is nearly finished. All basic functionality is there and time is mostly spent on both cleaning up implemented features to ease their extension, and imagining awesome things to build for the game using my newly polished tools.

In an effort to prevent any burnout on this project, my calendar has a lot more from 9 to 5 than building an awesome video game. Other activities include: watching my soon to be nephew-in-law, cooking, running, playing a new instrument, reading books that have nothing to do with programming. Additionally, I’ve been playing video games…and lots of them.

With all that said, here is what has been implemented in OGUR over the past two weeks:

  • Made a lot of code follow better design principles
  • Implemented a customized path-finding algorithm based on A*
  • Built the different skill classifications (Ranged, Self, and Cloud)
Mind you, that clean up was the majority of the work I’m doing right now. The plan is to have this foundation fully in place come next weekend when I leave for New Jersey. Then, while at the shore, I can focus solely on adding unique content to the game instead of developing a better game engine.
It is very exciting to see this coming together, and I look forward to actually getting some play-test releases out before too much longer!
 

Creating the framework needed to make OGUR is a task that is nearing completion. In the likely event that the initial foundation is ready to go this weekend I am taking some time to step back and refresh my understanding of the best way to design games.

Practically speaking, the past month or so has been an exercise in wearing my software engineering hat. Late nights drawing up diagrams to ensure that the framework for the game makes sense and will scale as I extend it to new heights. Refactoring chunky portions of the code base to ease development later on. So on and so forth.

However, phase two is predominantly about two things:

  1. Make a lot of content for the game
  2. Test all of that functionality to ensure that it is fun and balanced at the same time
This doesn’t take nearly as much forethought as it does feedback. Hours and hours of playing by myself and with friends as new content gets added, and then talking about the gameplay experience. To help this transition, I’m stepping away from C# to spend some quality time with some of my favorite games. Today will be Roller Coaster Tycoon.
Mind you, this isn’t so much a vacation away from developing OGUR, not in the least. This is a concrete way for me to change the way I perceive the project from here on out. Of course there will be times when I need to tweak the game’s underlying framework, but more importantly now is to gauge the fun factor. Engineers are boring people that think “fun” means organizing their stamp collection. Gamers on the other hand…
 

A Kickstarter is up for funding the development of OGUR.

Until the 30 day mark, this is considered a canary release. I’m releasing the project to a very small number of people over the first ten days in an attempt  to get some very tough feedback. Taking that feedback into consideration, I will be re-designing some aspects of the Kickstarter page (including a complete redo of the project’s landing page video).

Now that  most of the Kickstarter’s ground work is finished, last night was a great breakthrough for the skills framework in OGUR. I look forward to the reactions of early alpha testers and coming up with new ways to combine skills.

One of the major features of OGUR is a skill system that provides the ability for skills to react to other skills being used. Effectively, this builds a robust piece of architecture that brings new gaming experiences to all players in different ways.

Firstly, a single player would be able to create a more complex plan of attack. Perhaps a large creature gets poisoned and then another skill is used to blow up the creature. Instead of that poison going to waste, it is instead transformed into a gas by the heat of the explosion and is then inhaled by surrounding monsters.

That is just a quick example of why the skill system brings an exciting level of depth to OGUR. Obviously this means multiplayer will have new ways for groups of people to work together towards dominating a floor of enemies.

 

A little over a week is a looong time in terms of feature development on a single game. Within that time period I traveled to Virginia to visit my wonderful better half, brought my sister to visit me for this week, and worked full time at my day job.

Did I forget to mention the twenty tasks completed in the Wedoist backlog? There were many minor changes as well as completely new features. These included:

  • A completely functional inventory and equipment system with items that influence every creature in the game
  • A major tweak of the HUD to improve usability
  • Made creatures have the ability to progress through levels of advancement in character
  • Building a framework for creatures to have a class that influences growth over time
  • Twelve major bug fixes
  • Moving into a testing stage with multiple players participating locally at one time.

The flight from Virginia back to home in Albany was an hour long, just enough time to crush the final two known bugs in the game.

With every distraction removed from the backlog, its time to move into the final leg of constructing the first version of the game for play testing. Only three major features remain for the game, and they are the most exciting for me to work on…so I’m glad they’ve been reserved until last.

Time will be harder to grab while my sister is in the area, but next week should be the perfect opportunity for me to nab up some free time and put the final pieces into place.

A major thought that I keep reconsidering throughout development is the idea of porting this game to multiple platforms after completion. A lot of work has been done to cram a huge amount of dynamic game play into a minimal control set that maximizes a user’s overall experience with the game. This should translate well should I decide to port the game to, say, mobile platforms.

There might be an entire post devoted to examples of how I approached this problem, and what system I’m using to keep game play exciting in multiplayer while providing flexibility for each player regardless of the actions being performed by any respective person.

 

Over this weekend there was a sensei in my presence. Even more interesting was that he watched from the shadows without my knowledge. A full night into developing a major component of Project OGUR and he sprang to begin a battle that I didn’t want to fight.

A challenge was being held. SimplePathXna never had support for text display, but it was always planned as an addition to the (soon to be) library. Project OGUR finally reached the point of development where I needed to show some fonts, so I did what I’ve done with everything else thus far. And that was my fatal mistake.

SimplePathXna makes use of both a handful of singletons and a number of classes which are effectively useless without their publicly available static methods. As soon as text wanted to join in on the fun, I wrote a TextManager class. Just like there existed a GameplayObjectManager class, an XnaManager class, etc etc.

But something was different about adding this Manager. As if a weighty gaze was keeping my normally dexterous hands from doing the deed. It was here that the teacher came for my lesson. It was time to truly understand the reasons why my usages of the static keyword throughout my implementation of Text wrappers was a terrible, crippling design.

A crux of the  mechanics within Project OGUR is local multiplayer with up to four gamers on one screen, with live drop-in and drop-out. While trying to manage text from a single location seemed like a great idea, it was really a lazy solution to a complex problem.

Text was needed not only for each player, but also for numerous properties about each player. By making the TextManager a chunky singleton, each player’s HUD was stored in the same location. This made managing a single player nearly impossible without stomping on the data of another player.

An entire day of programming was not lost however. One of the principles I’ve learned from Beautiful Code is that bad, procedurally focused code can be transformed. Key applications of OOD will turn a pile of wet sawdust into a mighty oak, ready to grow new branches and withstand the changes of time.

This experience with multiplayer is the first concrete example I’ve experienced where throwing tons of logic into “Manager” classes failed miserably. On the other hand, refactoring that barely functioning code was a great mental exercise, and much of my labor was able to stay. Without too much referencing Fowler’s great book on refactoring, the deed was done. An hours and a half led to a much more OO friendly design that provided any given player with its own TextHandler object, wherein the existence of a player meant the TextHandler existed, so many many technical hurdles were lessened.

More explicitly, the issue was that keeping everyone’s data in a singleton meant that the HUD of every player was flushed when any one player changed their display, resulting in a lot of overhead processing. By splitting management into a more cohesive handler that each object could contain as a member, the difficulty in tracking various properties within the management class went away without much hassle.

Above all the programming experience was the way in which stepping back from the raw code enlightened the entire design process. Drawing out the basic flow of data between different classes, and redrawing a handful of times, on a white board lead to a very fluid workflow where each class had a minimal amount of responsibility. It wasn’t a legitimate UML diagram, just enough detail to help me visualize what needed to  be changed.

There are still going to be some singleton’s in the first full release of the SimplePathXna library (which won’t be until Project OGUR is finished as a project to use as a library’s proof of concept). For example, TextManager still exists. However, the first iteration of the class handled multiple operations. It allowed any logic to add text to be shown on the screen at any location using any font. It could also get a static resource that cached the Font information. That second piece, the caching, will still be the core purpose of retaining the TextManager class. TextHandler steals the other functionality as a means of scoping the text data. When a player issues a command, that command can trickle down through some object logic and manipulate the state of that command’s related text in a place where no damage can be done to other players.

I think a good rule of thumb to come out of this is that for most logic, anything that is more than a simple accessor should not a statically available resource. By that I mean something which should be singly available to any other given piece of logic. Say, the sprite used by an object to represent itself. Why duplicate that memory heavy piece of information more than once if it can be avoided?

This is certainly not anything new to the world of OO, but I like documenting the exact way in which the principle of singleton’s not being the silver bullet became clear to me. Perhaps it will help someone else understand the great disasters singletons will cause when misused.

 

I find that a project should become easier and more refined in focus over time, not more complicated and more difficult to use. SPX was always intended to be a bare bones framework that allowed for absolutely nothing more than helping developers creates game at a great pace and higher quality. Today was a successful growth in project OGUR, knocking out some of the critical sub-systems required to build the game.

During the process of crafting some logic I came upon an error in SimplePathXna. I have already pushed a fix for this problem and have decided that I want to do a small amount of work cleaning up some of SPX’s workflow. This will involve two major (albeit overall they are small) steps.

  1. Bring over most of the changes made to SPX to fit the needs of OGUR
  2. Separate the business logic of SPX into a separate library file. This will make both setting up SPX and developing larger projects with it much easier to swallow.

Step two is definitely the larger change coming to SPX, but I feel that it is required. Currently a person is tied to the directory structure of SPX if they want to use it. This doesn’t feel clean and actually gets a bit in the way on a project I’m currently developing. Once the project is separated into the framework itself and the sample demonstrating the framework I will push everything in one swell foop.

======

Having pushed everything, there are a couple of lessons learned. For one, there is a bit of coupling in the DLL to the end graphics that I want to investigate removing. Specifically the ways in which SpriteTypes are used to drive the animation engine and the constructors for the GameplayObjectFactory require GameObjectTypes to be defined, which aren’t available until defined by the end game.

 

I need to catch my breath. I’m currently in my home town without any need to remote back to the office for the first time in a long time. Looking back over the past seven days is a breath taking experience throughout this rainy day.

For starters, yesterday was my younger sister’s birthday. As a surprise I helped her learn the basics of building a website. Within a few short hours I saw someone move from not caring about programming to truly appreciating the power granted by learning to program a computer. Her funny little site is by no means the next killer app of the Internet, but I’m excited to see my passion for software engineering rubbing off on a family member. This opens a new channel of discussion between us, as well as a new path for affirmation. Both of her intelligence, and my role as an older brother.

At the same time, research is being conducted about the appropriate platform on which to build a potentially massive web application for a friend. It appears as though Ruby on Rails will be the best bet after reading many stack overflow posts on the debate of RoR vs. other languages and frameworks. Rails does a great job of pulling me into the beautiful design philosophies it embodies, the coming weeks will tell whether or not beauty can tame the beast of an application that needs construction.

However, RoR really exposes the weaknesses of Windows’ terminal support. The Console in which I run Git Bash is atrocious for reading longer outputs, but Powershell is slower than death. This meant a cleanup of my Ubuntu partition to make space for full-time RoR development under Linux. Setting up the latest ruby with the latest gem package manager was as simple as configure/make being called on ruby’s source snapshot and then  running the setup.rb script for the gem package manager. Once rails was installed from gem, everything started moving along smoothly. Over the next handful of days I look forward to continuing progress through the tryruby.org site and reading books on Rails.

Another interesting development is that of the direction my plans for an Xbox 360 Indie game are heading. The plan on paper is a platformer with a handful of unique gameplay mechanics driving puzzles and exploration. However, tonight I made a return to some rougelike games and have started to plan a second game. This second game is far more interesting to me personally, so there’s a chance that I’ll back burner the platformer for now until I make some headway on planning this second game.

I am more motivated to work on this new project because I’ve always wanted to build my own rougelike game. Ancient Domain of Mystery by Thomas Biskup has always been my favorite rougelike,  but I have many ideas beyond the styling of that game’s core play mechanics. Building this for Xbox will present an interesting challenge and I look forward to solving the problems that arise. There’s still much planning to do if I seriously want to build this, so its not the highest priority at the moment.

Then there’s AMIWAM. I’m fighting a battle at the moment with the Views of AMIWAM to overcome some awful flickering that occurs when I redraw the screen. There are numerous solutions available for this problem across the Internet, but so far none of them has proven useful. Every day I’ll tackle the problem with new ambition, only to break the effort an hour or two later to make progress on other projects. Once the rendering works perfectly the amount of work to rebuild Eucalyptus will be trivial.

 

 

The basic functionality of Bombard360 is finished to the point of what is due for my coursework. Now that I basically need to freeze the repo until classes are over (for grading purposes) I used the free time available to abstract out a lot of the code from Bombard360 into an easy to use framework for other 2D games.

This new framework can be found at this GitHub repo.

To get a feel for how the framework is used, try the following to add a new element to the game.

  1. Draw a new sprite in the next open open row of “SimplePathXna\SimplePathXnaContent\GameplaySheet.png”
  2. In the VS2010 solution, add a new element to the SpriteType (\Sprites\SpriteType.cs) enum that described the object you want to add to the game
  3. Add a new dictionary entry defining the contents of the sprite to SpriteSheetManager (\Sprites\SpriteSheetManager.cs)
  4. Create a new class that inherits GameplayObject (\GameObjects\GameplayObject.cs). In the constructor, pass the location and SpriteType into the protected Initialize method. This will handle most of the graphical setup for the class.
  5. Create a method within your new class with the following signature: public override void Update();, and define the object’s game logic here.
  6. In GameplayObjectFactory (\Factory\GameplayObjectFactory.cs), add a new case to the switch statement that defines the way your new object shall be created
  7. In GameplayState (\States\GameplayState.cs), call the function Add(GameplayObjectFactory.Create(400,400,SpriteType.YOUR_NEW_SPRITE_TYPE)); in the constructor
  8. Run the application, and an instance of your new object should show up on screen at 400,400. If not, then there’s a good chance that a null exception will be thrown before the game can launch, showing you what step you missed in setting the object up.

The benefits I’m finding from using this growing framework is the topic of a future post, but feel free to shoot me an e-mail if there are any problems encountered in getting setup with the project.

© 2012 Simple Path Studios Suffusion theme by Sayontan Sinha