📜 ⬆️ ⬇️

Alawar Engine. Part Three Create a game on a demo engine

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

In the third article we will dwell on the process of creating the 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 only programming languages, without any additional applications and tools. However, many moments when creating game projects containing a large amount of resources (images, video, sounds and texts) require significant optimization. Adding and changing the properties of these resources is much easier through a visual editor than in the game code or configuration files, and the set of frameworks greatly simplifies the process of creating the 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 gameplay of the quests of the “hidden objects” genre revolves is the Quest Editor. With its help, we create new scenes (game interface), place objects on them (images, video, animation), prescribe the script logic of the game and the relationship of events and scenes. The Quest Editor interface consists of three areas that contain:
')



In the demo version there is already 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 video to the game (and the scene video between the scenes and the video launched by clicking on the object ). As well as the project added two mini-games and examples of the functioning of the scripting blocks, which make up a small gameplay. Be careful, the demo version has 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 inside this directory are subfolders, each of which is associated with a particular component of the game. For example, in the font folder are game fonts, and in the scenes folder you need to add images that will later be added to the corresponding game scenes.

After the images are added to the folder, you need to start 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 can set the parameters of images and animations.

To add new video files to the game, simply place them in the 1.0-demo \ game-template \ live \ game \ video folder. There is video division in the game - it is a full-fledged, encoded video stream in webm or ogg formats; and clips are animation, lively pictures. Video may be better, but at the same time more resource-intensive component. It is usually used if you need to show some effects, such as explosions, magic, character animation, water animation. Simple, repetitive actions are best implemented with clips. ClipMaker is used to create clips, and 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 strings is done by simply editing this file. Sound is added to the game by copying files to the \ game \ music and game \ sounds folders. The types of sounds being played are recorded in soundtemplates.xml, and the files themselves are in sounds.xml in the game \ properties folder.

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

Run Quest Editor (1.0-demo \ game-template \ live \ game \ run-quest-editor.bat), in the left window, select the Example level and Scene01. In the drop-down list, double-click on the item Scene01. In the central window will open the image of the scene with all the objects added to it. Under the scene window there is an area for adding scripting blocks, which are used to set the game logic. In the right window there is a window with scene properties and a list of objects located on it. 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 elaborate 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 in the framework of this article. But for those who decide to seriously approach the familiarization with the process of creating a game, in the folder 1.0-demo \ doc \ is detailed documentation.

Here we will analyze an example of adding mini-games to the project, which can act as key points in the passing of 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 preparing the graphic component for the mini-game, after which you can start programming.

From the point of view of the engine, a mini-game is a class that is created when the mini-game block is unlocked and deleted after the execution of this block. In the block, the identifier of the mini-game, on which the object is created, is written. Previously, this identifier must be registered in the engine.

As long as the block of the mini-game is not unlocked, it will not be drawn and will respond to user actions. After the mini-game is unlocked, it may start to work, but its passage may not be possible. For example, if a player does not know the required cipher for passing and must first find it. To do this, use the input conditions. And only after all the connections to all inputs have worked, the mini-game works and is passed.

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

All initialization should occur in the Init method. The Update method calls each frame, it should calculate the logic of the mini-game. Draw allows the 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, it 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 test the game logic, before launching the game in the Quest Editor, there is a validation system that allows you to catch various bugs and inconsistencies that appear when building 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 object exists. If it is missing, it will mark it as an object with an error by circling 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. Clicking on it opens their full list with detailed information and an indication of the scenes where the problem is located. Bugs are sorted by levels.



After the game is created, it can be compiled to optimize the game files and reduce the time it starts. The demo version of the engine adds the ability to build games under Windows (built using Visual Studio 2008) and Mac (builds in XCode 4.5). The game can be run without assembly - on Windows, run the game_release.exe file in the game folder. To do the same for Mac, type mac_run.sh in the console from the game folder.

Applications bundled with the engine do not have a binding to genres, therefore, using the Alawar Engine engine, games of various genres are being created today - these are quests, economic simulators, strategies that are distributed, in particular, according to the free-to-play model. Of course, using the Quest Editor is best when creating quests, since It has a scripting language that allows you to build a clear sequence of the game. In other genres, this application is used to add game objects, videos and clips to game scenes. Game mechanics is created in C ++ and is associated with objects through their id.

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

Source: https://habr.com/ru/post/174571/


All Articles