Shmup Development (using XNA and C#)

Friday, August 22, 2008

Ladybird Galaxy

I have just started a blog about the development of my new game "Ladybird Galaxy", you find it at http://ladybirdgalaxy.blogspot.com

Sunday, June 08, 2008

My next game

I have been thinking a lot about the design of my next game. My design goals was that it should be easy to play and largely focused on multiplayer.

First, I tried a whole lot of shmup ideas. I really didn't like any of them, it was very hard to come up with a good idea what would play nice and didn't take forever to create.

I think I have come up with a idea I really like. Shocking news! It won't be a shmup! Instead it will be about boosting through space trying to crash into other players and picking up items.
It began one day when I was surfing the web and came across some cool graphics at Lost Garden. From those images I have now created something that is playable, singleplayer and multiplayer (on the same Xbox 360, systemlink or Xbox Live).

The game has really easy to understand game mechanics (just like a shmup): watch out for the bad guys and pick up the good stuff, simple enough? The final version of the game will still be released in the end of this year (when Microsoft releases community games for the Xbox 360).

Monday, February 25, 2008

The design of a new shmup game begins

The last couple of weeks I have been trying to figure out the design for my next game. Coming up with a solid design for a game is not an easy task. Some of the design goals I had was:

  • Should be easy to figure out, just pick up and play.
  • Feature both a fun and fast singleplayer experience and an addictive multiplayer mode.
  • Be able to play multiplayer four players locally (on the same console) or over the internet.
  • Lots of bullets and action of course :-)
This time didn't want to design the game where I had to create all the levels manually, instead I want to design a gameplay system that create random stages/levels. Oh, and there will not be a stage like in "Bullet Hell Tactics", there will be more like an arena style of gameplay.

I won't tell you much more about the game right now (this time I will be a little more secret about it). Of course I will post screenshots and gameplay movies when the time comes. I'll keep you posted in the development of my new game if you are interested.

The target release date for the game will be the end of this year, and you will be able to download it from Xbox Live and play on your Xbox 360.

Wednesday, January 16, 2008

Components of a shmup game: Manage and recycle objects

I thought about writing some series about developing a shmup game. It will be from my perspective (with the shmup engine I'm creating) and focus on some of the components in a shmup game. If I provide examples and code there will be with C# and XNA. I will probably not explain in detail what the sourcecode looks like, I will more explain the concept and design. Ok, lets go!

This is the first part of the series "Components of a shmup game" where I will write about how my shmup engine manages and recycles objects.

Introduction to objects in a shmup game

In a shmup game lots of objects are created and destroyed very often. Bullets that the player is firing, enemies that are spawned and then milliseconds later are destroyed, explosion particles and so on... The average lifetime of an object in a shmup game is very short.

Every time the player fires a bullet I don't want to create a new bullet (new Bullet()) because this will be pretty inefficient for the garbage collector, instead I want to recycle an already destroyed bullet. This makes all of the objects in the game need to know when they should be destroyed and recycled.

With this in mind I decided to create a few classes that helps me achieve this.

What the classes looks like when managing objects

What we know: Every game object in the shmup engine can be updated and drawn. It also need to know when it should be destroyed, recycled and how to be created from the "recycle bin".

Product - Base for every game object. Provides functionality to be updated/drawn. Can also be added to a manager through the method Activate(IManager manager) and removed from an manager with the Deactivate() method.

IManager - Interface for every object manager. Provides functionality to add an object with Add(IProduct product).

Manager - An implementation for a manager. Provides functionality to update and draw all the objects in the manager. When an object is destroyed and wants to be recycled it uses the associated Factory to add it to the "recycle bin".

IManufacturer - Interface for a manufacturer. Provides functionality to create an object with the method Create().

Factory - Handles creation of objects. Provides functionality to add and create objects to/from the "recycle bin". Manufacturers can be registered (with a name) to the factory for creation of objects that has not been recycled.

What is a factory and manufacturer, and how does it work?

It's pretty simple, a manufacturer is used to create objects. It has a single method, Create() that returns a created object. Every manufacturer knows how to create exactly one object.

A factory contains a dictionary of manufacturers. Manufacturers are registered (added) to the factory with the method Register(string name, IManufacturer manufacturer). The factory is also used with the Manager to handle destroyed objects. The factory got a Create(string name) method (the name is specified for the method so it knows which manufacturer to use to create the object). The factory also got a dictionary of destroyed objects (with the name of the object as the key).

When the Create(string name) method on the factory is called it first looks in the recycled objects dictionary to see if there are any objects available. If there are objects available it will be removed from the list and immediately returned. If there are no objects available the Manufacturer (with the specified name) is used to create the object and return it.

Example when the player fires bullets

Let me explain the object management of a bullet that is fired by the player and then hits a enemy (some stuff are excluded to we can focus on object management).

First we need to do some setup (this is before the game has been started):

  • We created a BulletManufacturer class that creates a bullet.
  • Register the BulletManufacturer in the Factory (with the name "MyBullet").
This is what happens when the game is running and player wants to fire a bullet:

  • Player presses space to fire a bullet. The Create("MyBullet") method on the Factory is called.
  • Factory checks if there are any recycled objects available. There are not (because the bullet has never been fired before).
  • Factory gets the BulletManufacturer (with "MyBullet" name) and calls the Create() method which returns a bullet. We now got our bullet that we add to our Manager (that handles bullets).
  • Manager updates and draws the bullet as it moves across the screen for a few frames.
  • The bullet collides with an enemy. Now we want our bullet to be removed from the Manager so we call Deactivate() on it.
  • When the bullet is deactivated the Manager will add it to the Factory recycled objects.
  • A few frames passes by and the player wants to fire another bullet. The Create("MyBullet") method on the Factory is called.
  • Factory checks if there are any recycled objects available. There are, so we just return the recycled bullet. We now got our bullet that we add to our Manager again.
That's how it works. I have provided more concept than code, but I hope this can help some of you to understand how you could implement this kind of object management.

I have the intention to write more about developing shmup components (for example):

  • Rendering system
  • How the stage and timeline works
  • Behaviors for entities
  • Developing a datadriven shmup
Would anyone be interested in that? Please write some comments...

Monday, January 07, 2008

Domain registered: shmup.net is mine

I have just registered the domain shmup.net for this blog. I was certain that the domain was already taken, but it wasn't... and now it's mine!! Mohahahaha...

Friday, January 04, 2008

Shmup engine running on the Xbox 360

I'm now a member of the XNA creators club, which means I can run my games on Xbox 360. It's so much more fun to develop and see it in action on a console.

Here are some of the features that has been in focus:

  • Rendering system: graphics can be drawn in the renderer in any order. Then when the draw function of the renderer is called all the queued graphics (models, sprites, particles) is sorted (by graphicstype and draworder) and then drawn. This works very well, just don't care in which order to draw the graphics.
  • Base classes: entity, enemy, player, stage, bullet, behavior...
  • Content pipeline: stage and enemy can now be loaded with the content pipeline.
  • Behaviors: can be added to any entity. Have created a few like chasebehavior (for enemies to chase the player or homing missiles), weaponbehavior (to fire bullets, both for player and enemy), scopebehavior (so objects can be removed when outside the screen), splinebehavior (make objects follow a spline).
Features I will continue to work with:

  • Bullet patterns: patterns will be loaded with the content pipeline.
  • State management: Screens and menus.
  • Editor: A simple editor to create enemies and bullet patterns.
Some screenshots (and video maybe) is coming later. I'm creating games for the Xbox 360, cool or what? :-)

Tuesday, December 11, 2007

The shmup framework/engine for XNA in development

It has been some time now since the last post and I havn't been doing any real XNA programming since I finished the Bullet Hell Tactics demo.

I have been thinking a lot about what the next project should be. I have thought about 3D engines, game engines or just game frameworks (to speed things up a bit when starting other projects)... Then I got the perfect idea about what to do! I should continue to work on my shmup framework/engine, I have already started and also created a shmup game with it so I now know how it should be done.

The engine I used for Bullet Hell Tactics was a good start, but while I was creating the game I found some mistakes and missing features I would like to include:

- It was not very easy to create levels. The only level in the game was created with XML, that itself is not a bad idea but the implementation was not the greatest. My idea was that all enemies could be specified directly in the XML file. That required a lot of thinking about how the enemies could be created (and also a lot of XML code). In the end I just created many different classes for the enemies, that was much easier than trying to specifiy them in XML.

- The engine was not designed to recycle destroyed enemies/bullets. If I someday what my shmup engine running on Xbox 360 I must recycle objects (cause of the garbage collection). In a shmup game a lot of objects (enemies, bullets, particles, explosions) is created and destroyed so recycling objects is a very good idea.

- Weaponsystem and upgrades for players was not supported. Also rendering of sprites and particles could be faster.

- It was not very easy to create enemy movements/patterns and in the end I instead used different velocity/acceleration parameters. I would like it to be easy to create patterns without those. Maybe creating the movements in another application and then import them into the game.

- Bullet Hell Tactics didn't have much of a intersting background (just a spinning skybox). It did the job well but in the end I would like a more dynamic world to blow things up in.

- Model animation was not supported by the engine, this time I want the enemies to be a little more interesting.

- Enemies in group (waves) was not supported.

This time I also would like it be of use for others that wants to create a shmup game. Maybe I'll put it up on sourceforge or something similar (though this is not certain).

Maybe you who read this have some ideas of what a shmup framework/engine should include, just write me, it would be interesting to discuss.

Saturday, August 04, 2007

Download Bullet Hell Tactics Demo 1.0 (Windows)

Bullet Hell Tactics Demo 1.0 (Windows) is now available for download. Please read the requirements before downloading. Also read how to play the game (if you can't figure it out for yourself).

Download Bullet Hell Tactics Demo 1.0 (Windows) - 32,5 MB

I have worked really hard with this game and had a blast creating it, hope you like it, have fun!

If you find any bugs or having difficulties running the game, please make a comment to this post and I'll try to help you.

Disappointed

I'm quite disappointed that Bullet Hell Tactics didn't make it to the final in the Dream-Build-Play contest, I actually thought it would make it. Oh well, the demo will soon be available for download...