Skyrim on Unity

Idea

For business! Fortunately, just half a year ago, I discovered the Unity engine and with it the Brackeys lessons. And my difficult, but very eventful month of adventures began. Now, of course, I am surprised that the project took only a month, but then the days lasted long.

Everything is in a fog, but the idea is captured
Everything is in a fog, but the idea is captured

First, it is worth describing my idea. Of course, I did not make a huge world, but a small part of it. As planned, the game was supposed to have a circular road, which would be limited on all sides by mountains. A mountain peak also had to rise in the middle of the road, so that neither Dovakin nor the deer, which I planned to release into the area as targets, could escape from this cozy region. The game was planned purely from the first person, so as not to suffer from switching faces, as was done in the original series. And from the weapon, I decided to give the player only a bow. Why a bow, I don’t remember, in my opinion, because I first came across a bow model when I was looking for weapons on the Internet.

In general, you have already guessed that I decided to simplify my task as much as possible. Smart move. The only pity is that the problems still remained to be solved by the sea.

First steps

The first thing I started with was looking for different models. I looked for trees, shrubs, grass, animals, rocks, and so on, on, on. BUT as you understand, my works were not particularly useful to me, although I found several suitable models and packages, and why I will tell further.

So, after searching and initial setup, the scene had the following:

  • deer model with animations of running, walking and so on

  • onion model, which I painted myself in Blender (a separate story)

  • a character walking, running, running a lot (alt) and not jumping a lot

The character is not visible in the photo, you look through his eyes
The character is not visible in the photo, you look through his eyes

Terrain

Do you see the compass too?
Do you see the compass too?

The beginning was laid, it remains only to add the terrain. But when it was created, I began to lose heart. The key was that Dovakin refused to walk on the land I added, as it was too bumpy, the mountains were too high, and the ravines were too deep. That is, I did not feel the scale at all. Imagine you are sculpting a small river near Whiterun. From a bird’s eye view, the river looks great, but when you descend to a height of two or one and a half meters, it turns out that your beautiful river for a small person is a real sea bay. And you are like a midget in the land of giants.

All my attempts to somehow smooth the terrain with the appropriate brushes have led to nothing. So I had to delete and redo everything. Again. And again. And again…

Scenery

sad spruce
sad spruce

But it was impossible to stop there (although I really wanted to). So I started decorating the area. And here it was necessary to know the mat. part. Well, I didn’t know her, and when I made an attempt to find out, I didn’t fully feel it. What I’m talking about? Plants in general and trees in particular. About what is SpeedTree and LOD group. In short, I suffered with the latter, scored and decided to make all the trees from scratch using the built-in Unity editor, as they say, cheap and cheerful.

It turned out not terrible, although if I could use the very models that I found earlier, it would be many times better. But:

  1. Best the enemy of the good

  2. Better a finished good project than an unfinished perfect one

  3. Thirty-three more sayings with which I console myself when something does not work out for me

As a result, I added more details to the surface: like small stones, the creepiest stairs that a person has ever managed to create, grass and rocks.

beauty and pain
beauty and pain

Graphics

But this was not enough, because the terrain looked poor, despite all my efforts, I remembered the post-processing with its enhanced highlights, shadows, vignette, color correction and pinned my hopes on it. But that didn’t have much of an effect either. Then I turned to a source of knowledge as inexhaustible as human resourcefulness and wisdom are inexhaustible. The Internet told me that it was the color space (color environment?), By default it is set to Gamma, and the gurus recommended setting it to Linear. Surprisingly, it actually worked.

But while I was fiddling around with all the Unity settings I could, I came across a tiny little checkbox somewhere inside the lighting settings. The checkbox with the tempting name fog was very attractive. I couldn’t resist and clicked on it. And then the circles of hell began, from which I had to get out for several days.

Fr-r-riz-z-zy

Frankly speaking, my computer does not handle the original Skyrim well either (meaning Skyrim before the Anniversary update, after this update, any vidyuhi, RAM and processors are powerless). But the way the picture began to lag after adding, damn it, fog, defies any description, neither obscene nor literary. I was very surprised when I discovered that the screen recording that I turned on to record the result of my labors was slides, not videos.

So, something had to be done about it. In the same lighting settings, I tried to bake the light. Of course, I didn’t get it right the first time. But it couldn’t be left like that. Therefore, the first was followed again and on some of them I succeeded. True, all the shadows disappeared, which is why some of them had to be generated in real time…

… Some time later, I managed to do everything, meet Pixar-level graphics:

Pua pua pua pua
Pua pua pua pua

Agents

run
run

Everything was ready, it only remained to fill the lifeless nature with living beings. As you remember, I already had a deer. It was only necessary to multiply it and teach it to move around the perimeter. The task is quite simple, I used MeshAgent and a set of points between which the deer had to ply. First, of course, I had to fix a couple of bugs, for example, there were bottlenecks on the mesh, in which deer crowded, bumped their sides, slowed down and could not decide whose turn it was to go first.

Another of the mistakes I can remember is that if two deer come to the point at the same time, they do not allow each other to get close enough to the point, so they start circling, like a swarm. The longer two deer circle, the more it approaches the point of other deer, and at some point it becomes like a cycle of madness. But in general, these bugs are pretty easy to fix. So it didn’t take long at all to complete the animal husbandry task and move on to the next task. I had to learn how to shoot a bow.

Shooting

Corner by the mountain - my respect
Corner by the mountain – my respect

The main difficulty in archery is the arrow. After all, if you want to implement melee combat, you need a sword strike animation, and a little Unity magic. With the help of not tricky calculations, after playing the animation, you will know whether the player hit the target or missed it. This is not the case with the arrow, it’s not enough to play the animation, you also need to insert the arrow into the animation as a separate object, and then shoot the arrow in a straight line, and so that the arrow hits the target, that is, in the middle of the screen.

In general, for me the task turned out to be non-trivial. At first, I just wanted to set up the animation so that the arrow would point to the center of the screen, and as it moved forward, it would automatically fly towards the middle. But she quickly abandoned the idea. Because in this case, when shooting the bow and hands of the model, which, by the way, I downloaded from the site Mixamo (recommended for beginners to work with 3D animations and rigging), obscured half of the view. It is also very difficult to set up the animation model and the arrow, the deviation from the straight line increases at long distances, and when the model and animation change, everything needs to be redone.

This is what it looked like in the paragraph above
This is what it looked like in the paragraph above

Although I later read somewhere, some do just that (everything is possible, I don’t rummage).

But I decided to do otherwise. I created a script that, during the flight of an arrow, aligned it relative to the center of the camera, which I previously saved, of course. Um, okay, you caught me, I did not immediately guess to save it. Okay, let’s not talk about sad things. The script, of course, is a good idea, but not ideal. The main jamb of my approach was that, of course, the arrow does not straighten out immediately, but gradually, otherwise it would look, frankly, not really. What would look special, it was necessary that the alignment also occur smoothly … In short, it does not always work smoothly. Either I was tired in the end, or I got lazy, but at some stage I decided that it was okay and so it would do. I accelerated the flight as much as possible and it turned out not so scary, but still somehow not straight, so that it was very and … It’s time to finish.

End of deer and my story

I also muddied the most miserable death of deer possible, when arrows hit the deer. The deer just fell like pieces of wood. Through the textures… Now I know about Ragdall, but I didn’t have time to use it and see how it works. But then I dried up and just wanted to finish with all this already.

And I also made an interface:

  1. Compass, real (spinning), not like on the screenshots above

  2. The lifeline of the enemy (victim)

  3. Name of the enemy (victim)

  4. all

Interface and death
Interface and death

I also made a trailer Dovahkiin’s Incredible Adventures In Unity according to what happened in the end. So you can see.

That’s all, if you’ve read it, you’re a hero!

PS Then I came back to this project again after a couple of weeks, and added Draugr, melee, waterfall and the ability to swim, but that’s another story.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *