Hello, habr and its inhabitants. In this post, I will share with you a cool story about how I tried to create the Most Real Indie Game alone, and through what I had to go through so as not to quit this ungrateful business halfway, and what happened in the end.
Foreword
So let's start with the fact that I am currently 17 years old and I am a schoolboy. Many will stop reading already after the previous sentence, saying “Another shkolota on my habr, that he forgot here at all ?!”, so if you still read on - thanks to you, I will try to meet the expectations.
The beginning of time
It all began as usual with Ideas. In September 2011, I suddenly had the idea that it would be nice to apply my little knowledge of java at that time and write some hand-made article for the regional contest “Young Programmer”, and since I simply did not want to write a program, I decided to write a game . But which one? I had a lot of ideas, but they all rested on one thing - I absolutely could not draw. Then I tried to recall games built on simple or procedural graphics. I remembered Darwinia, Dyson (now Euphloria), and the same Tetris, and in the end I had the idea to write my own Crayon Physics Deluxe, with magnetism and nerds. Not a bad idea, I must say.
')
In short, I imagined the gameplay as follows: as in Kryon, the player has a ball, a level and a certain end point on it, to which this ball needs to be held. The only difference is that in Kryon it was necessary to draw, and in my game I assumed an arbitrary change in the physical laws of the world so that they satisfy the player's needs. Roughly speaking, they wanted F = ma to become F = mv and change. Or g = 9.8 to g = m. Cool! But difficult for the player.
As a result, the concept has come down to the fact that the player has a set of several formulas that he can apply to objects on the level. Each formula acts on one of the physical properties of the object. For example, at the first level there is a ball, which is in zero gravity, a slope, and at the foot of the slope there is a final level. Given the formula "GRAVITATION". The solution is elementary - we drag the formula onto the ball, it falls and rolls down the slope, leading us to the next level.
Development and first versions
Naturally, the most difficult task was to write a physics engine. I wanted to write everything myself, I don’t like to take it ready. I knew Java at a rather weak level, before that I had written only a simple Tower Defense, a sapper and a few programs on it, but I practically didn’t know physics and vectors at all. Nevertheless, he tried to do everything himself. When I failed, I began searching for articles. I found a lot of articles, but all of them were frankly incomplete and helped very little. As a result, I found an excellent article in which there was a rather detailed code (with the exception of some sections), all the sources and a compiled example. Ideal, except that the code was in Delphi. But Delphi is not Haskel, I successfully translated the code into reality for a couple of hours.
To my luck, everything worked and I began to work on the gameplay. Soon I learned that the notorious contest "Young Programmer" was just around the corner and it was necessary to send the work before October 1. Considering that I started in the second week of September, and it took two weeks to write the engine, I had a week left to implement the gameplay. I made the graphics plain, as foreign testers put it - “Old CAD style”. As a result, in a week I made the first version of the gameplay, in which there was even a menu and a help section. I ditched one working day to create three levels - everything was in a clean notebook, I hadn’t done any editors yet. The name was coined by a roommate (I live in a dormitory), it seemed to me to sound pretty good, though almost meaningless - Spin Deluxe. So, on September 30 at 23:59 I sent the first version of the game to the competition, not paying attention to the fact that the toy shamelessly braked even on my eMachines E642G in high performance mode.
Download build
here .
Failure after failure
The competition was to be held in November, as I recall. By this time I fixed a lot of errors, completed the interface and menu, fixed the bugs. On my laptop, the game no longer slowed down. What was my surprise when bringing a new version to the competition, I found that the game still slows down and quite strongly. It didn’t hurt much, I had a perfect presentation and presentation as a whole, I wasn’t even asked any questions, but the effect was still blurred. And besides, the game still looked quite damp, from the sound design there was almost nothing - the visual was also lame in both legs. As a result, I received the second place, which seemed to me rather offensive, since the work in the first place was mildly mild and written by an amateur. I can only recall from it that the game was written in Visual Basic and for the storage of in-game data did not use random access memory, but an Excel table on the disk. It was then that I realized that I was surrounded by amateurs and decided to go my own way.
Download build for the contest
here .
Nevertheless, I was offered to participate in the school scientific-practical conference, and I agreed. By the time I seriously worked on the interface and even made the level editor, the work began to go much faster. iZucken wrote the first music, and reAlien drew the icon. I also started optimizing with the profiler. It turned out that my mistake was that I used a completely wrong drawing method, so drawing the graphics took 98% of the execution time. My presentation of the next updated version delighted the hall and provided me with an unequivocal first place.
Naturally, my hand-made article was not pulling at the scientific work, so in my report I indicated the purpose of the work “Learning the Java programming language as a game development language”. He pulled the topic behind the ears with white thread, as they say. This is probably why at the city stage of the conference I didn’t take
anything at all , and the first place was received by the boy who compared the speeds of various types of Internet connection. Right? I wasn’t even noted, unlike the guy who wrote the guest book in PHP, even without a simple design, in which the tags were only b and br. By that time, I had sketched out a small website on a paid hosting site with a forum, gallery and file archive. All this is not to cry into your waistcoat, but to the fact that I once again got a serious minus to motivation, which almost made me drop everything again. Here we have such support for novice developers.
View the site
here .
Download build for the conference -
here .
Desura and all-all
In February, I came across Desura indie game distribution service and the motivation came back to me. Having created the game page and the bay screenshots, I received a refusal - they say the screens were not very good, and there was no trailer either. In the end, I started a serious improvement in graphics. The clumsy something has now really turned into a ball, the interface has been completely rewritten and changed, it has become less cumbersome, a table of records has been added, and many things in serious projects. The game was not much different from the final version. For a couple of evenings, a trailer was made for specially written music. In the end, I received a long-awaited appruv and a huge incentive to work on.
So, the code of the game was 95% ready, the only thing left was the content. Doing levels did not want to persist. I wanted to get them all at once, so much so that at least a hundred. I did 2-3 levels a day. Sometimes I did nothing at all. Fantasy stubbornly did not want to work. As a result, once I sat on my ass and drew 20 levels in a notebook. Then another 20. A couple of weeks spent on the implementation and refinement of the concepts of levels. I scattered them in chapters, wrote intro and outro, added more visual effects. The product has become almost ready-made. iZucken wrote a few more tracks that successfully fit into the game.
The release was scheduled for April 4th. My only mistake was the price. I was partly to blame, partly my father, who incited me to sell it more expensively than I wanted. As a result, the final price I set the amount of $ 4.99. Expensive and reckless. Bought just a couple of people. Reduced the price by 75% - began to buy a little. But still it is not enough, there was a lack of public relations, in which I absolutely do not understand.
As they say - the first pancake is lumpy. But in general, over the past six months I have gained invaluable experience, learned a lot from mistakes. Thanks to gamedev for this!
The trailer can be viewed
here .
The page of the game on Desura is
here .
Screenshots -
here and
there .
Thank you for your attention, see you soon!
UPD 1:
Heliki asked to talk about the optimization that I did. So, the most significant work was carried out with graphics. The fact is that initially I did something like this:
public class Graph extends JPanel{ private Timer myTimer;
But this method was extremely slow, I don’t know why. The more correct method used the Canvas class as a component for drawing and the BufferStrategy class for buffering. This lower-level method allowed us to reduce the draw time.
I also made a serious optimization for the class Vec (simple two-dimensional vector). Since I copied most of the physics engine code from the article, each method of the Vec class, be it add, sub, mul, div, normalize, etc. returned a new Vec, which led to the creation of millions of objects of this class. Yes, the code was pretty nice because of the possible chaining, i.e. constructions like were possible
Vec toMove = pos2.sub(pos1).normalize().mul(speed);
As a result, in the later stages of creation, I reduced the number of simultaneously created vectors from one and a half million to thirty thousand (approximately), by re-using already created objects. Although it is not the limit, the result was quite impressive, although not very noticeable to the human eye.