Saturday, July 06, 2013

Postmortem: aBallAnche

Since XNA is no longer a viable option, I am going to talk about the game I developed for XNA: aBallAnche.

The game got completed around 90%

It was a silly little game, I did all the work from art to music.

Music can be found here by the way: https://soundcloud.com/dcproven/puzzle

This is the main screen:


It's based on one of the examples that came with XNA, so it's no that original. You need to drop balls to make groupings of the same color, the original part is that I added physics (Box2D) to it and the balls change in size, there are more colors too. So this means, the balls actually bounce and fall (thus the name, is easy to create an avalanche).




The game is nothing special, was fun to make and is fun to play, your goal is to clear the screen and as you progress in the game, you need to put more balls of the same color together, you start with 2 balls, then 3 and so on, it becomes really difficult to create groups of 4 or 5 balls with the same color when you have some left over balls.
Another thing I added to make things easier, is white balls, they change the color when they hit another ball and make it its own.



I also created adaptive music, since it's my thing anyway, and the different loops get different mixes as the game advances, the more unused balls you have the music is more intense. The sound in soundcloud goes through all the loops in order.

When you advance level, say level 3, you need to put 3 balls together, so the game will highlight when 2 of them are together with a flashing ring:



If you fill the whole container up, game is over and the scores would be kept.

A video of some game play is here, note the game is intended to be played with controller, but my girls were playing Minecraft and I couldn't steal the controller from them, so I used the keyboard, thus the slow movement of the ball:



What went right:
- I learned a lot about XNA, XACT and Box2D
- I learned more about adapting music to video-game.
- I had the pleasure to show my game to my daughters and friends so they can play it

What went wrong:
- XNA is kind of gone
- I didn't finish it up completely, you can spot some bugs in the game play, like gaps too big between balls (physical model and graphic model didn't match up 100%) and some other stuff.

I don't have an installer for it, but if you want to try it at one point and want to figure it out, drop me an email, we'll work it out.

Thanks for reading.

Monday, May 16, 2011

It's been a while

OK,
didn't mean to quote Staind, but yeah, it's been a while since I wrote something here...

I've been trying to find more time to write stuff for games, but hey, life happens, got pretty sick, moved across the world, got better,...

So let's see, I am trying to finish a game for XNA these days, a simple game using a physics engine, I'll aim for both PC & XBox360 but we'll see if I can finish it, with all that is going on.

Regarding music, I've been enjoying video games lately in 5.1, it really gives you another dimension... it's funny how some games' music get your attention... like Fancy Pants, really cool stuff going there...

Even silly stuff like IloMilo makes me wonder how complicated it would be to create something like that....

Anyway,

I'll see if I can post more often and specially whatever I try to accomplish in Video games and music/sound.

Take care.

Friday, August 28, 2009

Audio and Music work

I am working on this Indy project adding Audio and Music, plus all the implementation with XAct, Torque and XNA.

I think it's going to be fun and it was about time I got back into Music and Audio for games.

This is the link for the project: Silver Age

I think Dan was right and I should really get involved in audio and music for games...

David

Wednesday, December 26, 2007

Dan Morris

My dear friend Dan Morris passed away on the 21st of December, he was working at Activision in Central Audio. I'll miss him immensely, he was a great guy and a musical genius.

I miss you man.

David.

Thursday, September 13, 2007

XNA & XAct sample

It's been a while, but here I am posting a very simple test program.
If you have 2 background cues, say ambience and battle, you could switch between them with this code.

Keep in mind that LoopEvent = Infinite only in the ambience and battle cues not in the transitions to and from ones.

Here is the code. If you want the exe and resources let me know and I"ll post it somewhere is some 20MB with my music.

This is my Game1.cs file

Code:
#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
#endregion

namespace MusicTransition
{
///
/// This is the main type for your game
///
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
ContentManager content;


public Game1()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
}


///
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
///
///
AudioEngine audioEngine;
WaveBank waveBank;
SoundBank soundBank;
enum GameStates { Ambient, Amb2Bat, Battle, Bat2Amb };
GameStates CurrentState;
Cue Ambient;
Cue Battle;
Cue Amb2Bat;
Cue Bat2Amb;

protected override void Initialize()
{
audioEngine = new AudioEngine("Content\\Audio\\MusicTran.xgs");
waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");
CurrentState = GameStates.Ambient;
Ambient = soundBank.GetCue("Amb");
Battle = soundBank.GetCue("Bat");
Amb2Bat = soundBank.GetCue("Amb2Bat");
Bat2Amb = soundBank.GetCue("Bat2Amb");
Ambient.Play();

base.Initialize();
}

///
/// Load your graphics content. If loadAllContent is true, you should
/// load content from both ResourceManagementMode pools. Otherwise, just
/// load ResourceManagementMode.Manual content.
///
/// Which type of content to load.

SpriteBatch ForegroundBatch;
SpriteFont CourierNew;
Vector2 FontPos1;
float FontRotation1;
Vector2 FontPos2;
float FontRotation2;
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
CourierNew = content.Load("Times");
ForegroundBatch = new SpriteBatch(graphics.GraphicsDevice);
}
FontPos1 = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, (graphics.GraphicsDevice.Viewport.Height / 2) - 50 );
FontRotation1 = 0;
FontPos2 = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, (graphics.GraphicsDevice.Viewport.Height / 2) + 50);
FontRotation2 = 0;
}



///
/// Unload your graphics content. If unloadAllContent is true, you should
/// unload content from both ResourceManagementMode pools. Otherwise, just
/// unload ResourceManagementMode.Manual content. Manual content will get
/// Disposed by the GraphicsDevice during a Reset.
///
/// Which type of content to unload.
protected override void UnloadGraphicsContent(bool unloadAllContent)
{
if (unloadAllContent)
{
// TODO: Unload any ResourceManagementMode.Automatic content
content.Unload();
}

// TODO: Unload any ResourceManagementMode.Manual content
}


///
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input and playing audio.
///
/// Provides a snapshot of timing values.
protected override void Update(GameTime gameTime)
{
FontRotation1 += 0.001F;
FontRotation2 += 0.01F;

switch (CurrentState)
{

case GameStates.Amb2Bat:
{
if (!Amb2Bat.IsPlaying)
{
CurrentState = GameStates.Battle;
Battle = soundBank.GetCue("Bat");
Battle.Play();
}
break;
}
case GameStates.Bat2Amb:
{
if (!Bat2Amb.IsPlaying)
{
CurrentState = GameStates.Ambient;
Ambient = soundBank.GetCue("Amb");
Ambient.Play();
}
break;
}
}

if (Keyboard.GetState().IsKeyDown(Keys.A))// user trigered
{
switch (CurrentState)
{
case GameStates.Ambient:
{
Ambient.Stop(AudioStopOptions.Immediate);
Amb2Bat = soundBank.GetCue("Amb2Bat");
Amb2Bat.Play();
CurrentState = GameStates.Amb2Bat;
break;
}

case GameStates.Battle:
{
Battle.Stop(AudioStopOptions.Immediate);
Bat2Amb = soundBank.GetCue("Bat2Amb");
Bat2Amb.Play();
CurrentState = GameStates.Bat2Amb;
break;
}
}
}
// Allows the game to exit
if (Keyboard.GetState().IsKeyDown(Keys.X))
this.Exit();

// TODO: Add your update logic here

base.Update(gameTime);
}


///
/// This is called when the game should draw itself.
///
/// Provides a snapshot of timing values.
protected override void Draw(GameTime gameTime)
{
if(CurrentState == GameStates.Ambient)
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
else if (CurrentState == GameStates.Amb2Bat)
graphics.GraphicsDevice.Clear(Color.Purple);
else if (CurrentState == GameStates.Battle)
graphics.GraphicsDevice.Clear(Color.Red);
else
graphics.GraphicsDevice.Clear(Color.BlueViolet);
ForegroundBatch.Begin();

// Draw Hello World
string output = "© 2007 David Cortés Provencio, Software and Music.";

// Find the center of the string
Vector2 FontOrigin = CourierNew.MeasureString( output ) / 2;
// Draw the string
ForegroundBatch.DrawString( CourierNew, output, FontPos1, Color.White, FontRotation1, FontOrigin, 1.0f, SpriteEffects.None, 0.5f );

output = "Press 'A' to transition and 'X' to exit";

// Find the center of the string
FontOrigin = CourierNew.MeasureString( output ) / 2;
// Draw the string
ForegroundBatch.DrawString( CourierNew, output, FontPos2, Color.Black, FontRotation2, FontOrigin, 1.0f, SpriteEffects.None, 0.5f );

ForegroundBatch.End();


base.Draw(gameTime);
}
}
}

Thursday, June 07, 2007