This article can be viewed as a review-argument on the topic of visual programming. I myself have more experience creating games on Unity, I am new to the Unreal Engine 4, so we will talk about the very phenomenon of visual programming as a whole, and not just about UE.
A bit of history, or visual programming in short
We will not go too deep into history, but know: visual languages ​​as such have appeared a long time ago, long before we saw the light of a visually beautiful Unreal Blueprint. After analyzing the concept of visual programming more closely, we will see that it is based on the dataflow programming paradigm. This approach was invented back in the 70s of the last century. It lies in the fact that any program can be represented in the form of a digraph that displays the flow of data between the components of the program (in fact, this is the same block diagram). Unfortunately, this paradigm is now very far from trend trends, but we can return to it in the heyday of visual programming.
The desire to visualize algorithms in humans began almost simultaneously with the advent of the very concept of “algorithm”. It comes from the natural desire to more accurately define and identify their goals and actions. In addition, visualization helps to better comprehend the conceived idea and develop it. For example, the hieroglyphic entry in the pyramid “Mummified should be like this ...” could well be considered as a visualization of the algorithm.
If we talk about programming, the first thing that comes to mind is a block diagram, the most obvious example of visual programming. When you were students at the first laboratory work, you might not have done the tasks on the computer, but rather you plotted and handed over flowcharts on paper.
')
The flowcharts (at least in the days when I was studying) were followed by Pascal, and after him by the divine Delphi. When I first saw Delphi, I was amazed: I could make a simple program by writing 10 lines of code (another 20 were generated by Delphi itself, but who cares). In fact, Delphi, Visual Basic and other environments, in which everyone was then actively working, were the first mass examples of visual programming. Yes, you wrote most of the code yourself, but you could already throw events, change data and make an interface through convenient UIs.
Probably, the process of visual programming was so attractive that people fell ill with a button-type button ... By the way, a screen from the program of 2008, from the article “ Interface for which you need to kill ”The modern concept of visual programming
Where did this desire come from - to write a program without code? Well, firstly, there is an opinion that the code is difficult. It `s Magic. These are scary squiggles that you can't figure out without a matrix operator. But with all this programming is great, prestigious and, as a rule, pleasant from a financial point of view. Hence the desire to be a programmer, which is faced with the reluctance or fear of writing code (and laziness, so far without it). Therefore, we are always looking for tools that have powerful functionality, but are easy to learn. This process can be traced everywhere: simplifying the concept of software, simplifying interfaces, simplifying web services, and the like. By the way, the same processes occur during the evolution of "ordinary" programming languages. Just compare COBOL and Python.
Obviously, you choose the right side, at least it is pleasing to the eyeIn addition to the above reasons, visual programming is great for learning. In my opinion, this is one of its best applications. Visualization allows you to better understand the algorithms and relationships of classes and functions.
Considering modern means of visual programming, it is not necessary to immediately climb into 2017. There is a good
Google Blockly project whose main function is educational. The small review of this language was already on Habré. Blockly is very interesting and great for teaching children how to program, it can be used for schoolwork. Although, personally in my opinion, the "puzzled" language system does not allow you to immediately feel all the connections of your program. You have to unravel the puzzle like a tangle.
If you take the last ten years, then you can note quite a few attempts to implement a convenient and effective system of visual programming, although so far no one has managed to take off. In any case, technical progress is on the side of visual languages. Power and technology are now such that you can easily draw any constructions in the browser using anti-aliasing and various visual effects.
The performance of the average computer has also increased: now you can easily run Unity or Unreal Editor and not be afraid that your PC will smoke. These changes led to the emergence of a new word in visual programming - Unreal Blueprint.
Unreal blueprints
March 19, 2014 Unreal Engine 4 was released to the public and began free distribution for all comers with a subscription for $ 19 per month. One of the most striking features of this version of the engine is the new Blueprint development environment (in our opinion, drawings).
Where did the name come fromBlueprint is a visual scripting language that allows you to write game logic without the use of programming languages. At least that's what he says. The project consists of nodes (nodes) that are connected by data lines. Each node can represent a function, an event, an operator, and so on.
Blueprint node examplesWhen I first saw this system, I was delighted. It looked insanely simple and elegant. At the same time, the program was read as easily as a block diagram. It was possible, barely glancing, to understand what the algorithm was doing.
An example of sorting. It looks quite normal.From a visual programming point of view, Blueprint is a beautifully crafted concept that is likely to accelerate the development of this technology. At the same time, systems like Unity Playmaker already existed before it, but, in my opinion, they are far from being so well implemented and are just a small add-on to the code. At the moment, other solutions with similar technology have already started to appear, for example, the tool for creating SQL queries -
VAX . In the article, the author indicated that the idea came to him just after becoming acquainted with Blueprint.
In my opinion, the creation of games is a field of activity where visual programming can be used truly effectively. If we take a simple puzzle or arcade (I emphasize: simple), it can be divided into elementary gameplay blocks, which the developer rewrites again and again in each project (well, or simply copies). Why not create a library of these elementary blocks? It is with them that you work in Blueprint. Moreover, now it is already possible to divide the functionality between programmers and game designers. Some will write the stuffing for the blocks, while others will combine them into a ready-made functional.
The future has not come yet ...
With all the amenities of Blueprint, I did not find large projects made exclusively on it. There are a couple of products from small teams, and they are, for the most part, very “small”. Apparently, at the moment it is impossible to create a serious project on a “clean” Blueprint, you will definitely need to write C ++ code.
In addition, there are problems with really large blocks of our drawing. You can write bad code even in a powerful visual programming tool, so if you do not think through your algorithms, you will get something like that ...
This, of course, is an exaggeration, but believe me: in Blueprint you can do something terrible that you want to burn immediately. In addition, even a well-structured project can take up a lot of space and look like an octopus who wants to devour you.
Of course, the whole project consists of separate classes, but the big algorithms still look weird and scary.
A * implementation by one of the engine users. Taken from the Unreal Engine forum.As you can see, not everything is so simple. Games still cannot be done with a single click of the mouse, programs cannot be written without code, but we are gradually getting closer to such technologies. The main question - is it good or bad? One way or another, the future has not yet come.