Spacefight – Game finished – Part 12

spacig

The game is finally complete!
You can find it under the download section on this blog, if you want to try it out. You can also look it up on Bitbucket.

I’m quite happy how it turned out. I have managed to figured out a lot of things during the process.

Lessons learned

Building for different platforms is NOT easy!
There is a lot of advertisement about how easy these open source tools are to port. It’s really not. Even though I’ve been developing the game under Linux, there is no easy way to distribute a binary package under Linux. It’s hell to try and build things statically and sometimes there are things missing which needs a recompilation.

There is of course the possibility  to distribute the source and tell people to download dependency A, B, C and D and a compiler to build the game. But come on! That is way too much hassle for a person just to try out the game. The only way is to make packages for the most popular Linux distributions like Ubuntu, Linux Mint or Fedora. If you have any tips for making statically builds with SDL on Linux, please help me out!

Mac OSX was also not easy to make a build for, what is up in the download section is a build which includes pretty much the whole SDL framework. Probably there is another way to decrease the filesize or build it differently.

Keep track on those memory leaks
When a new feature is added and the program compiles: Do some leak checking! It’s way easier to handle one memory leak than 10. It also eliminates places to look when you hunt down a leak.

Keep the momentum and don’t give up
Programming always has it’s peaks and it’s dips. In one moment you feel that everything is working really well. But a couple of hours later you’re in code hell, whereas something you didn’t expect should happen, happened or vice versa. It’s important not to be discouraged. Eventually you will find a solution.

Keep it simple stupid!
I felt I needed to keep the game fairly simple. Game development is a lot of work. In the planning stage it’s easy to overcomplicate things. But game development is not only code. You need graphics, sound! So for instance: if you want a game with over hundreds of different items, you will need to draw more than 100 items, or find someone who will do it for you.

The whole point with this, is to keep the momentum and the enjoyment level fairly high throughout the process. For instance Minecraft was made with a simple idea from the start, and then later built upon. And when you begin your writing your first game, you’re really not that structured. But we all must start from somewhere.

Room for improvements

Messy game file
Of course there are things hindsight I would probably have done differently. In the end, there is way too much happening in the game.cpp file. In the next game a lot more efforts will be in creating more game states.

More collision boxes
It would be better if each game object had more than only one collision box. Spacefight only contains simple objects, but if there would be a large more complex object it would be neat if the GameObject had a list of collision lists to check against instead of only one on each object.

Better animations, rotations
There is a lot of room for better animations in the current game. The enemies could move in a different pattern. I think I will move on to SDL 2.0 to see what new functionality it has to offer. SDL 1.2 has very basic support and to do rotation you need to download yet another library, which apparently does it in an inefficient way.

Better structure
I could have made better code structure. For instance, the need of an animation and sound library came a bit late into the process. So it was hard coming up with an idea how they would play along with the game object. I could also make more factories to produce enemies and other things.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.