Programmer's diary - how was created Quadrax X              (32000 lines of source code was written.)


Since many have asked me in the e-mails how to create such nice graphics that appeared in QX I've decided that now and then I would upload here a tip on this. However, do not anticipate any complete instructions - they'll be more like general tips how to make the look of your levels nice and real. Also, most of the tips will assume that you already have at least an elementary design feeling and that you can work well in GIMP or Photoshop.

So the tip number 1 is: Shadowing. That's because shadowing can dramatically enhance the look and plasticity of any level! It's needed to take into account the direction of lighting (in Quadrax always from the top-left side under the 45° angle), and create according to this respective shadows, darkening of halls, the light from the torches, etc. In the following picture it's pretty palpably depicted - it's a part of a real level from QN in the process of its creation where there are only walls and their backgrounds so far. If you hover on the picture with a mouse, you'll see the variety using basic shadowing (lighting from sun, darkening of halls and nooks, wall shadows). Therefore, you can easily assess the significant distinction between the first picture (the way it was created in the editor) and its altered look:

Certainly, it still isn't the final variety, walls will be "sculpted" by hand, lights from torches and flames will be added (in the dark hallways which will lighten them). But I think it can be clearly seen that the distinction between the shadowed and "non-shadowed" version is significant. So this is one of the most elementary tips - don't be afraid of shadowing!


I finished all the inspection of code and testing and closed the production version of the game. By this it also ends a small series of developments of Quadrax X. Game development has almost lasted two years - it was hard work, but fun to do! Now it is up to you - to the players, be the judge on how far I managed to work and how much this Quadrax will be worthy successor to its predecessors.


Into the game engine I've added the ability to control movement of the characters not only with the arrow keys, but also by using the keys W, A, S, D. Key to display the audio bar in the level I therefore moved from A to U.


As already mentioned in the news there are only about 10 levels to test and the game will be practically finished. Still, however, the testing still reveals minor bugs in the behavior of certain objects. Most of them are found in non-standard or very rare attempts to manipulate objects, but occasionally an error occur even in situations more or less standard. There are not many of those errors and are not critical, but I still work hard at my best to possible tuning of the game engine. Therefore, even after all levels will be tested, it will take a while to test the engine to ensure that the game will be hassle-free as much as possible and will not be harassed with silly mistakes. Nevertheless, to write a program of approximately thirty thousand lines is not possible without a single error (programmers know), so I will be glad that all players will be lenient and, in the event that any manifest error still hits, so, please, let me know. After all, it is a completely new engine that does not have anything from the previous quadrax versions...


Keyboard ghosting - problems with the keyboard.

Because I had to update, on my main development PC, around twenty years old keyboard for a new, long time I had been looking for the appropriate type. Unfortunately, I did not realize that ideal office keyboard (useful for programming) is not the ideal gaming keyboard, so when I was testing the game I ran into the unpleasant phenomenon called ghosting keyboard. What's going on? Probably it is best explained on the following page:

I repeat and emphasize that it is a hardware keyboard ghosting "error" that that particular keyboard - way electrical connections between the keys - and absolutely it doesn’t matter which operating system you use on your computer!!! (And certainly not even on the program.)

I suggest you check out what kind of ghosting your keyboard suffers - you just need any testing program for the keyboard, for example, Trial PassMark KeyboardTest ( – in this program you can easily determine what combination of the three keys of your keyboard you cannot perform on your keyboard. Even the above mentioned Microsoft's site is a gadget (just under the heading of article) that allows you to test your keyboard. Probably you will find that a combination of the up arrow + left arrow + space (or Down Arrow + Right Arrow + Space) of your keyboard also will not be possible to use... :-/

Is there any solution? Of course - replacing the keyboard with one that has a so-called Anti-ghosting; mostly dedicated gaming keyboard that can register a greater number of keys pressed simultaneously (up from six in the extreme after more than twenty keys). Or use a lot of old keyboard (which still does not have a Windows key), because these old keyboards paradoxically suffer of ghosting far less than the "modern".

So if you are in the game you will encounter a similar problem (of not responding to any third key while pressing and holding some previous two), be aware that it is not the fault games, but it is a keyboard ghosting your specific keyboard and the only way to get rid of it is to use a keyboard that has anti-ghosting, or one that has spanned otherwise ghosting (depends on an array of sensing keys).


As you all surely know, a lot of insects live in the jungle. It is so desirable that in the tropical levels in the game or occasionally something should crawl or flew there. But to make some animations of some bugs isn’t so easy. To synchronize six legs can take you a long to do. Fortunately I managed to find, on the internet, this rather nice animation of the crawling beetle:

Nothing, therefore, prevented me to do animation of it for Quadrax. I cleared out white background of the animation, and then color up the beetle itself properly and foreshadow it. However, as well as with the bats (described below), there was the question of how big the beetle should be in order to see anything. It is probable clear to everyone that if I had to maintain the correct ratio of the size of the beetle and of the characters, so it would not make much sense. One crawling pixel no one would even notice. So, I made several attempts with different sizes of beetle (so you could see his feet) and I finally decided for the right size. It is true that in the real world, such a bug would have measured approximately fifty centimeters ;-) but we're talking about the temples of tests, and there certainly could be found even some enormously large insects, is not it? ;-)


Depending on previous post I continue to improve graphics - and now it is nothing short as dynamic lighting of the characters! What is it? Characters in the level, as well as all other objects are drawn from their source textures that hold all their animation. This texture has its specific color and brightness, so that objects throughout each level are the same colorm and brightness how the source texture. But what bothered me was that when the figures are moving in direct sunlight or in the darkest underground corridor, they always have the same brightness. (Especially in some dark corners of the corridors the figures literally "glowed").

I thought for a long time how I could remove these tiny freckle on the graphic - and I did not come with nothing easier than to make a complete dynamic lighting, depending on the light conditions of their habitat. So now the characters are illuminated by light (shaded shadows) exactly according to current light conditions. I will not make you tired of describing solutions of the programming part - perhaps just a small thing that this achievement is a little more demanding on your computer's performance, since only the actual calculation of dynamic lighting for three characters makes about 432000 (yes, nearly half a million) computing operations per second, but by optimizing the code this should not, when using the current processors and graphics, be a problem. And how it looks like in a reality? Best it is to show you the following images. In the picture below there is one and the same figure in four positions and it is always dynamically lit each scene:

In the cut of the level above it may not be clear enough, so I cut another still image where you see the brightness difference between the figure of the far left and far right:

So now the figures are always illuminated as it corresponds to the lighting conditions. It should be noted, however, that it is actually not a true dynamic lighting (fully 3D), but it is used in the auxiliary "Shadows map" created specifically for every single level. Fortunately, these maps have a minimum size (for all levels set it is less than 1MB), so there is no critical increased amount of graphical data. So this is the dynamic illumination, if you have any questions, ask in the forum.


As I wrote in the news, the graphics are completely "done". But when you browse all levels and assess their graphic qualities sometimes I was not satisfied with my earlier work, and at the same time it came to my mind various other methods and procedures, how to graphically improve the levels. So I decided to implement some of these ideas and so I started again with the episode first

What I did not like was that even if the wall blocks are fine, sometimes variously partially ruined, but still to me the whole scene (despite various shading)) seemed such a "flat". So I decided to try how it would look to make little shading of various blocks of the wall so that it would seem that every stone was in a slightly different depth, or from the perspective of the screen plane being slantways. In principle a very simple addition of tiny shadows on the edges of some blocks I achieved far better plasticity scenes. I liked the result of this little experiment so much that I would modify the entire chapter 1 and 3.

How such adjustment looks in real work you can see in the screenshot in the subsequent cut out of one of the levels of the first episode. When you place your mouse cursor over the image it will display shading added, when you remove the mouse from the picture, you will see the original image without modification. (Note: when you first place your mouse cursor over the image it may take a while before the server loads the second version shown). This way you can merely by moving your mouse cursor over the image, judge the appearance of the two versions:

I think that the second version is much better, because when this is done (reasonably) throughout the level, this is far more plastic and walls more realistically approximate the appearance of thousands of years old temples. Well, so now I'm waiting to perform the changes in the remaining levels (where it makes sense). And it came to me, of course, a lot of other features and enhancements in subsequent episodes, so now I give virtually a 'second round' of the graphic work, where I will check each episode and I will put levels into better shape and appearance.


Today, I will show you how to create some of the graphics for the game. For episode 8, I needed some medieval statues and ruins. On the Web can find lots of different images, but their applicability to Quadrax is slim. At least without proper treatment, which I will describe here now. Suppose we have a picture of the ruins, such as this:

ruin.jpg, 138kB

At first glance such a picture is totally unsuitable for use. Weak contrast of the masonry, totally inappropriate lighting (rear), poor perspective. But don’t doubt it, let's get to work.

First, we need to correct the perspective - this is done easily, deformation tools. Followed by excision of the building from the background, matching perspective discordant parts (cutting the image into several parts and reverse composition with corresponding shifts). Then you need to decide how the image will be oriented, I was given the location of the ruins in the upper right of the level so I decided to mirror the image. Then I increase more the contrast (and reduced saturation) to excel masonry.

Next step and the most complex and time-consuming part - is to produce "false" shadowing of the object to match its location in the level. Using different selection tools and by changing the brightness and contrast of various small portion of the image (window frames, columns, roofs, towers, etc.) lightens or darkens the filter so that it +- match the angles of rays of light defining each level. This is really fiddly job and in the above picture This took me almost three hours to do it. Well, the last that remained was to finish the overall shading walls, fix the various pixel irregularities and fine tune color tones according to your level.

And after this, after a total of about four hours of work, then we have an object that it can be used as a design diversification of the level. Needless to say, these various objects (of course, not always so big) are hundreds in the game, and every picture had to be more or less done what is described above when modifying this building. How looks the result in a level you can see cut from the screenshot of the level here:

ruin_postprocess.jpg, 202kB


I worked hard enough on the basic graphics for an episode 9. I was looking for a suitable image, which would be used as background for cave inside active volcano. After several weeks of searching, I gave up and decided I would use a base picture for episode 2 (underground cave temples) and I would edit it accordingly. As it happened, as you'll soon be able to see in the gallery. However, only the actual color adjustments were not enough for me. I wanted to replace the lake of water at the bottom of the cave with a lake of molten lava. I erased the water and I made the texture of the lava. With the result, I was not happy because static "lava" looked just odd.

So I decided that lava at the bottom of the cave will be animated. Luckily I found on YouTube quite a few guides on how to do it. The trial version of Adobe After Efect (incidentally, another of the programs that I had to learn, well, at least the basics), I made an animated texture of lava. I ran into another problem. Even after a trapezoidal perspective view of the texture it was just "flat" and it did not look good. Thus there came a number of my, yet short experience with Blender and I created the whole animation in 3D in Blender. In the AAE I exported the whole animation of the textures 2048x2048x30Frames as the lossless movie. In Blender, I created a plain square plane, subdivision and I use it to split into about 16641 vertices. As the texture I used the exported video of AAE. With the help of displace modifier I then achieved (after setting the correct values) plasticity of the surface of the lava depending on its "temperature". Then, it was enough to set the camera to the proper position (surface of the lava to have the correct perspective, corresponding to the original lake in a cave) and rendered a final sequence of the thirty images of the animation.

But it wasn’t the last problem. After all, 30 shots is pretty darn low. (More of them could be due to the bulkiness of the resulting texture animation). The movement of the lava was visibly choppy, and when I raised framerate then it was unnaturally fast. I needed the surface of the lava to move slow, quiet and smooth. I studied at YT several dozens of videos with the records of the actual magma and lava, I was able to at least emulate the lava base (rather magma) river. I used then one good old trick alphablending of the single frames. The transition from every single frame of animation to another is not "jump", but by the game engine it is divided into 51 frames of smooth transition from one frame to another (in steps of 16 milliseconds). I got it as though 1530 frames of animation throughout, while maintaining 60 FPS! The result exceeded my expectations and I was finally happy.

So until you get to the last episode QX and you will see at the bottom of the cave lazily roll over lava river, you'll have at least a basic idea of ??how difficult it was to create that animation. ;-)


As already mentioned below, I am still working on animations and I'm learning Blender (not to be confused with Bender from Futurama! ;-)). Given that I think I have learnt a little bit (hopefully) how to work in Blender, I thought it would be a good idea to try to create an animated logo Alfaline, short, like intro at the beginning. Well, I threw myself into that task. However, It was hard! Week I sweated blood and cursed himself for the idea, but eventually I succeeded and the work was done. What remained was only to render the final sequence of full HD images. And here I realized that my development PC is already really outdated, even if five years ago I paid a sinful money for that. The resulting total of rendering primitive 12-second "movie," a mere 360-frame took about 48 hours! It is just 7.5 shots per hour! It was simply very slow. But what the hell. After rendering the movie there came a number of its sound to do. It does not seem, but it is not easy (see below). When it was done, it was only to decide how the resulting "video" 1080p (full HD) will appear in the game. I explored library of standard and non-standard video codecs, but none of them did not suit me, whether due to size, instability, or complex implementations. After many hours of fruitless search, I finally (as many times before), I will write a program, my own, simple and fast MJPEG display module, which will be built directly into the game engine. The only thing I used "foreign" was a library for rapid decompression of the JPEG data using processor instruction sets MMX/SSE/SSE2 (due to the speed at 30FPS at 1920x1080 that is uncompressed data stream to the video about 2Gb / sec!)

Everything was finally done well with flying colors. The video is pretty smooth even on my relatively obsolete PCs (running briskly on my eight-year-old laptop), and memory requirements to play are minimal (sufficient with about 10 megabytes of RAM). Yet it may happen that on some truly historic computers it will mow - however they probably will not run smoothly or even the game itself, which has over twice FPS's than this video (30 vs 60)! ;-)

And how does such a creation of 3D animations look like? I offer you here to see the two screenshots of Blender, the first is the creation of wireframe model inscription Alfaline (that only lfaline because A is formed separately and differently), and the second is to show how it looks, postrendered image composition including filters and effects (the whole animation is composed of three independent scenes, as seen in the figure). After clicking on the pictures they will open in a new window in full size:

blender1.jpg        blender2.jpg

On the next picture you can see a list of audio tracks that are used for creating short 12 sec. background music for the the animated logo:



Given that static graphics for the first three episodes is practically finished, I started working on the animations. First I chose animation of the flying flags (Hindu flag). In Blender program, it is pretty easy, mainly because and thanks to a lot of instructions "how to" on the Internet. What, however, is not an easy task, is to do animation cyclical, ie. So that the last frame of the animation seamlessly followed up on the first one. After many attempts I finally managed it, a flag which actually looks very realistic (well, this animation has over a hundred! animation frames).

Next came a series of revival of underground temples. I really wanted, in the levels, flying bats from time to time. However, the idea to create my own animated bat in Blender, I rejected it right from the start. It would have been very laborious, it would have taken many days, plus my skills in Blender animation on such a complex 3D model are not so far quite enough. Additionally, when I watched some of the existing 3D animation of flying bats, I was surprised how "machine" with the models move and even though the animators, what they did, they certainly have had much more experience,unlike me. So I decided to go the easier route and converting videos bat flying into individual animation frames.

But I still had no idea how difficult it is to find quality video on the Web, where it caught the bat in flight side view (in slow motion). Well, finally I managed it well and I found THIS video that was optimal. Then I just cut out the video on individual video frames, choose ones that were suitable for looping animation, isolated bat from behind, conducted its own painting in realistic colors and shrunk it to a size of appropriate + - dimensional disposition scale game. (Why did I write + -? Because if I had to reduce a bat to the size of the characters to match them on the scale of their size, the bat would have been the size of 1x1 pixel - which, as everyone recognizes, is nonsense.)

Bat animation about 30x30 pixels was ready. However, what followed was the creation of calculation for the simulation of the flight of its travel. As everyone knows, bats fly in a slightly different style then birds and so simple straight "flight" across the screen (which in birds matter in the sky looks naturally) is here out of the question. Eventually I managed to create a function that was more or less trying to simulate the erratic flight of the bat. It is essentially a randomly modulated sine wave with the right choice of random parameters at certain points of the curve, I totaled a realistic view of the flight path. For those interested, I present the complete list of the program, which takes care of the calculation of the flight paths of bats. The source code will open in a new window by clicking HERE. In this example, there are not, of course, any included additional procedures and functions that code calls, such as initialization parameters for the initial flight, etc. variables. In addition, this sample code is comprehensible only to those who are interested in programming, and if they understand mathematics, so it will be clear to them the calculation of methodology. For the others must stay enough that this really provides more less true impression of the flight of bats. ;-)

That's all for today, I'm going to learn Blender, more animations will be needed...


As I wrote in the news, the first three episodes are almost in the final stage of the graphic form. However, this is done, among other things, the amount of supplemental graphics. For these episodes there are in total over a thousand(!!!) unique design elements created! The first three hundreds are trees, plants, grass, vines and other vegetation, the rest are various buildings, statues, vases, bowls, bones, ropes, chains, etc.

However, we are talking only about the static graphic elements. Equally important are animated elements! And here is a major snag. Static graphics, I can cope, but the animation, it's something else. Because I had given up a hope of finding some good graphic designer who would have wanted to collaborate on a game, I decided that I would try creating their own advanced animations. To this end, I installed 3D animation program Blender ( and slowly starting to learn it. Given the complexity of the operation and the incredible complexity of this whole program, however, the development of animations take quite a long time, and there will be not nearly as much as I wanted and how much I imagined when I started to create or develop QX. It is, as for someone already, in Blender, works for some time, it takes an hour, so It takes a several days for me. Creating simple animations takes me much more time than it would take a lot less time for a graphics person who works with the software for many years, and has many years of experience.

However, as I said, I am a graphic designer so I have to do it. To start, I chose a few simple animations, which fortunately exists on the site and a lot of tutorials. So you can look forward to a flag fluttering in the wind, realistic jetting water fountains and lots of other small animations. I hope that, over time, I wil learn Blender enough to create even more sophisticated animations and other episodes of the game. Although it will take time, but I decided I did not want to compromise the graphic design of the game too much, so as it is, I have no choice but to wait. Perhaps it will be worth it!


Yet one thing here is not mentioned, and that is the data size of the game. Unfortunately, the full HD resolution and that each level has its own "drawn" image, takes the form of significant amount of game data. I did some basic simple calculations and interpolation and found out that the whole game will have about 600-700 megabytes Although this takes only 250 megabytes of Music (now with the new format Ogg Vorbis), and the remaining 350 to 450 megabytes graphics takes. (The actual data of the levels and program section can be almost neglected, do not take more than 10 MB) This is mainly because of the reason I do not use the maximum graphics quality for different textures JPEG compression, but I use lossless PNG. And because the graphic base level is composed of three layers (background, semi-background and foreground) despite the fact that the background image is used for the whole episode and pictures of semi-ground and foreground (which are always given for each level ) together have about 3-4 MB for each level. To this there must be added the textures of the frame animation of objects in game screens, etc. (about 100MB). The problem is that PNG is itself a compressed format (and OGG as well), so in preparing of the installation package there is no longer a need to compress these data too. For this reason, the setup file will have almost the same size, which then takes the whole game on your hard disk. And it is those mentioned 600 to 700 megabytes. Of course, when the size of today's hard disks or flashdrives are very big, this size is negligible. The only problem I see is when you download the full installation package when it depends on the stability of the server, so the entire installation will be downloaded fine and fast. As it is, unfortunately, we know exactly that WZ servers, which run these sites, however, offer not neither stability nor speed, so I think I will upload the installation package on some extra other public websites and serveres. ;-) Well, now it is probably a bit premature to talk about the installation, though nearly a year after the commencement of works the game is not even in the middle of development...


As already mentioned, Quadrax X will include, as well as the original Quadrax 1, teleports of stones. But compared to their original designs they will have a new and vital function in addition - entrance teleport blocks can be swithed off / on using the lever / platform. This allows to build even more interesting and more complex levels, with interesting functionality. Everyone who finished the QVIII may remember it in the level called "Megatromatron". Well, the version ten they will be something similar, but a little bit insane. Now, given the possibility of switching on and off teleporters, they can track movements of Stones branch (or merge), so this may be, due to the level Megatromatron, really interesting. A because I think the general principle of the whole "machine" will not be able to be revealed, even if that person knew exactly what each platform for the operation and what are the links between objects and teleports, I decided here to publish entire final draft special level to the maximum extent, which shows the QX engine options, especially with its many technical objects:

Clicking on the image will be displayed in full size in a new window megatromatron.jpg, 165kB

Nice, is not it? ;-) Of course, none of the players need to be alarmed by the huge numbers of platforms, etc. because 99.9% of links between objects only ensures correct and synchronous action on the Megatromatronu so that all objects were always in motion and so there is always something happening. Observant, you will notice that the role of players will only be to fill the container opening machine with blocks (right combination) and after filling the whole tray full, Megatromatron will start automatically. Whether they will run properly for a long time and it depends only on whether the player selects the correct input combination of them (hint may help).

Yet I must say that the entire design and testing id Megatromatronu lasted about 16 hours of pure time until all sections work as intended and no part of the level doesn’t jam one of the mechanisms by the collision blocks (eg two blocks at once on a belt, etc.). I believe that the current player spends at this level far less time than I spent when creating this level (It's really not as complicated as it sounds). Once it reveals the functional dependence of the input section of the operation of the entire machine, the final solution is only a matter of time, ie. to wait until the entire Megatromatron performs its entire work cycle. Of course, if in the course of work machine in some of its parts "hangs" or doesn’t make it to the end, it was only poorly chosen combinations of input blocks... ;-)


So finally (I kept this in mind for a long time) I built and implemented the panel to adjust the volume of audio - or adjust the volume of music and sound effects. As in previous versions it is not accessible directly from the menu, but it can be called out only when playing level by pressing the "A" (as Audio). However, unlike the previous versions this control panel is fully controllable with the mouse ;-), so both traction "potentiometers" shuffles the volume up and down using the mouse. The volume level after closing panel (either by pressing "A" or by pressing Escape) automatically saves and is valid for the whole game (also for the main game menu, etc.) Given that not everyone can be satisfied with my chosen mixes of tracks for individual episodes, or they might be unlikable in the weeks and months spent in one episode (although QX will contain a total of over 4 hours of music and one loop for the episode has an average of 25 minutes), so there is obviously the possibility to turn down the music volume in the game on minimum and let you play whatever music is on your PC that you "like" when playing the game. ;-)


Since I worked on the construction and testing levels for episode 5 lately, which takes place in an old underground factory and given that I've implemented some of the most successful points of the original game 1 to the levels (of course, modified and adapted to the environment QX), I felt I needed a switch for switching only between two characters. (Some of these levels are in fact only two characters in the levels, while the third character is a solo resolves it resolves separate part of the level). That's why I programmed it to the test version and seemed to me so useful that it will be in sharp version of the game. Compared to the original "switch mode" from previous Quadrax but its operation is simplified and controlled with only one single key "Q". Moreover, after the experience of the turmoil in previous works, this switch is at the start or restart of the level always off by default. But if you turn it on and save the game into a saveslot, so when you load from the saveslot this switch will be exactly in the same state as it was in play before saving.

I also implanted into the game an equivalent of "Shift push mode" from the previous Q, except this time, this feature is tied to the Ctrl key, which is more accessible for both right and left hand. This mode, where characters can only push the block with the pressed (left or right) Ctrl turns on and off simply by pressing the left and right Ctrl.

Of course, that both the "Ctrl push mode" as well as "Tab mode" are indicated at the heart of the animation at the bottom in the right corner. I hope these functionalities come thrives especially to those who have used to them in previous Quadraxes and in this version they would obviously missed it.


All the major bugs are hopefully fixed. While programming, I also improved and refined statistics logging of the levels to match more data of the real gameplay. But mainly I wrote a simple program that can do the necessary datasets User Accounts games packed into one compressed file and save it to disk. There is no need to look for the files (QX data of user accounts in multiple files) in the directories of the game - simply run this little program and that will process the files (compress into one archive, because thanks to extensive statistical data levels the files are quite large) and a user will be offered to save this compressed archive anywhere on your disk (by default, the folder "My Documents" folder of the current Windows user). To send the file then simply attach classically as an attachment to email and that's it. Simple, three mouse clicks. Together with the treatment of problems with UAC you will send data much more comfortable than in previous Quadrax versions. Thus, of course, if the player will want to send their results and have them write to the table of players... ;-)


Full force after the holiday, I began to generate more and more levels. I started designing the levels for episode 5, which takes place in an old factory (technical levels, as in QVIII). But oh! Once I started to really test the different interactions between objects, one bug after another started to jump on me, like little devils out of the box. Bugs were logical (ie those that do not lead to the downfall of the program, but they caused incorrect behavior of some objects). The errors were related to explosive and magnetic blocks and their interactions. Given that in previous quadrax these errors were not completely removed, I began to "hunt for logical errors".

To explain a little about what they are, it is necessary to show you a little demonstration. Suppose we have two elevators next to each other, which are vertically distant one logical cube. In both of these lifts there is explosive (or magnetic) block and elevators are still standing. Now what is happening that the two elevators start moving (eg. Switching lever / platform that controls both elevators) - in a mutually opposite directions. In the following two pictures you clearly see what I mean.In the first one the lifts are standing and arrows indicate the future direction of movement after switching on, in the other picture the lifts are exactly in a halfway of one logical cube (grid). (For greater clarity in the pictures there is translucently displayed the screen pattern of the logical grid.)

priklad_vytahy_1.png, 32kB                  priklad_vytahy_2.png, 32kB

It is clear that both the explosive stones are indeed precisely next to each other, but the elevators are not aligned to a logical grid. Of course, if it were the only explosive blocks, there would be nothing easier than to have them explode in this position and lifts would then continued its journey away empty. Vastly different situation happens, however, in the case of magnetic blocks. If they got magnetized exact in the moment what is shown in the second picture, elevators would remain "stuck" off the grid, and logical figures or other stones would be failing on their roof. Even if the engine was made so that the roof get/capture was (or magnetic could magnetised and stop the other, which is outside of raster) a logical concept of the Quadrax would not make sense - it would no longer be "quadratic". The issue is not just about the interaction of the two blocks in passing by the elevators, but a lot of other things. Randomly (always in the terms of the interaction of explosive or magnetic):
  • Lift with the stone goes up/down and next to it another stone of the same type falls,
  • crane lifts a stone, while another next to it falls,
  • crane lifts a stone and beside the lift another elevator goes down with the same type of stone,
  • etc.
There is a lot of possible combinations, where blocks are side by side, where they have to respond to each other (magnetism, explosion ). And the vast majority of these blocks are not in the exact position of the logical grid. In older quadrax versions this worked quite imperfect and certainly many of you have experienced a situation where two explosive or magnetic blocks "passed" each other without respond. For example, yesterday Dušan wrote me an email on the subject. As if he knew I had been solving this problem intensively for a few days... ;-)

The only meaningful-effective solution in order to avoid the facts outlined above (ie. To avoid passing blocks without their logical reaction, and so that the reaction does not occur beside the logical network), it had to write a lot of new code that tries to deal with similar situations. Basically, the point is that if the lift / crane is carrying explosive or magnetic block it must be constantly "looking" around (or just to the left and to the right of the vertical track of stone), if there is (not run in the elevator, crane, and so on.) another block, which would react with it, which is currently carried/borne. If such a stone detects and calculates that it would respond with the stones occurred outside the logical grid, it will adjust the behavior of the actual lift or crane, and also will set the secondary object information that awaits him interacting with another stone. All this sophisticated prediction system then ensures that the mutual response with the stones were exactly in alignment within the logical grid of the game.

If I use image example above, after turning the lever of one of the elevators (before the start), that in assessing the interaction which comes into play as the first, it will be found that in addition to the riding an elevator with the same stone meets the stones next to each other at that point where they are outside the logical grid. Simply another lift is temporarily "banned the ride" for 500ms (so it takes the elevator to travel one logical cube), and then without worrying issue a direction of its movement, knowing that the second lift is forced to wait. Similarly, (just a little more difficult) is it dealt with the falling rocks, cranes and so on.

I've spent incredibly time developing and tuning of these control algorithms. But perhaps I have taken up all possible cases and combinations that may occur in the game engine. But this will be verified by time and then the players. I hope everything will be OK, but - if it happens that two stones just do not respond, it will be in 99% of cases in their vertical opposition movement - just a situation where a new prediction algorithm failed and didn’t postpone one of the stones in time so that the other could pass just beside him...


In respect of the debate here on the forum I decided to implement the feature of the characters in the game that at one point on the tightrope only one character can stand, and the other characters can not pass him on a rope. Though I thought it would be a simple implementation, but the opposite was true. To third modification of the code finally worked out the way I imagined. What followed was retesting all the current levels, where the ropes are, by me and the tester. So far it seems that the implementation of this new option was fine and it did introduce no errors in the code. Taking into account that the levels of ropes further in the game are fairly common (thanks to all the rules applicable, the ropes enable in these levels yet unseen and unique points) and secondly thorough testing is necessary and then everything is thus going to be tested in the actual development of the levels followed by testing. But I say sincerely that you should look forward to and I certainly think that a lot of player will curse me for that ;-).


Since Quadrax X will store much more information about the game (and the player) on solving individual levels than all the previous versions together, it would be very difficult to send user’s files and large data-sets. For easier sending of information I wrote a simple program (utility) that will do most of these things itself for you. After starting that utility it will simply and automatically wrap and write all the user files into one package and then store it on the disk where the user selects (default will offer you the folder "documents" of the user). This file is then sent to me by email (as before). Users will therefore no longer have to search in folders, search for files and game data, all the job will be done by the program itself. It's another one of more pleasurable user works with the game for those who send their data with the records.


Implementation of security features and protocols progress as expected, it seems that everything takes less time than I had originally thought. At the same time I am working on a slight modification of the game data - for example, I extended the statistics of individual levels. Now I include an indication of how many times a given level was run overall and how many startups (or reboot - restart is taken as a new start of a level) of level were needed to solve the first time of a level. Together with other statistical information about the steps and times in the level it will be very easy for me to determine whether a player cheat - if you're at a really hard level eg. Number of starts is significantly lower than the average of the other players (in extreme cases, for example, only one startup level, and immediate successful resolution) will be abundantly clear that the level of either one was played with some help (whether from another player, or anywhere else detected), or you can "play the level over and over" elsewhere (on another PC and so on. ). This will also apply in the event that someone is playing under two user accounts, one "training" and other "sharp". Such cases will solve individual transportation.

How will I deal with these conflicting data still I do not know. It is clear that the obvious fraud apparently not following the date of the players not to publish, in doubt for individual levels will depend on several factors and communication with the player.

With the above it also relates unfortunately that Quadrax X will not be able to simply play "parallel " one player on multiple computers at the same time (you will not be able to copy the data of the game or just some of its files to transfer of copy to another PC). If someone wants to play like this, it's certainly possible - but will have to play on both computers, and what he plays on one PC, he will have to play on the other. When sending records to me this fact will have to be mentioned, and will have to send two sets of user data (from both PCs).

Perhaps all this may seem too restrictive to someone - but if you're an honest player, it will be no problem for you. Just play under one account-based (don’t make any "training" account) and you're done. The only restriction is the above mentioned installed game on two PCs and the need to play the level on both computers.

All these things are designed to ensure that the overall results of the players were as much as possible honest and fair. All the guys who are around this gamef or some time know that in the past it has happened quite in a few cases where the results of any of the players were not achieved completely "clean way". So perhaps these above-mentioned method avoids the worst excesses and fraud in the results.


Now something of a paranoid corner. Considering the facts that what has recently happened, I decided to implement to the test versions a large number of security controls and protections. Whether it's a limited number of running the program, bind to a specific PC, or other security mechanisms (which of course I will not reveal here) and probably the main and most important thing for the new test version is that it will not work without an online connection to the game or server. The test version will, in fact, be able to send the data over the Internet to the server about the main activities of what a particular game tester does directly. Mainly activities such as logging in or running or exiting the game, start, restart, or termination level, and in the case of successful completion of a level and also the time and steps will be sent in to the server. All these logs (with time stamp) are stored in a database and will help me to to see what is happening. As soon as an Internet connection is not available, or while playing games "falls connection", the game automatically ends. (The fact that these things'll also be able to easily trace in the database - for example, when the running game is logged in, but if there will be no record of it being paired off, it will be clear that in the course of playing the game the internet connection has been disconnected ).

Thus I have a pretty good overview of all activities of Tester/account in the game. And not only me. Simple table with individual logins of the tester will be publicly accessible to all players directly on the site. (Of course, without displaying the steps and times at levels and other sensitive data). So everyone will be able to see how the tester is currently successful.

Another advantage of online communication of the games with the server is that if I have any doubts about the activities of Tester I'll be able to remotely "block" the specific game - if the game when, after its launch and connected to the server finds blocking entry for this copy, it will be automatically terminated with an appropriate message. Etc., Etc...

Why is this text here, in the journal developers and not in the news? Well, because I have to learn C++, how to handle the https protocol and a lot of other things with which I do not have a lot of C++ experience, too. It will therefore take some time before the new test version will be ready. Before all the planned controls and protection mechanisms are implemented into the game, and before I test it properly, it will take about a month.

You think that it is useless? I previously thought and also relied on trust. However, from the naive view of the world I've been healed and I want to have oversight on what and where specific test version just does... Of course, all these things will only be in the test version - sharp version of the game will not be anything like that (I hope), it will not need it and will work exactly as the same as any previous versions of Quadraxes.


The time has come to dedicate a little bit of the sound of the game. That's the place where the big changes haven’t been made yet at least. And neither was much of need. Most of the sounds don’t need to be changed, but they have not been adjusted to synchronize with different speed of moving objects in a new engine. But still there are some changes. For example, the steps of figures when walking will sound differently depending on the surface, on which the character walks. On the rocks / walls they are classic steps, as everyone knows. But, for example, while walking on a tightrope (one of the new things in new QX) soles clacking would sound strange. And so it was necessary to create some new samples for walking on different surfaces. Of course there are new sounds for new objects (such as teleports for stones, etc.).

But perhaps the biggest change is the basic sounds (steps switching levers, platforms, etc.) will be modified depending on where and what level will take place. So, in levels "outdoor" the sounds will sound the same, to which all we are accustomed to, but for example the levels taking place in a giant cave / basement / big deserted halls, etc. the sounds will echo according to the environment. I believe that it will boost (besides the well-chosen music) the right atmosphere in the episode.

Also, there is ongoing tuning work on the engine - catching bugs here and there and sometimes I am adding a new feature (for example, an option to run only one instance of a program, etc.). They are just small and minor modifications and corrections that on the resulting code size it will have only a little effect. The main debugging and error trapping will begin after starting to test levels. And I almost forgot - I added one important characteristic behavior of moving characters, which is more consistent with realism - and that figure on the ladder can not "climb" one another. Thus, if a character climbs the ladder and the other character is behind the first one, the second one must wait nicely, than the first character gets off of the ladder.


Today, some of the programmer info - statisticaly.

Since the whole program is almost finished and I will only tune up the small things, I tried to do a little statistics such as how the little program looks like. So the source code of this game contains the following information:

  • The number of rows - 24245
  • The number of characters - 987852
  • The number of conditions "if" - 2932
  • The number of cycles "for" - 509
  • The number of conditions "switch" - 38
  • The number of functions and methods - 121

However, this info will only be understood by those who are a little interested in programming - those of you who can envision the whole picture...

To others, the only important information it is that the engine of the game is done and now I can finally start working on Levels, graphics, music and other "pettinesses". Of course, in the developer's diary you will continue to read more info about how the game is being developed...


All the necessary functions for saving and loading game are created. Due to the fact that I cleverly, in advance, designed data structure (I reckoned it beforehand - and not to do it during the creating of the game as I did it and struggled in QIV), it was a total piece of cake. Engine of the game is thus almost finished and now I can finally start to create the levels and, of course, I will also begin testing, which I hope It will be more thorough at this time than it was in QVIII. ;-)


Something about graphics or how to create graphical levels of the game.

Graphical displaying of levels in QX is completely different in previous works. Each level is essentially composed of several layers, which are sequentially stacked over each other on the screen, into a final image. The overall picture is formed by nine layers:
  1. Moving (active) dynamic background (e.g. sky in the demo level).
  2. Fixed static background.
  3. Buildings in the background level. (Stone masonry, rock, etc.).
  4. Buildings - ie what he is going.
  5. Movable walls, trap cellars, etc.
  6. Level objects (i.e. all active objects such as characters, walkthroughs, blocks, levers, etc..). Individual objects are rendered in that order so that their bilateral overlapping was logical, ie the first, passages are rendered, then all the blocks and then all levers -so that they be visible (there are, obviously, more rules for the drawing order of objects.)
  7. Overlay walls ( new in QX) such as sliding bars etc..
  8. Efect layer (again new in QX, wait for it).
  9. Displaying layer of the help menu, info panels, etc..
All this has to be folded into a single image in less than five milliseconds - of which it is clear that the graphics card that is in charge of, will certainly not idle in QX. QX works in the 3D mode, and each of the layers are virtually the textures, which are with the usage of alphablendingu, folded over themselves. Orthographic mode of viewing scene is used, so everything works nicely alltogether.

But what is needed to draw so that the level looked as good as the sample in the gallerythe gallery? For each episode (ie 10 episodes) it is necessary to create images of layers 1 and 2. That's the easiest part. Layers 6-9 are automatically created by the game engine and they are taking the images (sprites) from textures of objects that are common for the whole game. So, here also, we do not have to worry about the picture of the level itself. (Of course, all of the objects I had to draw first and possibly scetch in detail, including animated sprites such as the movement of the character as described in the diary of 26 January 2014 below.) But the uniqueness of each level in the episode is given by layers 3 to 5 We can say that layers 4 and 5 are formed as one, and only when the level is loading, the engine will "select" required texture of moving walls into separate layers No.5. So we got to the point that for each level you need to create essentially two layers. Layer of background structures (3) and layer of structures themselves (4 +5, to simplify it I will continue to call it only layer 4 - including sliding walls and trap cellars).

Editor of levels in the game has a simple graphical system (editor) for the initial formation of the fourth layer. It Includes the supply of basic building blocks (square, rectangular, rounded or beveled differently, etc..) in all colors and material variations that are used in the game. To be exact, it's about three and a half thousand basic building blocks, which I had to draw ( a lot of them still waiting for me to be drawn). Simply, with the use of the mouse, all the required walls, doors, etc. will be "clicked in". That's all what picture editor in the game allows. But it is not a lot! And here the advanced graphics programs like Photoshop or Gimp come into play. The generated image of a layer for a given level will be opened by editor in some of these programs and painstaking work will begin. All the other static images (statues, large stone structures, vessels and other small objects such as bones, etc., vines, trees, etc.) will be added into the layer. At the same time, you can adjust the very form of stone walls - some blocks can be moved, rotated, corners and cracks can be added, etc. It is also possible to finish some shadows cast by objects on the wall, to increase the level of plasticity of action - in the example in the gallery of statues, shadows are in the foreground of the temple on the left, and the shadows of a big tree and the statue on the right.

At the same time, however, it is needed to work on layer No. 3. Where we do not want to see any basic background (ie layer 1 +2), in "corridors", we will create a variety of masonry, rocks, etc. We also carry out proper shading, according to the position of the wall (layer 4 )so that the corners turn darker ap. We will further illuminate the wall spots where the torches will be placed, fire burning or where the walls illuminate Daylight - again to increase the realism of appearance. This layer we create under the layer 4 that will be overlap by in the game. Well, after a few hours the layers are completed, we save them as PNG images into the appropriate directory of the game, where from they are loaded when the game needs them.

Because I discovered during development that it is unnecessary for engine to compose the layers 2, 3 and 4 in each image (i.e. every 16ms) (as they in no way alter the course of the game) I modified the engine the way so that before the level starts to load the engine will read these three layers and will mix them together into a single one, which then renders in a single step. This a "temporary" created layer the game saves on a disk, in case of level rebooting (or turn off and turn on the game and playing the same level), then the engine doesn't need to re-mix layers again. I will just add that to mix these layers, the graphics card isn't needed to be used, because I use my own calculation function. To calculate alphablending of each pixel I usi classical computing function whose principle is generally known and anyone who is interested in the computer graphics calculating a little bit will not be surprised. In shorthand logging it is:

So, it would be in short everything about to how a picture of one level is being created. I will just add that while the very structure of the initial level and creating the 4th layer I was done in about an hour (it is the first level in the game, so it's really very simple), so for the final graphical form of layers 3 and 4, it took me about ten hours! I realize that it's a little disparity - the players will need a few minutes (2-3 minutes) to solve the level and they will probable have no time to appreciate my many hours of work on the graphics design of the level. :-/ The above is also related to the fact that we all have to realize (especially those individuals who still says: "When will it be done and what on earth is it taking so long?"), how the game is challenging and time consuming to create. And, it is the easiest level in the game! When you consider that to make up the enigma in the level and create the structures in more difficult levels takes at least 5-10 hours per level (not counting time for testing!) and then I will add next 10 to 15 hours of the creation of the graphic design level, based to an average of + - 20 hours of work for one level. As I devote all my free time to Quadrax, but even so, let's say I'm working on it every day (including Saturdays and Sundays) for about 5 hours a day, so by a simple calculation we get about 400 days needed to create all the levels. This is all without testing, and modifications... Well, I do not even count in all the time for creating and programming the game engine, creating music and sounds, making up a story and journal writing and a lot of other different things, what must be done for the game.

So, do you still think that it is easy to create such a simple game? ;-)


Well, I successfully created the test demo and it looks like that nobody found any serious engine fault or errors in the game. This is good. But I have to work intensively on, to create the test version as soon as possible so that I could finally start to test individual levels. Then it comes right ordeal with the creation of levels and tweaking and testing.

So I started to work on the system user accounts. Its operation will be exactly the same as in the previous Quadrax as I have found nothing wrong with. However, what is, of course, a completely new is the inner work program with user data. I decided that not only user's basic data will be saves as....... the best action / time, but also each user account will have detailed statistics. So what data will the user's account contain? Here they are neatly sorted.

User account will contain information about:
  • the best (record) steps / time in each level,
  • steps and time level achieved in the first successful solution of a particular level,
  • all the steps and time spent in a given level than the level for the first time successfully resolved,
  • absolutely all the steps and the time spent in a given level (ie after solving - the subsequent improvement steps)
  • the sum of all the best steps and time resolved levels,
  • absolute sum of all the steps made in the game.
These statistics will be obviously visible to the user himself - for the best results in the game, move your mouse to the row level, the cursor appears at the window with detailed statistics of the level. The player will have a pretty good summary, which level gave him hard time and took him the most time before it was solved, or which one is his favorite when getting better scores, etc.

Of course, the structure of the user's data is slightly inflated in order to store all this data. But it is fortunately not tragic, it is only a few kilobytes of memory and disk space. Yet it is questionable whether these data should also be appearing on the record here on the site - I'll think about it yet whether (and how) to implement it to the game... ;-)


Uff, it was crazy. Previous fourteen days I dedicated perhaps more time to this game than is healthy. Every day I slept as much as maximum of 4-6 hours, and all of my free time I completely dedicated to creating animations of the characters. But we can say that it was not vain effort. I have almost finished almost all the animations for the character (not just one). The final count makes the total number of animation sprites more than 1200 !! Yes, you read correctly, the individual animation frames is much more than a thousand! Who does not believe in it has the possibility to calculate the various sprites in the picture below... ;-) To give here the whole bitmap animation of its size (2048x2048px) would not be a good idea, so here is at least a copy reduced to about 33% of its original size. It is true that there is not much to see, because after the reduction of the characters, the characters become real dwarfs, but the idea of the comprehensiveness of a number of animations that's enough. Feast your eyes here:

There are really enough sprites, don't you think? ;-) Moreover, this time the movements to the left and right are "logically correct". To explain it- in Quadrax III - VIII, the animations of the characters to the left were done by simply rotating the mirror animations to move to the right. Very easy it was to get to know the illogicality of carrying the bag on the side of the characters - bag was still visible, as if the character was switching from the right side to the left. ;-) In the Quadrax X, the side animations are created separately - so when the figure goes to the right, the bag is on the right side (and it is visible) but when the figure goes to the left, it is now all correct (the bag is still on the right side), so shading of the character is completely responsible. All this was possible mainly because all the animation I first created in 3D and that if the animation will be moved to the left / right, then I could simply switch the camera view of the character and generate a single bitmap animation.

Animations of the figure is such a huge number especially because they are almost all of them created to 60fps - for one second of animation the 60 files had to be created. Only some of the less important animations in which the character does not move from the place (rotation figures, etc..) have "only" 30fps... ;-) Now what remains is to finish some animations of various characters when they are dead, and recolor the shirt of the other characters with two other colors. When this is done, the hardest graphics work will be done.


As the base engine is almost done (regarding the ability to play a level - it still yet lacks a lot of things), it was necessary to get down to the actual graphics of the game. And I started just with the most basic (and also with the most difficult), it is the formation of character animation. Initially I thought that the animation would perform the same as in QIII - that I will take a video of myself, and of the resulting video I will make individual frames for the animation. Unfortunately it was not possible for many reasons - among others, especially for large game framerate (60fps vs 24 fps cameras). For a moment I hesitated what to do, but I finally took courage and decided to do all the movements of the characters using computer animation (CGI). I have downloaded several programs to animate the realistic human figures and tried them all. Well, I finally chose one of them and began to teach myself in it. Since I had absolutely no experience of working in 3D animation programs, it was a little labor from the beginning. Not much helped the guide of the program because it has over a thousand (!) pages - than it would be the next year if I studied it all. But with the test/mistake attempt I finally learnt all the basic functions of the program and I could start with the animation.

The beginning was very difficult - I created the characters which moved in any way other way than the way I wanted. Their movement resembled as the best the movement of the lurching zombies, and as worst the figure looked as if it had to go to the bathroom. But eventually I managed to figure it out somehow, even though I'm not completely satisfied with the result, it's probably better than nothing. To hire animators from Pixar, I need a few million dollars, so everything has to be done by myself. ;-) In the following picture you can see the animation character set for normal walking to the right. It is designed for playback 60 fps, it means that every single image animation in the game takes only 0.016 s! (Sixteen milliseconds!)

From the picture above only a few people can imagine how the animation looks in reality. And because I'm a good guy off the bone, I spent a couple of hours and prepared animated GIF that at least approximately shows the cycle of animation. The actual figure below may not show the animation in real speed (as GIF format doesn't know the exact timing) and according to the browser, the actual movement can be slow or snatchy :-(... So the promised figure animation of the ordinary characters walking to the right in Quadrax X is:

Well, then perhaps it is not so bad, right? In the real speed it looks like a total natural movement. The fact that I have worked with a 3D animation program for about 14 days, it is not so bad.;-)


Editor's almost done. It has already everything needed for creating individual levels, placement and manipulation of objects including setting their parameters and connecting lines activated objects. Also, it's done about 80% of all functions ensuring the logic behavior of individual objects, so now the testing phase of the editor and its functions begins - it means, whether how the objects react to each other as they should, if somewhere there is illogical / erroneous behavior of objects, etc.. This will be the paintaking work, I always think of all possible combinations of objects and situations that may occur and then in the editor if everything is behaving as it should. In the following picture you can see one such test level. (Do not look for any sense! This level is used only to test the behavior of objects). Clicking on this image will cause to open the picturein a new window / tab in full resolution:

editor.jpg, 47kB

Note - you will have noticed that the graphical presentation of some object is rather simple - it is understandable that these objects have not yet created any layout and so they are currently represented with only one-color mask of their shape. some of you will even notice that some objects are created temporarily by simply increasing the prequel of QVIII 30% (figures, some blocks, etc..). I need to start really work hard on the graphics of the game...


Because even the best program without graphics is just a program that processes some data, it is now necessary to work just a little bit on graphics. As I cannot use almost anything from the previous game versions of Quadrax I have no choice but just to do it all over again. Of course, that certain characteristics of the buildings remain, and sometimes the object will look a lot like in the previous episode, even if it is brand new. Everything will hopefully be clear from the following examples, including video demonstrations and comparisons. Given that in the old Quadrax one logical "sector" is a square with a side length 20px and in QX it is 30px, all objectsin QX are about 33% larger, and thus they can be much more detailed. As an example, we will bring the creation of a new graphic design of the passage, which the original dimensions was 3x3 squares logical (it is 60x60 pixels 3600px total) and the new one also has 3x3 squares, but graphically it is 90x90px (it means 8100px, more than 2x larger area!). In the following picture you can compare the original stone passage from previous (left) and newly drawn passage:

Srovnání grafiky průchodů

Not much difference, someone may say, but from the magnification of both images it is clear that the original passage only remained a model for the distribution of natural stone (for graphics - a modified interpolated mask "mortar"has only been used between the stones), but the texture itself of the stones and interior corridors are brand new. You can compare it in the picture below, where both passages are compared to the same size and enlarged to 200%:

Srovnání grafiky průchodů, 200%

Here you can clearly recognize that the new graphics is far finer and more detailed than the old one. And thus everything must be recreated again. Stones, elevators, cranes, etc, etc...


Development of an editor continues without any problems. And at the same time (for testing objects created by an editor) it was necessary to begin to form the core of the game. Due to the fact that everything is written entirely in new code, the new code will not be such a conglomerate as before. We can say that the basic core is simple primitive loop, gradually calling for all needed functions - it means, the first function which take care about logic behavior of objects and then when everything is calculated, the calling for graphics routines to render the entire scene, it is dynamic background, static and background objects themselves. If someone is really interested in how such a little piece of the code looks that is called by a core which in this case takes cars about logic and calculates the motion of sliding walls (one of the basic elements Quadrax) and a sample function that ensures the movement of the wall appears after clicking the link HERE. Of course, it's just one small example of function and there are not subsequent function displayed ( test, read and write the graph, which is used in it) that this function calls (it would not be the demonstration of about 500 lines, ;-) but a little more). Such functions, as in the example above, the code of the game, of course, we can say that every kind of active object (be it stone, lever hoist, crane, etc.). has such its function, which ensures the correct behavior in the Quadrax environment. A separate chapter are then functions to move the characters and test their interactions with other objects. These are not yet written, nor even because there is no character animation, which is probably the most demanding graphics work that awaits me.


So, it was enough speaking of graphicsfor today. Development editor is being created successfully, but for its testing it was required to begin to form some of the graphics objects. At first, of course, I began what is the most important in this game and thus it is blocks (blocks). I do not want to show you here, however, ordinary stones, but I will sharethe work of one of the basic animations. The entire game, despite running in 3D graphics mode, it is still a classic 2D. This means that all animations are made up of various, successive images (called sprites). It's the same principle as the classic animated film - frame by frame varies sprite (picture) animation and as a result it is the impression of continuous movement / change the subject.

Some people have no idea what is behind even so small and "unimportant" work as animations and the disintegration of fragile stone which in the game it takes less than a second. So how does such a fragile stone disintegration animation in a graphics editor (Note - For all the work with graphics I use freeware programs such as Gimp, Blender, etc.). Occur? Let's go through some steps:
  • The first, as a model already a formed stone is chosen.
  • Then, I draw up "cracks"in it and edge of the cracks are modified with some of the emboss effect, etc.. This provides a basic sprite brittle stone that will be displayed in the game.
  • It is necessary to make up and propose how actually the rock and its parts will crumble and collapse.
  • Once the stone is roughly divided into twenty parts (layers), depending on what pieces are going to fall apart.
  • We'll have sixteen copies of the previous point to 16 frames of animation - this will be total of 320 layers (components) in sixteen groups in which we must confess.
  • And now comes the most difficult and lengthiest part - in each frame of the animation we must gradually rotate / move each of the 20 divisions so that it will ultimately give it the impression of continuous movement.
  • This is the same principle as used in stop-motion animation. Always check the next and previous frame animation, whether to follow each other nicely.
  • When the animation collapse individual sections of stone, of course, we must not forget umazávat overlapping of pieces.
  • In the advanced stage of disintegration of the stone also draw in large crumbling pieces of the emerging cracks and eventually piece is divided into two more layers and then animate each separately.
  • When it is done, yet we tune the last phase of decay by reducing and cracking the last left remains of stone pieces.
  • In the final, then we have a project with about 400 layers - each of them is one of the pieces of the original stone, animated to give the impression of smooth stone disintegration and collapse.
  • All layers are merged into one - you need to keep checking alphablending and edge antialiasing so that everything was OK.
  • At the end we have one picture that is used as a bitmap resource for the game engine, which if necessary the disintegration of the stone, the animation will start.
In the subsequent picture you can see the result of the entire work described above:

Animace rozpadajícícího se kamene

In the game the animation, as I mentioned, takes less than a second. But to create the animation, it took several hours of hard work. And it is only one single animation in the game there, where there are of course several hundred other ones. So now you possibly can imagine how these things are time consuming to create, and why Quadrax X can not be done in a moment... ;-) And I have not even mentioned a trifle that even this animation has to have several color variants (moss-covered rock, etc..) But they arebasically taken from this source animation.


The development of the engine is successful so far, to learn to work with (in) D3DX was relatively easy and except a few small hiccups everything was OK. The basic skeleton of the program, providing display graphics, event handling mouse and keyboard etc.., is almost finished. Yet it is just a tiny piece of the final code, in which the whole quadrax itself must be writen. Of course that I wish I could start to program the core of the game, but there is a lot of tedious but necessary work that has to be done first. Above all, it is the design of all data structures needed for the game. A long time ago I thought up the original data structures for Quadrax III very well, because practically they survived without any change from Quadrax version 3 to version 8. But in Quadrax 10 everything will be different, and so it needs the new, robust, data formats. Fortunately, the amount of information about objects in the games isn't extra large (but isn't small either!), So that the structures will not take so much time.

But what takes a lot of time, is the editor. Original editor in previous works was such a virtue of necessity and it was not, frankly, the best piece of software. New editor for QX will be completely different, far more pleasant to use and mainly work with objects - each object placed on the board will give chance to freely move, change all the attributes and so on. The formation of the basic "wall" will be a little easier and more user friendly. So the priority is now to program the robust, functional and well-to- use editor, which will be easy to create levels with for the game. After that the actual game engine will be created which will work with the objects and that it will only be the core of the game and whose development takes about the longest period of time (beyond making graphics).

Beside the work on editor I have done the basic navigation between different aspects of the game, programmed displaying the diary and created graphics for it. The finished diary, with the first page of the story, you can see in the gallery.


Here will be given the technical details of game development and writing program source code, as well as code samples and examples of graphics. Since I decided to program code of the game completely again, it was necessary to find the appropriate development environment. Historical "Microsoft Developer Studio 97", which was the development of all previous Quadrax, of course, fall into the reasoning and the gentle twists and turns for a little money I bought Microsoft Visual Studio 2008. True, there's also the very newest version, but it allows the development program for the current operating system with support for multi-core processors and so on.

So how will the game after the program look like? It will be, of course, written in C++ language with the fact that all procedures will be used by the graphics library D3D9 and the game will run in "3D mode". Thus the vast majority of work with graphics will be provided by the graphics card and processor will have enough time for the game logic calculations. Someone may laugh over what this, advanced game logic and game engine such "primitive" game needs, but you need to think about several things. The game will run at 60fps. This means that the program that reads the complete calculation of the conflicts and interactions among all the objects in the game in everu game sequence has only about 15 milliseconds. In these fifteen milliseconds game engine must therefore make a lot of calculations of potential collisions and interactions among all the active objects in the games, calculate their new status, position on the screen, graphical features and styles and then, until everything is ready, take it to the graphics card, which still have to do everything correctly to save backbuffer before the video memory refresh is performed (flip). The program must also operate the audio subsystem in between games, start and stop in sync samples, adjust their volume, control music, etc. thread. Game or game engine is not easy, because there is thousands of possible interactions among objects. It is a lot of work which has to be done during those fifteen milisecunds.

Given that the game will run under D3D9, I have to learn to work with this system - which means a few things to learn how to properly operate D3D9, what are its limits, and mainly use all optimization options for advanced 3D graphics card. It is also important to ensure that the game be compatible with the widest possible range of PC and graphics, which in D3D is not completely trivial and obvious. (Which modern games each player knows - sometimes it happens that the game just does not run as it should. ;-))

So keep your fingers crossed, have the Quadrax x been developed without any problems, and let it have its stability and compatibility as least as much as they had previous versions that have been able to work from Win95 to Win8...

© 2000-2015