Monday, March 24, 2014

Camera Shenanigans

I spent a little time over the weekend putting together a list of some areas of the game I'd like to tinker with; although I currently have a lot of prototyped code in the game (and nothing actually 100% finished), I'm liking the experimental phase as it allows me to a) learn Game Maker in a much more hands-on fashion, and b) helps me iron out those unexpected kinks and foibles.

One such foible reared its head over the weekend, in the form of some nasty gaps between the background tiles. I'd implemented a camera system which not only dampens the camera's movement as it tracks the player, but also allows the camera to zoom in and out (in the version of Citadel in my head, I've always loved the idea of zooming in tight in times of close combat, or zooming out to emphasize the size and scale of the underground cities).

After a little detective work - and more than a little cursing - I stumbled across this article which explains the issue and why it happens (and not a moment too soon - I'd already downloaded Unity as a threat to Game Maker if it didn't start to behave itself!). I spent an hour this afternoon tweaking the tileset, adding a gap between the tiles and padding the edges of each tile image.

After reconstructing the map, I fired up the game and the gaps had become a thing of the past - one of those classic situations where, despite the work that went on behind the scenes, the game looks virtually identical to the way it did before.