Alawar Engine. Part three. Create a game on the demo version of the engine

    Hello. So the turn of our next article has come. In the first, we introduced you to the workflows of our studio and casually mentioned the tools we use when creating games. The second article was devoted to the cross-platform engine Alawar Engine and was intended in many respects for those who have already encountered similar issues in their work. Speaking of cross-platformness - on March 13 our game for PlayStation 3 was released , which we first created on the Alawar Engine. In addition to cross-platform, the engine supports multi-genre, as games in such genres as: Arkanoid Hyperballoid 2 , match-3 The Treasures of Montezuma 2 , Arcade Space Op (iOS) have already been released, preparing to release a time manager from the series "Farm Frenzy".

    In the third article, we will dwell on the process of creating a game. A demo version of the Alawar Engine is presented to your attention , and this article will serve as a kind of instruction for working with it.

    In principle, any game can be created using exclusively programming languages, without any additional applications and tools. However, many moments when creating game projects containing a large number of resources (images, videos, sounds and texts) require significant optimization. Adding and changing the properties of these resources is much easier through the visual editor than in the game code or configuration files, and a set of frameworks greatly simplifies the process of creating a game. That is why the presented engine is not only a set of libraries written in C ++, but also a powerful toolkit with which the process of creating games is greatly simplified.

    The central application around which the creation of the game process of quests of the genre "search for objects" revolves is the Quest Editor. With it, we create new scenes (game interface), place objects on them (images, video, animation), prescribe the scenario logic of the game and the relationship of events and scenes. The Quest Editor interface consists of three areas that contain:

    • a list of scenes and levels available in the game, as well as resources (images, videos, clips) available for adding to the scene (Resource tab);
    • scene preview screen, you can quickly add a new object to it, create a game area;
    • window with a list of objects and settings for their properties.



    The demo version already has a set of resources located on the game scenes: when working with the demo version of the engine, you can add new images, sounds, texts or videos to the game (and the story video between the scenes, and the video launched by clicking on the object ) And also two mini-games were added to the project and examples of the functioning of scripting blocks are given, which form a small gameplay. Be careful, in the demo version there is a limit on the number of added objects - 500 images, 50 sounds, 70 clips, 100 lines.

    In order for new images to become available in game resources, they must be placed in the 1.0-demo \ game-template \ live \ game \ images \ folder. Please note that within this directory there are subfolders, each of which is associated with a specific component of the game. So, for example, in the font folder are game fonts, and in the scenes folder you need to add images that will subsequently be added to the corresponding game scenes.

    After the images are added to the folder, you need to run the Image Resource Editor application (1.0-demo \ game-template \ live \ game \ run-image-resource-editor.bat). It updates the resources.xml file, which stores information about all the images. In addition, it is possible to set the parameters of images and animations.

    To add new video files to the game, just place them in the 1.0-demo \ game-template \ live \ game \ video folder. There is a video division in the game - this is a full-fledged, encoded video stream in webm or ogg formats; and clips are animations, animated pictures. Video can be a better quality, but at the same time more demanding component. It is usually used if you need to show some effects, for example, explosions, magic, character animation, water animation. Simple, repetitive actions are best implemented by clips. The ClipMaker application is used to create clips, and the Particle Editor is used to animate particles (they are not included in the demo version).

    All texts are stored in the strings.xml file, adding new lines is carried out by simple editing of this file. Sound is added to the game by copying files to the \ game \ music and game \ sounds folders. The types of reproduced sounds are registered in soundtemplates.xml, and the files themselves in sounds.xml in the game \ properties folder.

    This concludes our brief overview of how game content is added and proceed directly to creating the game.

    Run the Quest Editor (1.0-demo \ game-template \ live \ game \ run-quest-editor.bat), in the left window select the level Example and Scene01. In the expanded list, double-click on Scene01. An image of the scene with all objects added to it will open in the central window. Under the scene window there is an area for adding scripting blocks, with which the logic of the game is set. In the right window there is a window with scene properties and a list of objects located on it. By clicking on an object in the list, you select it in the scene window, and its properties are displayed in the Properties window.



    I will not dwell on the description of the blocks and commands that are present in the Quest Editor - this topic is too extensive and therefore, I think, it is not necessary to disclose it within the framework of this article. But for those who decide to seriously approach the process of creating a game, the 1.0-demo \ doc \ folder contains detailed documentation.

    Here we will analyze an example of adding mini-games to the project, which can act as key points in passing the game and not affect it. Before writing a mini-game in the Quest Editor, a separate scene is created and all the necessary objects are placed on it. For example, the scene Scene01_Minigame in the Quest Editor. Thus, the graphic component for the mini-game is prepared, after which you can start programming.

    From the point of view of the engine, the mini-game is a class that is created when the block of the mini-game is unlocked and deleted after this block is executed. The block identifies the identifier of the mini-game by which the object is created. Previously, this identifier must be registered in the engine.

    Until the block of the mini-game is unlocked, it will not be drawn and respond to user actions. After the mini-game is unlocked, it may begin to work, but its passage may be impossible. For example, if the player does not know the desired cipher for passing and must first find it. The condition input is used for this. And only after all the connections to all the inputs have worked out, does the mini-game work and go through.

    Mini-games must be inherited from the class game :: CMinigame and have their own unique string identifier, which must be registered in qe :: CMinigameFactory. In the template project, a separate file is selected in which all mini-games are registered: Game / Minigames / RegisterMinigames.cpp.

    All initialization must occur in the Init method. Each frame is called with the Update method; the logic of the mini-game should be calculated in it. Draw allows a mini-game to display resources on top of the scene to which the mini-game is attached. OnMouseClick and OnMouseMove catch mouse events. To complete the mini-game, she must call OnMinigameComplete. To start the game from the Quest Editor, click the Play button, while you can both check the main gameplay and the added mini-games.

    To check the game logic, before launching the game, the Quest Editor has a validation system that allows you to catch various bugs and inconsistencies that appear when assembling and scripting scenes in the editor. For example, if you try to call a scene object in a block or command, the validation system will check if the given object exists. If it is absent, she will mark it as an object with an error, circling it in a red frame or placing an exclamation mark next to the problem.



    In addition, the beetle icon is located on the top panel, which displays the number of bugs found in the gameplay. When you click on it, their complete list opens with detailed information and an indication of the scenes on which the problem is located. Bugs are sorted by level.



    After the game is created, it can be compiled to optimize the game files and reduce its launch time. In the demo version of the engine, the ability to build games for Windows (built using Visual Studio 2008) and Mac (built in Xcode 4.5) is added. The game can be launched without assembly - in Windows, for this, run the game_release.exe file in the game folder. To do the same for Mac, type mac_run.sh in the console, in the game folder.

    Applications that come bundled with the engine are not tied to genres, so using the Alawar Engine today games of various genres are created - these are quests, economic simulations, strategies that are distributed, in particular, according to the free-to-play model. Of course, applying the Quest Editor is most appropriate when creating quests, as it contains a scripting language that allows you to build a clear sequence of passing the game. In other genres, this application is used to add game objects, videos and clips to game scenes. Game mechanics are created in C ++ and associated with objects through their id.

    PS If during the creation of the game you have questions about the engine, you can use the documentation in the doc / folder. Or ask them in the comments to the article.

    Also popular now: