Jump to content

Learning UE4


Beck
 Share

Recommended Posts

Hi all,

 

Recently I got myself a subscription to Unreal 4 with the aim to learn the engine and eventually create a small game by myself using the skills I'd have learnt along the way.

 

So, in this thread I aim to show what I'm currently learning from tutorials and by myself. I guess I will talk about each tutorial, like what problems I may have had and how I overcame them and hopefully it may be of some use to some of you guys too. Hopefully you guys will join in the discussion too :D

 

Anyway I'm trying to learn one new thing in the engine each day. Be that materials or creating a simple pick up. I'm currently working through the tutorials on Epics YouTube channel.

 

Below are some examples of what I've learnt so far:

 

Creating a small scene. (Included use of geometry tools, material and prop placement, lighting and some blueprint work to create a moving door.)

Tutorial followed: https://www.youtube.com/playlist?list=PLZlv_N0_O1gak1_FoAJVrEGiLIploeF3F

 

 

ZmPwM6Q.png

 

This was a pretty straight forward tutorial at the end of the day. If you've used other editors in the past, such as hammer, you'll pick up the geometry tools in no time. Simply drag in a box and set it's dimensions and you have a wall etc.

 

All of the models you see in the scene come as part of the engine so there's no need to worry about that kind of thing if you want to give this a try. The only downside with UE4 is there's not much content you can use from the get go. Unlike Source which has years worth of props and materials from established games which you can dive right into and create something. But as a whole, I felt the tutorial was worth it to get used to the way a simple scene is created in the engine.

Overall it took about an hour and half to do this tutorial.

 

Flashlight (Included use of class blueprints)

Tutorial used: 

https://www.youtube.com/watch?v=lPuBZYPEr4k

 

2ot7WoW.png

 

This was a nice and quick tutorial which gave me some quick results whilst still teaching me a fair bit which is always nice!

 

Basically, the tutorial introduced me to attaching a flashlight to a character which can be toggled on and off.

 

The great thing about UE4 is it's easy to assign a button to your project for use within blueprints (I'm not sure how easy this is in other engines like Source). Simply going to Edit> Project Settings> Input you can create a key which you can use in your blueprints. Alternatively, you can just place an input for any key you wish straight into the blueprint but you can't name it and quickly call that button press in another blueprint without assigning an input in the project settings.

 

Anyway, didn't really have any problems with this tutorial and as mentioned taught me how to attach something to the character and also ensure it was aligned to the players aim.

 

 

Material Instancing (Included creating parameters which designers could edit, material editor)

Tutorials sued: https://www.youtube.com/playlist?list=PLZlv_N0_O1gbQjgY0nDwZNYe_N8IcYWS-

 

Y8GkwZN.png

 

This was an interesting tutorial. I'm not a great texture artist by far so it was nice to play about with the material editor with some nice premade textures to see what it is capable of. What I really liked was you could instance a material to create a completely different material with just a few adjustments. These are apparently great to use since the calculations for the material are only done once, and any instances of a material don't need to be calculated again.

 

The tutorial also taught me how to create properties which designers could use to quickly change the look of a texture. These are created in the material editor and can be accessed in the material viewer by the designers. On the left in the screenshots you can see fields for the base colour of the material, metallic and roughness settings and the textures used for the diffuse and normal.

oGbKKUD.png

 

These can all be adjusted in real time to allow designers to get their desired material. So if you wanted wood floors with a slightly different colour or a polished look it would literally take a designer about 10 seconds to create without having to go ask an artist or create a brand new material themselves. 

 

 

 

I'm not sure if any of you guys are interested in this stuff. But in the engine discussion for the challenge UE4 got a lot of votes. So I'd thought I'd post my experiences so far with the engine to hopefully show people it's not as scary as some of you may think :) Also, it motivates me to do more work!

 

Anyway, any questions or comments please feel free to reply to the thread. Would like to hear what you guys think.

 

My descriptions of each tutorial might not be great. If you guys want to hear anything specific about the process I'm going through whilst learning, let me know and I'll try incorporate them into my posts!

 

I'll try to update this thread whenever I've learnt something new.

 

Cheers!

Link to comment
Share on other sites

Cool stuff, I did the same about a week ago. It is pretty fun to mess around and see what you can do, but it also seems a fair bit different than kismet.

Some of those video tuts by Epic are a little frustrating since they can get so distracted with visual polish stuff when trying to teach a technical subject. There are also some community tutorials that don't actually teach you anything. They just tell you to do a bunch of stuff, which is not a great way to learn. If anyone finds good tutorials please post!

Did you have any luck making an interact trigger (one that you have to aim at and then press a key)?

Edited by Algor
Link to comment
Share on other sites

I found these two very useful (the first is really long though):

 

https://wiki.unrealengine.com/Blueprint_Automated_Door_Tutorial#Making_a_Useable_Door

 

https://wiki.unrealengine.com/Blueprint_Lift_Tutorial

 

Between them there should be enough information to work out how to set up a useable trigger, I set up a switch that can be used to unlock a door after going through these

Link to comment
Share on other sites

I've not tried to actually look at a trigger and pressing a key to activate but I guess I've done something similar.

 

Place a trigger around the object you want to "press" like so:

MNfWNiN.png

 

Then within the blueprint (I made a class blueprint for the light), when the player overlaps the volume you enable the input from the player. Then tell the input where the input is coming from (i.e. the player). You can also disable input when the player leaves the volume. Like the script below:

5R47xis.png

(After the player enters the volume I've also made some helpful text (a message saying "Press F to toggle light") become visible and it will also hide when the player leave the volume)

 

Then you basically set a key you wish to use for the "switch" and toggle the visibility on the light like the script below:

uLxWJZH.png

(I am toggling the visibility on two lights since the light has a directional light and an omni light for some ambience)

 

So with that script, whenever I'm inside the volume, I can press F to toggle the light on and off :)

 

I hope that helped a bit. If you'd like a professional tutorial not wrote before I'm about to go to bed then check out this video (I'd recommend watching all of them in the playlist):

 

Any questions just ask and I'll try to help out :)

 

Edit: Thanks for the links Paul. Didn't know they had more tutorials on the wiki! 

Edited by Beck
Link to comment
Share on other sites

Thanks for sharing, it's always good to have some useful Youtube tutorials referenced because a lot of them tend to be overly lengthy/unhelpful and it sucks wading through loads of them trying to find the good ones :) some of the basics like material instancing are probably equally useful for people picking up UDK as well.

Edited by spence
Link to comment
Share on other sites

Yea i'm currently in the same stage of learning UE4. It's a bit of a bumpy ride with ups and downs. That comes mostly from never having worked with Unreal properly i guess. The level design basics are easy to pick up but material system and blueprints can make my head spin. I feel like it takes me way too long to figure out some basic stuff with it when i don't have a tutorial that i can follow step by step. I guess in time it all starts to make sense but the initial learning curve is steep. For instance i try to make a layered material for terrain from world machine right now and that puts me right into a mess of nodes and a plethora of contradicting tutorials from people who are still learning themselfes.

Link to comment
Share on other sites

Steppenwolf, look at unreals documentation and then look at their content examples, user created tutorials arent really up to par yet. For terrain you can check out the vehicle game in the game library.

 

Ah yes good point about the vehicle game. Haven't thought about that. The documentation could be better imo. Ther's lots of different documents for the same topics cross linking each other. It's rather confusing. Wish they had official tutorials for intermediate and advanced level materials. I learn best from step by step videos. The basic tutorials are good at least albeit the guy talks a bit too much and often doesn't get straight to the point.

Link to comment
Share on other sites

I found this which covers a lot of ground;

https://docs.unrealengine.com/latest/INT/Resources/index.html

 

I found this last night where Mr Chops walks you through making a use trigger. Most tutorials seemed to skip the part of making your own PlayerController which has the critical "send Click Events" and "Send CursorOver Events" :o.

 

After about 30 minutes I finally made a use trigger... I guess I will be starting at the basics :P

Link to comment
Share on other sites

The landscape system seems to be really fucking hacky. 16 texture inputs limit so realisticaly you get 4 maybe 5 somewhat basic layers out of this for the whole terrain without a lot of trickery/magic. And there doesn't seem to be a way to feed material functions into the landscape layer blend so you have to make your submaterials directly inside the landscape material wtf. So no easy way to switch out sub materials and it's a node mess galore on top of it. I hope Epic releases their landscape demo soon. Want to see what magic they use to get around these limitations.

Link to comment
Share on other sites

Is that assuming that you are going to have separate maps for everything (ie each layer has a separate diffuse, normal, spec/gloss, etc) since that would be 3-4 texture samples per layer?

You can do things to reduce samples like packing b+w masks into alphas or single channels of a single texture then using only that channel as the mask (in combination with component mask nodes). If you are using a lot of grayscale/b+w maps/masks you can cut your samples down easily this way. You can derive your spec masks from a base texture or one channel of a normal map and then use math nodes to adjust/tweak the map at will, saving you extra samples. I don't know about referencing other material solutions as a parameter though. Someone with more experience with UE might know. If I remember there is a node where you can paste in raw HLSL shader code generated from the material editor so maybe this would be useful.

The nodegraphs get quite messy I find in my (limited) experience but you can use comment boxes/nodes to help with this. When you move the comments around the nodes move as well.

Edited by spence
Link to comment
Share on other sites

I found this which covers a lot of ground;

https://docs.unrealengine.com/latest/INT/Resources/index.html

 

...

 

Thanks for the links Algor! I've seen that guy on YouTube before but didn't know he did UE4 stuff!

 

The landscape system seems to be really fucking hacky. 16 texture inputs limit so realisticaly you get 4 maybe 5 somewhat basic layers out of this for the whole terrain without a lot of trickery/magic. And there doesn't seem to be a way to feed material functions into the landscape layer blend so you have to make your submaterials directly inside the landscape material wtf. So no easy way to switch out sub materials and it's a node mess galore on top of it. I hope Epic releases their landscape demo soon. Want to see what magic they use to get around these limitations.

 

The landscape demo is on the coming soon part of the store, so it shouldn't be far off! Some of the terrains I've seen in UE4 have been beautiful. Hopefully it's not as hacky when we see how Epic does it!

 

 

So today I did a custom projectile tutorial!

 

Custom Projectile (Included class blueprints, bit of blueprint logic)

Tutorial followed:

 

This is just a quick tutorial from Epic so you'll probably have to keep pausing the video to keep up with what's going on but it's not too bad. Basically you start out creating a class blueprint for the projectile which consists of a bounding sphere and a model to represent the projectile. You also add a projectile modifier to the blueprint and give it an initial speed and direction of travel. From there you load up your character blueprint (I used the default first person blueprint but deleted the gun and projectile from it) and create the graph to spawn the projectile. 

 

Taking the position of the character along with the direction it is facing you can spawn the projectile from the characters location. After doing a bit of maths to make sure the projectile doesn't spawn inside the character you have yourself a projectile firing from your character!

The script for this looks like this:

DhljF8k.png

(I've added a comment to explain what is going on in the graph)

 

Compile the blueprint and press play and sure enough you have a projectile flying out from in front of you!

 

However, the tutorial failed to mention collision of the projectile. I went back to the projectile blueprint and selected the bounding sphere and changed it's collision properties to collide with everything. Loaded the game back up and fired my projectile. It collided but then just stayed there, leaving me with this:

 

vGxUMgQ.png

 

This would not do.

 

Going back into the projectile blueprint I had a look around to see if there was anything I could turn on to give me some feedback at when it had hit something. I noticed a check box, which when enabled, fired off a hit event. 

 

VUYFiuO.png

(Top check box here)

 

From here I headed back into my character blueprint where the projectile spawning was handled. Now, I had no idea what I was doing here so I just went in and tried doing stuff. I noticed coming out of the SpawnActor node for the projectile there was a return value pin. With UE4 being context sensitive I tried pulling out a wire from here and searched for "Hit". Sure enough there was an OnActorHit event. I selected it and the blueprint automatically set the "Bind Event" and "Hit_Event" nodes seen below for me.

 

Out of the event I dragged out another wire and search for destroy. Again, the node I was looking for was waiting for me so I placed it and connected it up. After compiling the script I ran the game again and shot out a projectile and it disappeared upon hitting something. Success :D

 

Here's the little bit of script which destroyed my projectiles:

JzxgnxR.png

 

Now I wanted to do some extra things here. Firstly I wanted to add some random rotation to the projectile since they all spawned in the same orientation (As seen in the second screenshot). I couldn't figure it out but I'm pretty sure you could add some random rotation just before you pass on the location the projectile should spawn from.

 

I also wanted to add some particles to cover up the projectile disappearing but couldn't figure that out either. I have seen other projectile tutorials so will chase this up. :)

 

Cheers!

Link to comment
Share on other sites

spence, with just 4 layers from a world machine terrain you have: 4x albedo+ 4x normal for sub materials, 1x splat map for layer maks, 1x albedo+1x normal for macro terrain, 2x landscape coordinates (which seem to count aswell for some reason) and you sit at 13 inputs already. Throw in some detail normals, blend mask for sub materials, rougness maps and it gets really tight. Add a fifth layer and you can pretty much forget about any fancy extras. (and i was silly enough to work something out that spits 7 layers from world machine out)

 

Sure ther's ways with some trickery but that's quite a shitty solution for something so in the face of the player. I don't remember the landscape layering to be so restrictive when i did something similar in cryengine couple years ago. And here i thought epic had catched up with the landscape stuff. I guess ther's a reason why they used meshes for the backdrop mountains in their demo levels. Something tells me their landscape demo is gonna be super hacky aswell, some overlapping terrains, lots of meshes, some complicated material trickery etc.

Edited by Steppenwolf
Link to comment
Share on other sites

Ah right, I didn't know that things like coordinates count towards this limit but I suppose it makes sense because it is just a map of sorts in the end. Honestly I think that trickery like this will always be inherent to some degree (hell, you could probably pack two normal maps into one RGBA and derive their blue channels in the shader to free up some samples - there is a DeriveNormalZ node in UDK and UE4 for these kind of instances or you can do it with some math too) but I agree that it is a kind of shitty solution. I think you are right about why they use meshes for a lot of terrain stuff because in the public demos I've seen and picked at for UDK (the castle level for instance) the landscape implementation has always been super basic terrain layers with the more complicated bits on static meshes/multiple materials, but I guess the real proof will come from analysing the new landscape demo.

I was curious why there is a hard limit and dug around a little and it seems like this is a limit not set by UE but by shader model 3.0...

Edited by spence
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


  • MapCore on Discord

  • Our picks

    • Post in [UE4] Island Environment [W.I.P]
      I've release the project on the ue4's Marketplace. LINK

      There's also a playable demo that you can check out here: DEMO

      This was my most time consuming project that I've started back in 2018, but then scrapped and returned to it in 2021.

      It took about 8 months to complete and was a great learning experience for me. 





       

       

       
×
×
  • Create New...