
The most graphically impressive project of our hackathon was Skyeng Action. When the author presented his idea on the eve of the event, few people believed that it would be brought to working condition in two days. Nevertheless, the team of three previously unacquainted neither with each other nor with Unity developers successfully coped with the task. We tell how it was.
Idea
When we make our applications, we almost always try to gamify them, add some elements of the game: achievements, prizes, competitiveness. In this case, the idea was to go from the opposite: to take the game as a basis, and to introduce elements of training into it.

')
Gradually, this idea crystallized into the concept of a 3D toy, built on a short game cycle of a minute or a few minutes. This is not Far Cry to stick for hours, but the ability to quickly run somewhere, practice a few words and go about your business again. The toy should be networked, one on one with the person, and not with the bot. Three-dimensional maze, which you can stupidly run all over from the beginning to the end, and you can find special gates that allow you to cut, if you remember the word correctly. Accordingly, the winner is the one who recalls words faster and more accurately - well, if the score is equal, the one who “runs” faster in the virtual space.
Given the limited time of the hackathon, it was decided to make the logic and one level (with the ability to quickly add new ones later); sew the words for the demo version directly into the game (so as not to be distracted by other tasks such as connecting the Skyeng API); for now, abandon any backend and make direct connection of players to each other over a local network, in which one acts as a server and the other as a client.
Team
Three people entered the Skyeng Action team: two Kodili, the third designed levels. Plus, the fourth "freelance" 2D-designer who helped with the design of menus.
It is noteworthy that these three developers before the hackathon were not only not personally acquainted, but also had practically no experience with the tools on which everything was done. The author of the idea wrote toys a long time ago at school, with Unity, I picked a couple of days at my leisure and had Java programming experience, but not C #; the second developer had experience with C #, but not gaming; Well, the level designer never did anything like that (a developer without experience with Unity and C #) - he just came to the hackathon without a team and joined on the spot.

As a result, the process of creating Skyeng Action turned out to be no less fascinating than the result: full-fledged teamwork built from scratch. Considering that everyone was engaged in their own part of the project, and its assembly took place on the night before the presentation, it was at least amusing. Colleagues who at two o'clock in the morning watched a rectangle soaring in the void on one monitor, pieces of code on the second and a set of static pictures on the third, did not believe that this project would be brought to mind. However, at three o'clock everything worked, and at the presentation these colleagues were quite surprised.

Device
To write a 3D toy in two days from scratch is an impossible task. Fortunately, Unity contains a simple and clear level editor and a huge number of ready assets, both in the library of standard components and in the
asset store . Unity allows you to quickly construct an MVP, a minimally viable version of the game, using off-the-shelf components that are not always ideal, but at least show the logic of the process. For example, the same door is not so difficult to do on your own, but this task would have eaten precious time; a ready-made object was used, which varies in geometry, speed and direction of opening, texture. As a result, the game logic and some unique elements were written independently, and the environment and interaction of objects are taken from the library (Nature Starter Kit 2, Character Pack: Free Sample, FirstPersonCharacter). For multiplayer, what was also used in Unity was used: client and server in the same application; On one computer, a server is started that sends a message on the local network, on the other, a client that waits for this message (the built-in components NetworkDiscovery, NetworkManager, NetworkIdentity, NetworkTransform).
However, the work on the project was not limited to dragging ready assets into the basket; It was written about a thousand lines of code. One of its own objects was a tablet attached to the door and showing a puzzle with the word.

Below are a few code fragments from the component that defined its behavior (it implements the transfer of control to the camera that is not tied to the player, it approaches the tablet):
Coroutine in Unity is a process that can take more than one frame. Approaching the camera to the tablet is one such process.
public IEnumerator MoveCamera( Camera camera, Vector3 source, Vector3 target, Vector3 positionSource, Vector3 positionTarget, Camera cameraToActivateInTheEnd) { float animationStart = Time.time; float animationEnd = animationStart + cameraAnimationDuration; while (Time.time < animationEnd) { float phase = (Time.time - animationStart) / cameraAnimationDuration; camera.transform.forward = Vector3.Lerp(source, target, phase); camera.transform.position = Vector3.Lerp(positionSource, positionTarget, phase); yield return new WaitForEndOfFrame(); } camera.transform.forward = target; camera.transform.position = positionTarget; if (cameraToActivateInTheEnd != null) { flyingCamera.gameObject.SetActive(false); cameraToActivateInTheEnd.gameObject.SetActive(true); } }
Fly back to the camera tied to the player:
Vector3 source = flyingCamera.transform.forward; Vector3 target = playerCamera.transform.forward; Vector3 positionSource = flyingCamera.transform.position; Vector3 positionTarget = playerCamera.transform.position; StartCoroutine(MoveCamera(flyingCamera, source, target, positionSource, positionTarget, playerCamera));

Result
Summing up, we can note the following:
- The team members got acquainted with brand new tools that they had not dealt with before. It was possible to avoid the situation at all “a hackathon is the same job, only in the forest”;
- the ability to quickly prototype 3D applications and games using Unity and a certain enthusiasm was demonstrated;
- the MVP-version of a simple toy with useful educational content was brought, which can be quite easily developed and maintained;
- a wow effect was achieved on the presentation, since no one expected that such a colorful picture could be achieved in two days.
But the main thing - all this was done by people who actually met at the hackathon and managed to quickly establish teamwork.
And we remind that we are constantly in
search of cool people in our team !



