[Tutorial] Binary Void PC/Mobile complete game, dev-dreaming and Q&A (beginner-friendly)


So... what's Binary Void?

Description in Unity Asset Store says it in full...


...but in short:

Binary Void is complete project made for both desktop and mobile platforms, also meant to present and teach general principle of game development in Unity, accompanied with general and often necessary elements of game structure (such as, tweakable game settings, rebindable controls, saving data in files on disk, etc). It's a complete game that can be built and played as soon as it's imported in Unity, from title screen, main menu and intro, through out the level, all the way to outro and credits. Depending what platform game detects (PC or mobile) it will initiate possible performance optimizations, set particular difficulty and adequate control layout.

This project can be viewed as gamer's way to present another gamer, how to make games in Unity. It's beginner-friendly straightforward, yet deep project, that could be ideal to those who are not sure where to start :)

Binary Void documentation, written as one long walkthrough, focus on all aspects of the project, but with emphasis on the code. If design is... soul... of the game, then code is certainly it's brain. Coding is probably the hardest to overcome but essential in game development, thus the emphasis on it. Binary Void comes with quite a few algorithms written, that can serve for variety of game types, and not only to this specific arcade. Here are two examples (see 3rd post in the topic for more details):

>> VIDEO 1 <<
>> VIDEO 2 <<

Binary Void is rounded construction with classic arcade pattern. Such as: title screen, intro, levels (where levels are often divided into the wholes, usually named as worlds), big finale and outro. It's meant to provide study of the whole for its pieces and the way those pieces are merged to work together in correct way, with ability to toy and experiment, while every aspect is covered by documentation rich in detail.

And who's the guy behind all this?

My name is Stefan and I am a long time gamer and for a while, game designer too. My history of gaming includes Commodore 64, Amiga and PC.

As for game design... first rather ambitious fully open-source project, that I am involved with, is called -- Limit Load. Here are three action videos on this game:




It's an arcade flight game done on open-source 3D engine, and in spirit of games such as Wings and Strike Commander. In comparison to Binary Void project, Limit Load is certainly a bit more... well... ambitious and requires much more advanced designing/coding knowledge to understand. I am the main designer behind it (and a lot of other roles, artist, mixer, director, writer, high-level coder and more). If you compare Binary Void PDF-Walkthrough with the PDF mission design manual for Limit Load... you might find some resemblance in style :)

Binary Void on the other hand, is Unity project done entirely by myself, including the whole mid-level code.

At the end...

That's it for now. Will get back later to write more about Binary Void tutorial, spiced with some dev-dreaming... unless sudden activity in this thread summons me, earlier.

If you are interested to tag along with Binary Void, feel free to post in this topic any questions that you might have and you can also send me an email or perhaps even catch me at Unity Discord for a live chat. If you have some imaginative idea how to adapt/reshape Binary Void but have difficulties in doing it, feel free to ask me and I might be able to assist you :)

With enough gaming experience, imagination, and enough tools within the framework, a designer can use and expend on almost any game concept or on a rare occasion come up with something entirely new. Advanced Invader's role-model is rather obvious -- Space Invaders. But while I was making the game, the ideas how to expend on the role-model just kept coming. For example, just adding mere jump ability was already shifting it away, opening new possibilities. Eventually I decided to add many elements from all sort of classic shoot 'em up games and that later turned Binary Void project into a sort of algorithm library for such type of games. To a designer these ideas should come naturally and in process, torture with temptation too! :)

However, if one is only the game designer, getting the framework can be rather the big problem. In order to weave the game itself with its own ID, one needs to either make game's framework or have someone to make it according to the vision in question. This framework can be all visual, drag & drop (unlikely for a fresh start) or enough for much simpler level of coding, which may prove as the most efficient way in the long run. In Limit Load, part of its framework architecture is my design, but I didn't build any of it myself and that required frequent negotiation, tact and patience. My ideas were mostly approved so far, but on a few occasions I had to outrun the boot :smile: In Binary Void, since whole framework was done by myself, I had everything under strict control ready to improve/expend/change on heart's desire.

It should be a good feel to any designer when he can finally attend to such fine details like, how enemies behave; how many hitpoints should some entity has, then factor of bullet penetration or critical spots; what's the good time for player's avatar to receive a permanent upgrade; from which direction at which time in the level should the trouble come; what options should be at player's disposal; measuring are those options gimmicks in particular situation or they really add to the gameplay; and so on and so forth. To me, these moments are like bearing the fruit of hard work. I guess it's no strange that rather long scene-part of Binary Void PDF-walkthrough (basically, part about development and design of the level) was the easiest for me to write and most fun to comment in the code.

My gaming culture pattern is closely tied with PC gaming culture pattern. Thus I designed Binary Void from this cultural angle. I took care for game to follow good PC gaming traditions, despite I might have had opportunity to get away without some of them and spare myself from trouble. This pattern means for example, rebindable in-game controls and keyboard & mouse layout to be always taken in consideration, despite it might not be the best in some particular case; standard menu design is done with mouse pointer in mind; game files (such as config file) are orderly stored on the disk for player to backup or meddle with; joystick is required for any flight game! :P Couldn't resist on this one... I still wonder if that story about old DOS X-Wing game not letting anyone in unless it detected joystick, was an urban legend; and so on...

Lets see why Binary Void can also serve as tutorial project for variety of game types, as well as pack of algorithms for arcade shoot 'em up games.

With mix and matching the concepts from Binary Void, I can make games like platformer, a shooter, racer, etc and then all the variations... here are few examples:

>> VIDEO 1 << (Click here to watch the video)

This is basically Binary Void expended into platform-shooter that I needed several hours to make. I made it with a lot "dirty" code and I used just about any shortcut I had at my disposal, you know... the type of coding that will bite you in the rear sooner or later. Otherwise, I would need several days. But it serves well as demonstration of game's transformation :) Now to think about, I could have gone on and on and on and make one gigantic level, with little bit of Metroidvanie concepts in it, without introducing any new elements. Another good thing is that, for a mobile platform, Binary Void's flexible UI-based virtual joypad is more or less suitable for arcade games that don't require direct interaction in the game's world.

Lets get now to something a little more advance:

>>VIDEO 2 << (Click here to watch the video)

This is project somewhat inspired by Limit Load. There are new elements in this example like radar or destruction. And it is also done in 3D. However, a lot of code and code-concepts for this project are copy-pasted from Binary Void. I needed about ~20 days to make it. I would probably need even less amount of time, if I didn't dive into detailed adaptation of some elements :) For example, that GSH-301 gun of player's jet, it could have been hard-coded to the jet in question -- just like HAM-1000 system is to Defender in Binary Void, but I made it to be object on its own, which opened me possibility to script just about any gun, so I added M61 Vulcan or DEFA-554. And now I can easily switch the guns to jets if I want to (by merely detach one subobject in prefab, and attach another).

The fact that it is full 3D game and not 2D like Binary Void, is notable element but in case of this example it doesn't add much to the complexity of code. Still, in 3D there are quite a few concepts that one has to get acquainted with. In 3D, effects such as lighting, shaders, post-processing, will aid visual appeal a lot on their own if instructed correctly. Those clouds... nice example of what you can do with a texture made of just one filter in GIMP and then well placed normal map on top of it (basically 10 minutes job when you know the right formula).

In the end, Binary Void should be able to teach principles for all of this and fire up imagination in process of doing so...

If I was given a choice what level of programming to take upon myself, I would go for high-level one, just like in Limit Load. Let the engineers do mid-level and gods to do low-level. I am designer after all, but here I was, dabbling deep into mid-level, building myself framework for high-level code. High-level coding is when mid-level folks provide all the necessary tools and framework, for designer to weave the actual game in code.

Scripting a level is rather interesting piece of work. I prefer "narrative" way of level design even in case of straightforward games like Binary Void. That often means, a level riddled with events and event triggers, that will all do something different. A sneaky bad surprise for a player, or perhaps the sudden drama, maybe a crossroad or unexpected reward... all will do. Having the tools for this type of level structure already implemented in Binary Void, is one of the reasons why I was able to turn it so fast into that platform-shooter, previously shown :)

A level coroutine is a place where you can actually read the whole level in code, like a book. And assuming all tools (variables, functions, classes, etc) have the sane names, it's actually a very readable story. Here is an excerpt from Binary Void in-game level:

  • "[...]" this symbol means that I just skipped some code there to shorten this excerpt
IEnumerator GameLevel()
    //Gravity of Binary Void
    Physics2D.gravity = new Vector2(0f,-9.81f);
    Physics.gravity = new Vector3(0f,-9.81f, 0f);

    //Standard minimum and maximum altitude that level lift can reach
    float lowerHeight = -45.0f;
    float upperHeight = -35.0f;


    //A stylish pause
    yield return new WaitForSeconds(1.0f);

    //Request to audio manager to play level music, no. 2 piece
    am.AudioPlay(am.gameMusic[2], true);


    //Rise the curtain, fade screen in

    //Stop progression of the level, until level lift that is carrying the
    //player, reaches its upperHeight altitude
    yield return StartCoroutine(
        gm.LiftMove("up", lowerHeight, upperHeight, 240.0f, true));


    //...and enable in-game HUD panel of UI level (a panel with score,
    //hitpoints, lives, etc.)

    //And another pause.
    yield return new WaitForSeconds(1.0f);

    //Tell game manager to give control to the player
    gm.playerControlLevel = 0;

    //Stop progression of the level, until first enemy group is spawned
    yield return StartCoroutine(sceneLevelTools.SpawnAlienGroup(
        sceneLevelTools.alienDronePrefab, sceneLevelTools.alienDronePrefab,
        sceneLevelTools.alienDronePrefab, sceneLevelTools.alienDronePrefab,
        12, 8.0f, true, 0.2f, false, false, false));

    //Set time limit for this phase of the battle
    float timeLimit = 60.0f;
    //Add time to UI level component regarding timer
    gm.textTime.GetComponent<TextTimer>().timeLeft = timeLimit;
    //Enable UI level timer

    //Until either all 48 enemies in the group are dead or time limit
    //reaches zero, block any progression of the level
    while(gm.enemyKilled < 48 && timeLimit > 0.0f)
        timeLimit -= Time.deltaTime;
        yield return null;

    //Disable UI level timer
    //Prepare crossroad variable
    bool crossroad = false;

    //Since it was time limit that expired (considering that less than 48
    //enemies were destroyed)...
    if(gm.enemyKilled < 48)
        //...tell all remaining enemies to retreat
        gm.retreatAllEnemies = true;
        //And another stylish pause!
        yield return new WaitForSeconds(3.0f);
        //Make sure that retreat orders are not active any more
        gm.retreatAllEnemies = false;


        //Begin cutscene by taking control away from player
        gm.playerControlLevel = 1;

        //Make a cutscene dummy of enemy boss and have it move in
        GameObject alienDestroyerDummy = Instantiate(


        //Move player around a bit at random horizontal position
            new Vector2(Random.Range(-35.0f, 35.0f), 0.0f), 2.0f));

        //One long stylish pause
        yield return new WaitForSeconds(8.0f);

        gm.ScreenFlash(1.0f, 4.0f, 3.0f, 1.0f);

        //Stylish pause
        yield return new WaitForSeconds(2.0f);

        //Since screen will still be white at this point, it is a good
        //moment to remove boss dummy while player can't see that

        //Pause still
        yield return new WaitForSeconds(3.0f);

        //At this time, flash should be over and since cutscene is over as
        //well, lets give back controls to the player
        gm.playerControlLevel = 0;

    //...or if all enemies were dead...
        //...set crossroad variable to true, we will need it to decide what
        //is next to happen
        crossroad = true;

        //Award player with generous amount of TP for destroying group one
        //in time
        gm.textLevelIntro.GetComponent<Text>().text =
            "Destroyer alert avoided\n20000TP bonus";
        gm.newPoints += 20000;


        //Direct a simple cutscene, like some time has passed and start by
        //taking controls away from player
        gm.playerControlLevel = 1;


        //At the end of cutscene, make sure to return controls back to the
        gm.playerControlLevel = 0;


The code can be even more like a book (or drama more accurately), if you have a sort of dialogue tree within the level. In Binary Void there is no such thing (unless you imaginatively use three level-UI info text components at your disposal), but if you want to check it how would that look like done entirely in the code, see example 2 in PDF Mission Design manual of Limit Load -- Colonel Arend and his F-16 fighter group in a airbase on Canary islands. Be warned that example is rather Spartan :)

And this is domain of high-level coding. The good thing -- it's (often) easy and usually fun. The bad thing -- you are hard-limited with the tools at your disposal so if you find you need additional tool or two, to make your vision come true, then you either have to dive into mid-level again or... ask nicely (try with puppy eyes) your mid-level pal/colleague for it.