Thursday, 19 April 2012

Sprite Scaling and Collision Detection

Spent some time tweaking sprite sizes in game. The destroyer (and bomber) units are now larger and more threatening. The knock on effect of this, is that I'll need to drop the pixel perfect collision detection. This is a piece of code I wrote probably 15-20 years ago. It has served me well but doesn't work with free rotation and scaling. It's hard to let go of code that took some time to figure out, but sometimes a mercy killing is required.

You can see the difference here:



Collision detection is now based on overlapping circles. This fits well with the ship shapes and the shields. The system may need to be more flexible for future games but serves well for now.

The use of scaling also means that I can optimise texture memory.

I spent a fair chunk of time this week planning an extension to our house. Now that the house is full of toys and a small boy running around, we definitely need more space!

Wednesday, 11 April 2012

News Letter Stuff

More engine chunks written. The form to allow sign up for the news letter is now done and working on both Mac and PC. The SFML Http class was helpful in getting this done quickly, although some work was required to encode the request data going to the web server. Another step closer to having a releasable game.

Also added functionality to allow a web browser to fire up on quitting. This allows some buttons to be placed on the menu to go to the website.

Should be back on gameplay code soon...

Thursday, 5 April 2012

Compiler Shenanigans

Next job has been storing the game fonts as bitmaps/character metrics rather than TTF. Another license restriction - I can't distribute the font files directly. Side benefit is the bitmap can be edited. Should be useful for texture or weathering effects on fonts in future games.

Recompiled the game on my Mac for the first time in months. I have to admit some apprehension...

253 errors to start with. Most of these were subtle compiler differences. Generally pretty easy to fix.

The two compilers (Visual Studio and XCode) have very different personalities. XCode is like the Nazi interrogator in Indiana Jones (the guy with the little glasses and threatening coat hanger). You will cooperate or be severely punished. Visual Studio is like one of those hippy English teachers - easy going, loose with the rules and more rewarding of experimentation.

Still have to create a utility to convert the TTF's to image/metrics, as I fudged this in the code to test it. Most likely will add some command line parameters to the game EXE to allow utility behaviours without firing up the game proper.

EDIT: The conversion functionality is now built into the engine. Any games I develop using the codebase will have a command line mode to manage assets. A neat solution, if I do say so myself!

Music-wise have been listening to a lot of Slayer this week. I bought the last two albums they did when Dave Lombardo came back. Really enjoyed them in all their Satanistic lunacy. Also explored some other tunes on Spotify - Halestorm (getting into rock with female vocals in my (38 year) old age) along with Seether and Shinedown.

Tuesday, 3 April 2012

Music Code and Infinitee

Away in the Lake District for a few days the other week, hence the quietude of the blog. Very lucky with weather - sunshine all the way. We're back to cold and snow now in the UK... :-(

Spent a bit of time this week rounding off my music code. Due to licensing restrictions, I can't redistribute the music in a standard file format (e.g. OGG Vorbis) therefore I'm converting the files into a custom format for distribution. I had to do the same thing for Gravity Core. It's all coded up now and was pretty easy. Another tick off in the task list and it's nice re-usable engine code to boot.

As an aside, a fellow Indie outfit (Subsoap) have taken a novel approach to the bundle concept. Check out the infinity bundle: http://www.infinitybundle.com/
This is either genius or insanity (although these aren't mutually exclusive!)

They've kindly included Gravity Core in a roundup of indie games at the bottom of the page.

Monday, 19 March 2012

Pretty Nebula and Spinny Things

Finally coded up the nebula effect. Came together very easily. Just rendered some of the late frames of an explosion (with some colour and settings tweaked) and drawing 100 scaled up sprites, with varying sizes, velocities, size and transparency. You get 100 lovely layers of parallax prettiness.

Also added a variant of enemy that comes down from the top then spins off at an angle sideways. Pesky critters are hard to shoot!

A couple of new screens:


Monday, 5 March 2012

Necessary Evil

Spent most of today working on 'necessary evil' functionality.

The game (and engine) now has slider bars for sound and music volume. Not the most exciting functionality but now it's done and re-usable.


The player (pilot) profile screens are now finalised, to support different players on the same machine. Essentially, each player can have their own keyboard config etc. Again, standard stuff.


It's amazing how much tweaking some of this stuff takes, so that the user interface behaves as expected.

Back to gameplay development next, I think!

Tuesday, 28 February 2012

Decent Quality YouTube Videos

Recently bought a new video editing package - Sony Vegas Movie Studio Platinum 11.0.

Previously I had been directly uploading FRAPS videos to YouTube (takes a looooong time) and also tinkering with Windows Live Movie Maker (resulted in horrible blurry videos).

It took a bit of effort to find optimal settings to make clean, crisp videos therefore I thought I would share my experiences and hopefully save somebody a bit of pain.

(I did have a few tips from other Indies - you know who you are, if you're reading - thanks!)

In order to match the 720p format, I started the game in a window at 1280x720 resolution (60 frames per second).

FRAPS is configured to 30 frames per second (otherwise the game runs a bit too juddery).

In Sony Vegas I created and rendered using 720-30p format (1280x720, 30 frames per second, progressive scan).

The critical part here is to specify exactly 30 frames per second (rather than the default 29.97 offered by Vegas). Using the 29.97 resulted in blur and ghosting. This needs to be done in the project (Project / Properties) and the render settings (Project / Render As - click 'Customize Template').

I also brightened up the video, as the compression seems to darken it a bit. I applied a 0.05 brightness increase and 0.10 contrast.

For bits per second I used 20,000,000 and the codec is Sony AVC/MVC (mp4).

I imagine the same rules (30 fps etc) will apply with other video packages.

Hope this helps someone out!

Here's an example vid:
http://www.youtube.com/watch?v=9zbqHO1NJnU

(note at 720p full quality it might need bufferring up a bit beforehand, but it looks fine at default quality if it's left in a window, rather than full screen).