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:
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.