Thursday, August 23, 2012

Making Jupiter Battle


This fortnight I am going to take a look at episode 8 of Twelve Months of Doomsday. It shared a fair bit of code with an earlier episode in the series (I'll leave determining which episode as a challenge to you) so development was fairly quick. The big thing with this episode was the addition of gravity. Some people who have played this game didn't think I made the gravity strong enough, but at the same time I didn't want it too overwhelming. If there is a future release of this game, I may tweak it a bit more.

In physics, gravity is actually the weakest of the known forces in the universe. It, however, acts across the length of the universe. The further away from an object the less gravitational influence that object will have. The formula for determining this is Force = Gravitational_constant * (object_1_mass * object_2_mass) / distance^2. For the game this is simplified. The planet's gravity is divided by distance squared of the ship from the planet in question resulting in the attraction to the planet. This is treated as acceleration. All five moons and planets are calculated and applied before any ship motion is done. The nice thing is that simply changing a planet or moon's gravity value is all that is needed to alter the gravity.

Originally, gravity was also applied to the alien ships as well. The problem is that the alien ship adjusts it's course every interval so it automatically corrects it's course. While there may have been a slight slowing down of the alien ships due to this correction vector being applied, the amount was not really noticeable. As this is a lot of calculating for no real result, I removed the gravity from the aliens. The result is a bit faster of a game, but on most systems this wouldn't be noticeable anyway.

The only other issue that really came up with the development of this game was the zooming in issue. My idea was that when the player came too close to a planet, there would be a crash animation. This was coded as the planet zooming towards the player. The problem was that the zoom animation code would for some strange reason zoom up and to the left of the planet. It took me a while to realize that I was pre-calculating the screen-offsets from the ship to keep the ship centred. While the zoomed play field scales, the size of the screen does not so the centring of the screen have to be done after the scaled coordinates of the ship are calculated. A simple enough mistake that should not of taken the hour it took find. A debugger may be your friend, but when the calculations look correct it is sometimes hard to see what the tool is showing you.

Other than playing around with gravity and alien shooting accuracy, about the only other change I would consider making to this game would be to rework the alien movement system so that alien ships appear to  also be affected by gravity. Not quite sure how I would go about doing this but if I revisit this game I will try to come up with something.

Thursday, August 9, 2012

Some thoughts on Zynga

I have been hearing a lot about Zynga in the news lately. While I am not a big fan of the company, who to me seem to be far more interested in extracting money from their players than in actually creating compelling games, I actually have taken their side on some of the issues. Yes, they may be an evil company that clones other peoples game, copyright does not protect ideas just the implementation of the ideas. I can make a clone of Asteroids if I want to as long as my version of the game has some new and unique elements to it. People may complain about this, but in reality it is far easier to sell a game that is 10% unique and 90% similar to other games people have played than it is to create a game that is 90% unique. Far too often people want a new game that is "just like the game I just finished except different".

When I heard that EA was suing Zynga over copyright infringement I was ready to take Zynga's side  but when researching the EA versus Zynga lawsuit  I came across the following article: http://dlr-law.com/3/post/2012/08/zynga-slammed-again.html . It seems that there actually may be something to EA's lawsuit. When you hire people away from a company in order to produce a game that is similar to the one that they are producing, you are only asking for trouble.

There are actually a few game ideas that I have abandoned due to people I have done consulting work for planning a similar game. My thoughts are that even though my version of the game may be 100% mine, it would be easy for the company to claim otherwise and they tend to have far more resources than I have when it comes to lawyers. It is best to avoid potential legal entanglements, especially since I happen to be the type of person who would not back down if it came to legal action and so would end up having to spend way too much money on my legal defence.

Perhaps one of the reasons I am not as successful as companies like Zynga isn't my total and complete lack of marketing skill, but the fact that I actually have ethics. To me, making money isn't the important thing. I created Blazing Games because I wanted to create games. I think that far too many of the successful game companies are successful for the wrong reasons. Worse, these companies have a tendency to buy the companies who exist to make great games. Bioware is just the first example to come to my mind.

The sad reality is, despite my claims to be ethical, if Zynga came to me and offered to buy me out I would jump on the opportunity if there were enough zeros in front of the first non-zero digit. I would make up excuses such as "They will properly market my games" and "It would be nice to actually have a budget." Yes, those excuses would actually be true, but the reality is that everybody has their price. In my case that price is probably not as high as I would like to believe, especially in this economy.