📜 ⬆️ ⬇️

Unity - a free cross-platform 3D engine (and browser too)

Preamble


So today I would like to tell you about Unity (to those who are not yet familiar with it, at least). Of course, there are people on Habré who know what it is, but the search gives a disastrously small number of topics mentioning the subject - two of them simply report new versions, one presents briefly and another one is dedicated to its use. “It is unforgivable, it is necessary to fix it!”, I thought, and decided to write a short presentation with the aim of popularizing the technology. If you are already in the subject - then you can not read.

Honestly, when I read on Wikipedia about a free (at least with a quite normal functional license) 3d engine with a normal IDE, built-in normal physics, an audio engine and a direct implementation of network multiplayer on which you can make applications for everything except , perhaps, nix'ov (Windows, MacOS, Wii, iPhone, iPod, iPad, Android, PS3, XBox 360 are supported and work normally), I already smelled a trick.

When I found out that any application under Unity can be assembled into a special version for a plugin embedded in the browser, and I see honest, full-fledged tride in the Firefox window, while not understating the quality of models and resolution of textures - I was almost sure that this was always in such cases, complete nonsense.
')
And when I put this miracle on myself and became convinced of the truth of the above, I almost fell in love.

Many times, technologies have appeared that have set themselves the goal of transferring honest tride to the Internet. Recall the failure of VRML, a little less of the failure of ActiveWorlds ... Today, almost no one remembers them. Soon the whole world will be flooded with HTML5, a new Flash will be released with 3d acceleration ... But until that happens, the world of multimedia content on the web is ruled by the current version of Flash, along with Java and Silverlight. Perhaps even just Flash. The developers use creaking to use other technologies, it is understandable - it is difficult to force the user to install another third-party plugin just to play one game / watch one site.

However, with the release of a new, third version of the above engine, you can think about how to reconsider their views on your favorite flash. In the end, if the giants of Kongregate-type flash toys paid attention to this technology (in particular, they announced a contest for the best game on Unity) - it is worth at least looking at it.

You can see a lot where, but for example, here are some links. The links will offer you to install the plugin - it weighs kilobytes and works without rebooting the browser (unfortunately, the size of the demos could not be calculated, so be careful - the dimensions may be around 30-50 meters):

Let's try to figure out what kind of a beast it is, and whether it really is as good as it is painted on the office.

Pro et contra


For a start, we will define the terms. Unity is a full-fledged game engine, designed for the fact that the entire development process (well, except for resource preparation and scripting) will occur in the bundled Editor Total. Usually such a question means a non-viable monster, overgrown with a stunted GUI, but do not indulge in the most, designed to make teenagers from the game-play-bath-gob sense feel involved in game play. But do not close the tab with this topic yet - Unity is not from this test. So what is Unity good for? Let's see, and at the same time compare with the UDK - SDK to UnrealEngine 3, which Epic Games recently made free for independent developers.

Good Unity:

Somehow like this. Now let's discuss what is wrong with him:


Honestly, I don’t see any real disadvantages. The engine is stable, productive, easy to use - and what else is needed? There are certainly drawbacks. So, I often stumbled on reports about strangely working additive blending of animations. Some complain about the lack of assignment of multiple materials to terranes - I do not know, have not tried. But is it significant in light of the above advantages? For me, no.

The fact is that for most small teams, the main problem has always been the engine (well, the lack of ideas and good art, of course, but we are not talking about that now). Writing from scratch - the only programmer in the team is difficult to do, given that the engine is not only a 3d-render, it is also a lot of pipeline tools - importers, editors, viewers ... It’s an impossible task if you don’t stick to minimalism. Minimalism is not bad, so many great games are made in all our favorite 8-bit style, which is not considered ... But most of them are short-lived (Minecraft doesn't count, yes. And by the way, it was also written not from scratch, but on LWJGL). When it comes to a game that will be played more than one day, you need a full-fledged engine, and then we start looking for free solutions. Ogre, Irrlicht and a few like them are good, of course, but a) are morally old and b) it takes a lot of time and a large theoretical base to study them and finish them up to working condition. Of course, you can also write a cool project on them (Torchlight on Ogre is an example), but you still need more than one programmer. There are sets a la "games without knowledge of programming languages," such as GameMaker, but these are toys, the right word.

In the case of Unity, we already have a ready-made pipeline, a ready-made renderer, a ready-made physical, audio and network libraries, you can code in a familiar language - in fact, from coding, we only need to know the basics, let's say Javascript, and dig into the official certificate to rivet FPS. Minus one barrier to release. If someone does not believe in the quality of code written by someone else’s hands, which cannot be corrected - check it out, it's not so bad at all.

What it looks like


Pictures are clickable.

Actually IDE:

image

Directly in the IDE, you can click the "Play" button and test the current realtime scene:

image

The built-in class inspector probes, sorry for the tautology, classes for variables and allows you to change variables in scripts on the fly without looking at the code. And not only int'y, but also materials, textures, models ... It saves time. In the API documentation, it is indicated in a good way not to write, say, the path to the texture directly in the script, but simply to make the class property an empty property of the appropriate type, and select the necessary one in the inspector:

image

Prefab Inspectors (right) and Entities (left). Roughly speaking, on the right - the preparation of objects, on the left - those objects that are in the current scene. Conveniently, during the level run in the editor (the “play” button), you can pause the run and see the current state of the objects — you rarely have to read logs or output a debug line to the HUD to view the behavior of one small variable:

image

And in the end I will tell...


Summing up all the verbal garbage up to this point, if you are doing an AAA project, you will most likely write your engine. Or do you already have an engine from the past project. Or you buy something of the level of the notorious UnrealEngine 3 with the source code. But this is if you are doing an AAA project with a dozen people only on coding.

If you have only ten people in the studio (and even more so, two), writing your own engine is usually too expensive. One temptation to be on the wave of full-fledged browser-based 3D games (java-wrapper for Ogre does not count. Well, the truth is) is worth it to try Unity in practice. The speed and complexity of developing a conventional browser kazualki on it is not higher than that of Flash, and the graphic superiority is obvious. And no one has yet canceled the wow-effect.

In the end, you can make websites on Unity (arguably, but you can), presentations, visualize research projects ... You could write all this manually, on pure OpenGL, but comparing the time and quality of implementation, I still tend to the Unity option . Flash is also not taken into account yet - let's wait for the release of hardware 3d acceleration.

Such words will cause a storm of emotions among adherents of other engines. “Yes, it’s all there and in% enginename%,” “% enginename% made% gamename% and% gamename%, and all this without a nasty all-consuming drag'n'drop” ...

I will advise you to simply give Unity a chance - with its convenience, capabilities, flexibility and speed of development, it is captivating (at least it has bribed me). And besides ... Hey, this is a full-fledged tride in the browser! :)

UPD: ghisguth rightly reminded about the Russian-speaking community (quite large and active) and the storehouse of scripts, as well as the storehouse of user scripts and tutorials .

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


All Articles