Now destroy thine enemies… in more interesting ways!

Watching some videos of the more established players resulted in a conversation about how funny it would be to add kamikaze dynamics to Solaroids:

“Thank you! I like every single aspect of this game. It’s wonderful 🙂 One Suggestion: It would be very funny if I could use my spaceship for Kamikaze attacks. In higher Levels, when I loose a life and all my guns, but I do have left some spaceships, it would be very cool if my spaceship would do some serious damage to the enemies, if I hit them with full speed.” – Damnax 1985

I little thinking about how it could be incorporated without changing the “rules” of the game to drastically, and this was my response:

“Thank you for the compliments! That’s an interesting idea, kamikaze! I could incorporate speed into damage calculations as a multiplier of sorts. I could also possibly make player ships the only thing that can take out the core of a boss before all peripheral parts have been destroyed. So if the core is exposed you could ram it there and blow the whole thing up for the cost of a life. What do you think?” – Me

Soon I had found time to implement it and it worked pretty well. When moving fast enough, when your ship explodes by hitting some physical object, be it an asteroid, mine, other players when friendly collisions is turned on, or your formidable foes, it will cause your own core to detonate unleashing a shock-wave of molten plasma.

But when you have a hierarchical system of parts that the bosses are made up of, you can’t just “blow the whole thing up” and expect everything to be gone. You need to take that things apart!

Destructible Cores

Kamikaze Dynamics + Destructible Cores = fun times!

If you’ve played Solaroids before, I hope you enjoy the subtle “tricks” and random possibilities this adds during both single player and crazy local co-op sessions. I’ve tried to load up the game with little details and strategic secrets I’ve carefully balanced into the game for your discovery. If you haven’t tried Solaroids before, give the Free Demo available on the Steam store page a whirl by yourself or with your friends and family and don’t forget join the Community Hub. There are many more features on the way including mouse and twin-stick style controls on immediate horizon, and an alternate BETA Branch for both the full game and the demo, and I would love to hear your feedback and suggestions to make it the best Asteroids “clone” available.

Solaroids is available on Steam Early Access and is still being actively developed by Chad Yates as part-time Indie game developer.  Come try out the free Demo, join the Community HUB on steam, or join the ranks of brave fighter pilots defending the solar system and competing for high scores and prestige!


To Parallax or Not to Parallax

I’ve always though it would be cool to use 2D parallax techniques in Solaroids, but I always had reservations.  Who doesn’t like stars whizzing by at light speed and the sense of depth that multiple layers of background elements can provide.

When I started developing Solaroids I knew I wanted nebula to provide some kind of “ground” for the player. Solaroids being an inertia based game, and having a larger than single screen playing area, I felt it was key to provide a stable background in order to maintain a sense of location. As the player thrusts and drifts a long in a heavily populated arena of moving asteroids, enemies, and hazards, how else are they going to keep track of their current velocity. It was for these reasons, the time it would take to try it out to confirm or debunk my theories, and only a few requests for it, that I didn’t until just recently set out to experiment with it.

Solaroids has 6 dedicated layers that make up the current visuals.

  1. Backdrop stars / distant gas clouds
  2. Sprite based stars
  3. Nebula’s, galaxies, planets
  4. Gameplay
  5. Energy
  6. Lens effects

If parallax was to be added it was going to be to layers 1-3 only.  So after a recent reminder from a dedicated player that it needed it, and recent completion of some higher priority features, I set out to experiment by incorporating parallax math into those three layers. This wouldn’t make individual elements (stars, nebula, etc) exist at there own simulated depth, but it would be able help prove out whether the technique would ruin gameplay or not, and also let me play with adjusting the amount. It ended up looking pretty good. Musing about with the ship, at moderate amounts it didn’t seem to affect my ability to play the game either.  At extreme amounts it did give more of a “floaty” sensation, and some might even experience a bit of nausea, so having a way to turn it off, or control the amount would definitely need to be in the final version. A quick check with a player on a restricted alpha branch, and it was confirmed it needed more!

Convinced that the parallax had merit now, and knowing it would be a user option, I set out to take those three layers and allow individual elements to have unique depths within the layer. This really took it to the next level, so I posted a preview video to YouTube and twitter (above).  Based on the feedback and response I got I was definitely on the right track.  Even my wife, when she saw it for the first time, said that I needed to redo my trailer with parallax as it looked so much better.

All would seem sunny and bright at this point, but of course there’s always something that doesn’t go smoothly.  For this feature, that was the Seamless Wrapping mode I had just got done putting in the game before Christmas.

Let’s go back a bit. Originally, Solaroids had a wrapping arena where traveling through one edge of the world would end up with the player ending up on the other side. Just like the original Asteroids.  The caveat to this is that you can’t see what’s on the other side because Solaroids plays out on a large scrolling arena.  Is it a feature or a bug?  Well many players felt it was disorienting while fighting enemy ships, especially in the corners, and they are right. So a feature dubbed Seamless Wrapping was introduced that when active would eliminate the edges, and instead allow the player to keep flying as if they hadn’t wrapped, even though they really had.

From the above video one would think it was plain and simple, but that was the final product. It ends up that seamless wrapping and parallax don’t really go well hand in hand, which makes some sense, since it’s kind of like folding space and not something that I don’t have a lot of personal experience with.

One way of creating parallax in background elements is to dampen the elements behind the gameplay layer which is scrolling by at the nominal rate. Imagine your flying along and the coordinates of you ship wrap around.  So at that moment when you cross over there is a discontinuity on any layer that isn’t at the nominal scroll rate. A star in the background can’t be offset appropriately for both sides of the wrap. This can be easily mitigated if each layer is a seamless texture, but I needed to be able to put actual objects and landmarks in the background.  I solve this by keeping track of the original unwrapped position of the camera, and then using that value to compute the amount of parallax offset to apply.

One caveat of this method, is that if you keep flying in the same direction, the background elements continue to shift.  This isn’t noticeable since the world is being seamlessly wrapped, but it does pose a challenge for position tracking of any elements in the background with respect to the game play layer.  In Solaroids a prime example of this is the sun.  The sun is in the background, but it is also tracked in the player reticle showing the direction to it. The perceived position of the sun, taking into account parallax, has to be computed (projected) from parallax space into game space in order to correctly find the direction to the sun.

So the lesson to be learned is: seemingly simple features by themselves can take on new complexity when combined together.

Solaroids is available on Steam Early Access and is still being actively developed by Chad Yates as part-time Indie game developer.  Come try out the free Demo, join the Community HUB on steam, or join the ranks of brave fighter pilots defending the solar system and competing for high scores and prestige!


Winter is Coming!

Space is a cold, even frigid, place and a sinister plot has been hatched by unknown forces. Working against us, an alien presence has deployed the biggest snow machine known to man, or any other-worldly inhabitant for that matter, in the hopes of sneakily invading our little corner of the galaxy.

Battle the most fearsome and retaliatory snowflakes (and the slithery snowman) you’ve ever laid eyes on, in a deadly battle against what would appear on the surface as a winter wonderland.

Use your skills acquired playing… ahem… Solaroids, to defend our little home. Do you have what it takes? Do you even care enough to stand up and be counted among humanities last hope for survival?

Briefing Instructions to access the xmas game branch on Steam:

  1. Right-click on the game within the Steam client and select the Properties menu item at the bottom.
  2. From the Solaroids: Prologue – Properties dialog select the BETA tab.
  3. From the BETA tab pick xmas – Happy Holidays from the Select the beta you would like to opt into drop-down selector. You should immediately see an update queued.
  4. Close the properties window and prepare for battle!

Once you have either saved mankind or screamed in agony at defeat, you can return to your normally scheduled program by returning to the BETAS tab and picking NONE – Opt out of all beta programs from the drop-down selector.

Happy Holidays and merry X-Mas HO HO HO!


XNA Quick Tip – XNA SpriteBatch and Garbage

The XNA SpriteBatch class maintains an internal array to hold sprites to be drawn between calls to Begin() and End() if a sort mode is used. This array will grow as necessary, however, the reallocation will inevitably result in extra garbage that will eventually need to be collected.  On the XBox 360 this is quite expensive and so in general it is recommended to limit garbage wherever possible.

If you know the upper bound on the number of sprites to be drawn in a single batch, you can force the draw before the game begins.  This is pretty easy to do, however to make it even easier when you have multiple SpriteBatch instances for different purposes I use the following simple wrapper class in Solaroids that has a new constructor that takes an extra argument for the expected number of active sprites:

/// <summary>
/// Wrapper around a SpriteBatch that pre-allocates internal sorting buffers by drawing a set of sprites thus forcing the buffers to be expanded.
/// </summary>
public class PreallocatingSpriteBatch : SpriteBatch
{
  /// <summary>
  /// Initializes a new instance of the <see cref="PreallocatingSpriteBatch"/> class.
  /// </summary>
  /// <param name="graphicsDevice">The graphics device.</param>
  /// <param name="expectedActiveSprites">The expected number of active sprites.</param>
  public PreallocatingSpriteBatch(GraphicsDevice graphicsDevice, int expectedActiveSprites)
    : base(graphicsDevice)
  {
    ForceBufferAllocation(expectedActiveSprites);
  }

  /// <summary>
  /// Forces the buffer allocation.
  /// </summary>
  /// <param name="expectedActiveSprites">The expected number of active sprites.</param>
  private void ForceBufferAllocation(int expectedActiveSprites)
  {
    Texture2D tex = new Texture2D(GraphicsDevice, 16, 16);

    Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

    for (int i = 0; i < expectedActiveSprites; i++)
    {
      Draw(tex, Vector2.Zero, Color.White);
    }

    End();
  }
}

Audio positioning and a new boss

Wow it’s been awhile.  I haven’t had any free time to work on Solaroids since last June.  With a big work commitment out of the way and a much needed holiday break, I had a chance to work on it for a few days.  The results are a new boss ship, some newly done sound effects, and positional audio complete with Doppler effects on the missiles.  XNA sure makes it easy to put this stuff together, and after this update I’m a lot more confident with the XACT audio software.

Here’s a couple of screen shots and a video showing off the new features.

Solaroids 2010-01-07 22-54-35-33

Mean enough?

Coming in for the kill

Coming in for the kill

Surprise!

Surprise!


Inkscape for Games

I’ve been using Inkscape, a freely available open source 2d vector drawing package, to do my 2d art for Solaroids and it has been working out quite nicely.  The limitations of vector art have given Solaroids a distinctively smooth style that I kind of like for a game such as this.  It has a certain modernized retro-feel to it that fits perfectly considering its graphics originated many many moons ago in a different computer era.

playershiplarge2

Redux

playershiplarge

Original

Here’s a comparison of the original player ship done in Deluxe Paint III on the Commodore Amiga vs. the new version done in Inkscape. Of course the original is being linearly interpolated by the web browser, and actually looked pretty good at it’s designed for resolution of a whopping 320x200x5bit, but the Inkscape version looks crisp and beautiful. Due to the nature of Inkscape and svg, the new version is actually resolution independent, so I can export it at whatever resolution is required.  Solaroids supports 1080p and so my graphics are exported large enough to support full detail at 1920×1080.

A couple of tips when using Inkscape for game development.  I export my images as png files, and unless you go into the Document Preferences and set the background color to something suitable (black instead of white in my case) you’ll get sub-pixel halos around your images when positioning, scaling, and rotating them in XNA.  This appears to be due to the graphics hardware using the neighboring (fully transparent) pixel color during interpolation.  It may also have something to do with the sprite sheet content processor I’m using as well.

Another cool thing about Inkscape is it remembers the export filename based on the set of shapes selected, so if you have multiple sprites in your document, you can repeatedly re-select various ones and it will remember your last filename for the selection as well as other export settings such as dpi etc.  Very nice.


New video of gameplay showing new effects

I posted a new video at youtube to show some of the new additions in action.  New sun and planets.  New middle ground stars to give it a little more dimension.  I fixed the background stars as it had a funny artifact that was visible at certain gamma levels.  I also changed the explosion particle system to have a red/orange tint to give it a little more color and increased the size of icons in the player HUD and made them resolution independent.  This one also has a different more mellow audio track I composed, great for cruising around in space and clearing space debris.

There is also a SD version available if your computer can’t handle the HD version.