Game Development and Media Reviews

Tag: unreal engine

Make Your First Game Asset

Have you ever wondered how to make a video game asset from start to finish? This tutorial covers the creation of fully destructible crates using only the freely available tools Blender, Krita, and Unreal Engine.

Step 1 – Make a Crate With Blender

We start by creating the crate mesh in Blender. We do this by slightly insetting all 6 faces of a cube. The new faces in the center of each side have to be slightly extruded inwards after that.

When insetting faces, make sure select every face and to check Individual.
Open the context menu and select Extrude Faces Along Normals.

The crate has be hollow to support the destruction effects within Unreal Engine. Therefore we create a 2nd cube and move it inside our crate. The cube has to be scaled down to be slightly smaller than our crate. We can then use a Boolean modifier to remove the insides of the crate.

The size of the cube inside of the crate (black outline) determines the thickness of its wooden walls. Create a Boolean modifier and select the 2nd Cube as the Object. Apply the modifier to make the change to the crate permanent. Don’t forget to remove the 2nd cube before export.

Uniform meshes can look pretty boring. I recommend you to add imperfections to the mesh by creating a couple of loop cuts and moving some vertices around using proportional editing. This gives the mesh a bit of character which works great in a low-poly environment.

Adding 3×3 loop cuts (CTRL + R) to the cube enables you to slightly deform the crate using Proportional Editing – the sphere of influence can be scaled by using the mouse wheel.

Open up the UV-Editing screen and add a new image with a size of 256×256. Save that image to a file called ‘CrateTex.png’. Select the entire mesh and export the UV-Layout to different file. Create and name a material. Assign it to your crate. Link the base color of the material as a image texture to the newly created image. If you switch the shading mode of your viewport to material preview, your box should appear all black – just like the created texture.

The UV-Layout can be exported under UV -> Export UV Layout.

Step 2 – Use Krita To Make a Texture

Import the UV-Layout into Krita with a canvas size of 256×256. Create a new layer beneath the UV-Layout and fill the background with a darker brown. Select the square areas in the center and paint them in a lighter tone. Feel free to add some details like a text saying ‘FRAGILE’ or paint an arrow pointing up.

Hide the UV-Layout layer before you export the result back into the texture file.
Reload your texture in Blender (Alt + R) and verify that everything looks correct.
Export the crate into an FBX file.

Step 3 – Create a Destruction Effect In Unreal Editor

Create a new First-Person blueprint project in Unreal Editor. Import the created FBX and the texture by simply dragging the corresponding icons into the editor.

Edit the imported material and make sure that the texture is sampled. Set Roughness to 0.9.
Go to the Plugins window and make sure ‘Apex Destruction’ is activated. Otherwise, the option to ‘Create Destructible Mesh’ will be missing.

Click on the imported static mesh and click on ‘Create Destructible Mesh’.

Open up the destructible mesh and play around with the ‘Cell Site Count’ to control the size of the resulting fragments. A higher number means smaller fragments.
Create a new actor called ‘Crate’. Replace its root component with a destructible component.
Link the component to your destructible mesh. Check ‘Simulate Physics’ on the component.
Make sure to apply radius damage to the mesh

Place the box in the level by dragging the actor into the viewport. Shoot at it.

Step 4 – Make It More Interesting

Hope that helps.

How To Get Started With Blender and Unreal Engine

Learning how to create simple models with Blender that you can actually use for game development might seem impossible to a lot of people, especially to programmers who don’t feel like they are artistically inclined. However, after +50h of practice, I found myself having the confidence to create simple game assets myself. Here is how I got started.

I stumbled upon a couple of very interesting Blender tutorials by Grant Abbitt on Youtube. He teaches very simple techniques for absolute beginners and his videos feel more or less like a mixture between painting tutorials a la Bob Ross and Lego instructions. These Beginner Exercises are very easy to follow but often ask you to try things out for yourself first before continuing with detailed commentary.

After finishing the first four beginner exercises, I started to look into creating an actually usable asset. This is when I jumped to the Low Poly Well Tutorial. This tutorial consists of three parts and yielded a very decent result. I especially liked how this tutorial challenged you to create some of the easier stuff yourself. This gets you into the right mindset by forcing you to think and plan ahead when modeling.

The well tutorial teaches you how to add different colors, bumps, and dents to your mesh in order to combat uniformity and to create a visually interesting result with a bit of character.

After finishing the well tutorial, I wanted to move on to something bigger – something that I could export to Unreal Engine, something I could animate and show off. I wanted to create a product that people would like and enjoy. The ideal guide to support that goal was the Sea Shack Tutorial. The tutorial consists of twelve parts but the actual geometry was modelled in the first six. The construction of the shack is briefly explained but you are left on your own after modeling the lower platform. The creation of twelve easy objects in the scene is skipped too. However, the shack and the other minor models should be pretty easy to recreate with the previous tutorials in mind.

The final result in Blender. I added a camera path with a little dip in the back to get the most out of the scene. There are some screen space reflection artifacts remaining that I was not able to fix.

Getting Your Assets Game Ready

In order to make the assets available in Unreal Editor I had to export the scene as an FBX file that can be easily imported. Joining all elements of the scene together enables you to easily transfer the whole scene layout as a single static mesh to Unreal Editor. Make sure to name all the materials you are using because those names are used to create material assets in Unreal Editor during import. Most material assets need at least a little tuning when it comes to shininess. Cloth materials require back-face culling to be deactivated as both sides of the mesh need to be rendered. The recreation of the water material needs most of your attention though.

The most complicated material to recreate in Unreal Editor is the water material. Make sure to set the render mode to Translucent and activate the checkbox next to Screen Space Reflections.
During the modeling process in Blender, some normals might have been flipped. Objects with flipped normals will not be rendered correctly due to back-face culling. You can check your normals by activating Face Orientation. Blue faces are rotated towards the camera and are fine while red faces are not. This can be fixed by pressing Alt + N -> Flip in Modeling mode.

After the initial import of the scene with all components joined together I removed the fish meshes from the Blender scene and exported a single fish mesh separately. I wrapped the fish mesh in a fish actor that is animated via Blueprints. The fish actor was then placed, scaled and rotated multiple times to replace all previously existing meshes. You need to do this for every additional element like the seaweed or the flag that you want to see animated.

The animation blueprint for fish moves and rotates the mesh slightly back and forth. The random time offset is helpful to prevent a uniform animation look.
I presented the final result from Unreal Engine on reddit to figure out the market appeal and received over 600 upvotes. The negative comments focused on the chosen coloration.

While I’m personally really happy with the result I do think that the scene and I might benefit from additional optimization:

  • This little animation currently requires 30 single color materials. This number could be vastly reduced by mapping a texture onto the mesh.
  • The walls of the shack consist of multiple individual boards. The number of vertices could be reduced by using a single simplified mesh and a normal map.
  • Bones and Rigging could be utilized to improve the fish animation.

Hope that helps.

© 2021 Schifty's Blog

Theme by Anders NorenUp ↑