A lot of books, articles and tutorials have been written about the benchmarking of applications, engines and various software systems.
This is what the old Wikipedia gives us about it:
Benchmark performance test (eng. Benchmark) - a control task necessary to determine the comparative characteristics of the performance of a computer system.
But what if we get to the question of benchmarking game engines a bit from the other side? All game engines and game development SDKs (and not only) often advertise themselves as very intuitive and easily digestible tools. We sell easy to learn, amazing learning curve and the entrance, demonstrates lightweight and beautiful examples, where one screen of code being launched creates some kind of wonderful magic. So, in preparation for the upcoming Ludum Dare event, I once again decided to look around and see what the “market” simple Emelya offers - to someone who is in game development without a year a week. That is, one of the groups of people of the very Central Asian, which sells these most amazing qualities of easy engine digestibility.
What if we ... try to test yourself when working with different engines to write games? Yes, yes, that is, their productivity on them. Literally, we take a few of them, lock ourselves in a cave with a laptop, internet and a stopwatch, and write down all our results in a neat tablet, and then try to draw some conclusions. In parallel, we note that we liked it, which surprised or strained our work with this or that engine.
So, the objects of testing are three game engines. Here, probably, it is somehow more or less formal (as far as it is possible) to describe your “configuration” (yes, as in the case of typical benchmark results, they write the configuration of iron, where they did the runs, the description of the benchmark, and so on).
I am a Java developer. Industrial development experience 5+ years. Also in the work I wrote a little on JavaScript, Lua (quite a bit), the shell. Higher technical education. I did not attend design courses, I did not study game design, only an ardent fan of various PC games. The last year was carried away by the creation of the simplest computer games.
The test task was chosen project clone Doodle Jump. I am sure many people know or played it, this is a very cool and very popular game for Android.
The rules will be:
In a very abstract and high-level form, I see myself the components of the game like this:
Game Over
. A player loses if he reaches the bottom edge of the visible area (after having already jumped at least once)HUD
: display player progress. Height display.For simplicity, assign each component one point of our parrot units of measurement. Total maximum - i.e. The full playable version of the project is equal to 8 points.
Below are the assets used in the display. These are hand-drawn (I’m not an artist, as you can see) character and platform sprites sized 64x64, in * .png format.
And also give a couple of flowcharts:
y_velocity
) and the player's y
coordinate, it is influenced by two factors: the acceleration of free fall ( GRAVITY
) and the platform, upon reaching which, the player pushes off with the fully restored speedBy the way, I still have questions:
dt
), knows the highest platform that exists at the level and with a random height value (a certain threshold, not more than the player’s jump height, but not less than a certain percentage of its height, so that the platforms do not cling closely to each other) adds a new platform to the level when the player has advanced. It is also interesting to question the increasing complexity of the game, how the mode of generation of these platforms should change.I would be very pleased with your ideas, lifehacks and suggestions in the comments and drugs on these two undoubtedly game design issues.
Three candidates with very interesting features were applied to me. So, the table below summarizes the parameters that would be useful to keep in mind when analyzing the results of their tests.
Engine | YAP | Experience in the engine (0 - no, 1 - there is experience and a few simple written games, 2 - the engine is mastered along and across | Experience in PL (0 - no, 1 - experience and good knowledge and understanding of the syntax, idioms of the language, 2 - pro in this PL |
---|---|---|---|
Defold | Lua | 0 | one |
Love2d | Lua | one | one |
Fxgl | Java | 0 | 2 |
So, we see that the selection is quite interesting. It is interesting because we will deal with different combinations of our qualities and characteristics of engines. And let's see what sets up at the end: the engine in which I’ve already filled my hand a little, pumped PL or a completely fresh and new engine for me with promising chips, but not mastered at all, and besides, not in my main development language.
Many would have probably wondered why, I didn’t go the standard way, and didn’t take the most common flagships of our time: Unity or Unreal Engine? I would formulate my thoughts like this: I want to build a very simple, minimalistic and tiny game. With a pair of game elements that make up the game mechanics, one playable character, simple level generation and no special effects or very conditional special effects, like on old arcade machines. So, figuratively speaking, my task is to draw a red circle on a black square, and for this I am invited to take Photoshop
. Simply put, the set of features, modes, and features of Unity
scared me off. At this stage I would like to understand every detail of my game.
Best of all, these are simple and small engines, with a limited set of possibilities, perhaps not with the best tuling and ecosystem, but simplicity and limitations also have their own beauty. Having only a limited set of tools - and in the case of Love2D, your tool is your code and nothing more, you focus on a fan, on writing something cool, reviving a character or a player’s environment. Already more complicated engines expand your choice, and writing code smoothly flows into many things: writing scripts (code), linking scripts, mapping assets, adding configs, redefining configs, mixing third-party plug-ins, writing scripts and configs for third-party plug-ins, multiple clicks on dozens and dozens of dialogs and windows ... Let's just say that I am still afraid of such tricked and undoubtedly advanced and powerful game development engines. Well, I also do not want to re-remember C # / JS / C ++ and write on them.
I’ll summarize a little my motivation when choosing an engine with a link to this video, where the author seems to me to literally remove from my tongue what I tried to formulate in words to myself and others all this time: https://www.youtube.com/watch ? v = JH8xwNOQ0TM
Defold
- cross-platform engine from the company King.
Supported Platforms:
A curious fact that King is owned by Activision Blizzard "holding".
In the engine, I was attracted by the development language - Lua
, support for a heap of platforms for game builds, as well as the distribution kit of their own cross-platform IDE
- can also be installed on Linux as well. This bribed me when choosing between Defold
vs. Corona SDK
.
And below is a log of what was done to the control points:
No | Time | Comment |
---|---|---|
one | 30m | 1 tutorial scanned, a couple of editor's introductory descriptions, a test project tested (encoding a click handler, reading the training project docks) |
2 | 1h | Added some modifications to the test training project. Probably, it's time to take on your project and try to implement at least something there? |
3 | 1h 30m | Made jumping man (sprite with behavior). Not bad! :) |
four | 2h | It's time to add management. Is it time to add platforms and collisions? Management and platform added, but alas, it didn’t manage to handle collisions .. |
five | 2h 30m | Collisions! It is necessary that the little man knew how to jump on the platform and then push off them upwards. Well. There are collisions, but while the mechanics are working crookedly :) |
6 | 3h | Hooray, there is a conflict and it seems to be correct. I tried to place multiple copies of the platforms. |
7 | 3h 30m | Now we need to think about the floating camera, floating up and up, as long as the player jumps onto new higher platforms. He did not advance, but only dug in the intricacies of screwing the camera ... It seems that it’s impossible to set up a camera with a snap. |
eight | 4h | Hud Displays the current height of the player above the floor. |
Below, in the spoiler, a few gif-animations are hidden, showing the progress in time:
0-1h
1-2h
4h
Total, benchmark points:
(V) Yes
(V) Yes
(V) Yes
(X) No
(X) No
(X) No
(V) Yes
(V) Yes
Benchmark Score: 5/8
This is a very minimalistic, but powerful enough and flexible engine for creating prototypes. In general, with proper skill, it is even suitable for publishing full-fledged games on the market. There are some good inspirational examples. Offhand, one and two .
In general, on this engine, I recommend a very useful series of tutorials from Habra, which spurred me and gave a powerful impetus to mastering this engine, I will give only a link to the first part, then you can get to the other parts with it: Creating a game on Lua and LĂ–VE - 1
So, below is a log of what was done at the control points:
No | Time | Comment |
---|---|---|
one | 30m | Setting up a project, creating base handlers, creating a player class (a framework with not yet working jump logic and gravity) |
2 | 1h | Made the factory, drawing the platform, made jumping man. Hooray! |
3 | 1h 30m | Attempt to screw the library hardoncollider. Frustrations associated with the fact that the dock on the official website is written on an outdated version, searching for current docks, screwing up collisions. So far, no conflicts have been implemented. |
four | 2h | There are collisions, but they are curves: ( |
five | 2h 30m | Collisions are made, there are some flaws, but in general - the rules. Attempt to fasten the camera, tracking the player, following his jumps up. Not very successful yet .. |
6 | 3h | There is a generation of platform, but the collisions are still buggy and limp: ( |
7 | 3h 30m | Implemented the definition of Game Over - the definition that the player fell over the lower edge of the visible area. Points scoring implemented - i.e. display in the upper left corner of the last height taken |
eight | 4h | See below under the table what has been achieved after 4 hours of developing the Doodle Jump clone on the Love2d engine. |
Calculate the "performance" of the engine:
(V) Yes
(V) Yes
(V) Yes
/ (X) No
// * Implemented, but not quite perfectly, with significant flaws. I would put here 0.5 points for the point.(V) Yes
(V) Yes
(V) Yes
(V) Yes
(V) Yes
Benchmark Score: 7.5 / 8
Perhaps it would be logical and logical to take a closer look at the engines, where the development language is the one in which I have the most experience and skill, isn't it? Actually, intuition and some internal sensations kept me a little from this. The fact is that even as a student, I somehow watched my classmate suffer with the jMonkey
engine. Tuling, work with the engine, documentation, all this together created some kind of not very pleasant picture. It seemed that the engine simply does not give you a chance to make friends with him, very much its use looked somehow unpleasant.
But still, I decided to see what is available today, and I looked only in the direction of engines that only guarantee 2D
, I didn’t care about 3D
support. One of the engines, Lightweight Java Game Library 3 , has in its title and introductory word Lightweight
. Ironically, the simplest basic examples on the main page, just a few screens long, just scared off.
Yes, of course, Java
very verbose, what do you want, you say. But I know that you can write very compact and very expressive things on it. I saw a nice and compact API.
And in the end, the choice fell on FXGL
. At first, I didn’t have any enthusiasm and pleasant excitement that happens before I start learning some interesting piece or library. But from the first examples and brief pages of documentation and examples, this engine pleasantly surprised me more and more. In the approach and API that he proposed everything was logical, understandable and consistent. It definitely helped you to build a clear and flexible cycle of your game, handler logic, HUD
, AI
, collisions, and other elements.
As the name may hint, for the visual part, the engine uses the JavaFX API (with its all buns and anti-buns) for rendering and layout of elements. In general, I think this is a good and quite sensible decision. Thus, the author avoided a number of problems (there is no need to implement and maintain your rendering component, you can use a refined solution from the Java
ecosystem). Here is what the author himself says in one of his first tutorials, and I really liked this phrase:
"For most UI objects we simply use JavaFX objects, since the wheel."
But in general, of course, you get a bunch of features and some drawbacks of JavaFX
, and also (I'm not very aware of the details), but as far as I know, there are some licensing restrictions on using JavaFX
in my projects, and it seems JavaFX
Goes and will go only in limited deliveries JDK
( Oracle
, maybe some more).
The test project, cloned from the repository, on the basis of which I began to sculpt the game, kindly puts logs in the project logs/
daddy logs/
after each start of the game. It is very convenient, you can immediately watch the debug-information out of the box, it is very useful for diagnosing, understanding where you are nosyachil, if you suddenly met a plug in studying the engine.
Also (apparently again with basic settings) the game provides a pop-up menu by pressing the Esc
. Also a nice bonus, I hope it is customized or at least disabled by code or configs.
Here Debag finally works! Finally! In Love2D
doing it is uncomfortable and unpleasant to say the least.
Below is a brief summary of my progress, where I briefly noted what was achieved after the 30-minute interval, as well as some of my thoughts and comments. See the log of my consciousness during these 4 hours!
No | Time | Comment |
---|---|---|
one | 30m | Studied a pair of tutorials. Base API and game loop structure. I learned how to draw sprites, move objects, display and update HUD. Started screwing collisions into the game. |
2 | 1h | There is a jumping square with a collision body (Bounding Box) and "able to push off from the floor" (i.e. there is a definition of the lower border of the screen) |
3 | 1h 30m | Laid the foundation for the platform creation factory (PlatformFactory.java). It seems that it even turned out to “tame a conflict” and managed to push the character away from the platform. This is undoubtedly a success for the new engine and with half a read GitHubWiki-tutorial on the spot. |
four | 2h | I modified collisions with platforms a little, but still it’s still buggy and not perfect. Pretty quickly, it was possible to do camera tracking, again, it is also a bit sharp and clumsy, but smoothing smoothness will remain beyond the benchmark and experience with FXGL in particular. Also, it was not difficult to add the code for the platform generation factory so that the platforms were generated at an acceptable random distance from the last generated platform. And the code that generates them as the player advances has also been integrated into the main game loop. Pretty good progress, as for me. |
five | 2h 30m | Well then. At this point, virtually the entire game is ready. Implemented all the basic components. And even the correct mechanism of repulsing the player from the platforms (wow!) Was polished and modified by a file, which was not achieved ideally with the previous two engines. Perhaps, the accumulated experience and intuition have already affected here, I do not argue. Also, the randomizer of calculating positions for new platforms was mutely tuned, since with the previous parameters absolutely unreachable platforms appeared, which led to Game Over. |
6 | 3h | Another key feature of Doodle Jump (the one that was out of the scope of the main task) is implemented - if a player jumps out of the left or right edge of the level, he appears on the other side while maintaining his speed (impulse). This gameplay chip is a very key part of Doodle Jump; what makes the game diverse and catchy besides other elements. Also, the reset function of the game (Reset) was quickly thrown in and the code of enemies and enemy AI was thrown. So far this is not in the game, but at the level of the prototype. |
7 | 3h 30m | Implemented an algorithm for random generation of enemies at the level. It is not perfect at all, but this already adds an element of fun and challenge to the player. The enemy's AI, if it can be called such a loud word is simple - the enemy simply runs from left to right and back, reaching the edge of the screen, he simply changes his direction of movement. . |
eight | 4h | . — . , . , , Space . |
GIF- , .
0-1h
1h-1h 30m
2h 30m (In fact, all the basic elements of the game are implemented here)
3h 30m
4h
"" … , , , ? .
Benchmark Score: 8
:
Engine | (0 — , 1 — , 2 — | (0 — , 1 — , , 2 — | Benchmark Score | ||
---|---|---|---|---|---|
Defold | Lua | 0 | one | 5/8 | 166 |
Love2D | Lua | one | one | 7.5/8 | 701 |
FXGL | Java | 0 | 2 | eight | 582 |
, , , ( ). , , Java FXGL
, , Lua
, . , , .
:
FXGL
? I would not say that. Love2D
, Defold
, , , , Love2D
- , ., - , ?
So:
Love2D
).Love2D
, . F to pay respect
.Game Jam
, .Ludum Dare
.Source: https://habr.com/ru/post/449390/
All Articles