Loading

WORK DAY 10 Projects in Action!

Today I started to bring the models that I had created in MagicaVoxel and Blender to life! As I'm shifting my focus for the voxel weapons project from just one game (Hyper Light Drifter) to two (Hyper Light Drifter & Robo Recall) I saw the chance to bring these weapons to life as Robo Recall mods so they could be animated and used as actually weapons, not just models.

MagicaVoxel recreation of Robo Recall's original pistol, by me

The pistol you see there is much more detailed than the previous Hyper Light pistol and was created in an exploded view so the exported obj model could be rigged inside Blender -

the rigged weapon

This new weapon in the line-up had to be torn apart so that the top slide, the carabiner, the trigger, and the lower pistol body could all have their own bones. the weapon was then exported as an fbx file and brought into UE4's Robo Recall mod kit.

the content Browser in UE4 showing the parts of the gun model

The imported model in UE4 consists of several parts:

1) The green object is the mesh's material. It's preview is dark here but it's actually a very bright model

2) The red object is the texture. Since this is a voxel model the texture is very simple.

3) The purple object is the mesh itself with all it's import transforms

4) The orange object is the physics asset, a group of collision boxes that decide when the object has been hit/hit something in game.

5) The blue object is the skeleton, the armature we created inside of Blender.

inside the material editor in UE4

UE4's material editor is quite slow on 16GB DDR3 machines, for some reason, but most of the node creation I needed for this was precreated for Robo Recall, so luckily I didn't need to wait around too long.

what a blocky gun! ... heh...

UE4 automatically creates physics objects in the shape of sphylls (essentially capsuloid pill shapes) around key bones of a mesh. Unfortunately, these sphylls often intercollide and will mess up the skeleton, so I had to delete them all and replace them with basic box colliders. This also helps the gun not roll around on the floor when dropped.

lots to see here!

Unfortunately, when I imported the model it wasn't facing the right direction, and it wasn't at 0,0,0, so I had a lot of tweaks to make to get the mesh to sit right in the player's hand.

the original pistol model's controller pinpoint vs. my model's

The reason for this being that the mesh component in the mod's blueprint can't actually be moved around, it's a stationary object, so I had to have the mesh for my gun imported in exactly the right location for it to look right when I hold it in-game. Those arrows you see are the point for attachment for the controller mesh, and it lies a little ways back 2/3 of the way up the trigger of the weapon. I needed my mesh to be in the same location for that controller attachment. You can also see that in those images there's a small purple cylinder. that's a bullet shell. Typically it lies in the barrel (because of a socket in UE4) but my skeleton is missing that socket so it just moved to 0,0,0, which is partway up the handle. fine by me, since I don't plan on using the shells. I might fix it later, but it's not the main focus of the project so I'm leaving it aside for now.

MuzzleFlashFX and Top_Muzzle scene components

I also had to create a Top_Muzzle scene component for us to use while animating later, and move the MuzzleFlashFX scene component as close to it as possible.

That's as far as I've gotten so far on this one, but I'm still working on it so I'll be updating this spark post today as work progresses further.

some classy connections
catch the wave, dude!

I then had to create some blocks of blueprint code to track when the gun was fired, to move the bullet spawner to the barrel of my gun, and then complete the firing action, and at the end, execute a custom event called "vox_top_slide", which would animate a float variable called "Top_Slide" based on a timeline curve which was set up to make the top slide of the pistol look spring loaded.

my name is Vector! I have direction and magnitude!
Give me some local space, dude.

I then used a Blueprint Update Animation Event to set Top_Slide and Trigger anim vector variables (this Top_Slide is different than the Top_Slide from the Mod Blueprint, as one is a float and the other is a vector). these vector variable were set using LERP vector nodes which went from one set of 0,0,0's to another set of 0,0,0's, the 0's able to change to any custom number. For the top slide I set the y forward ten, which moved the slide back 10 in space. I then set the trigger to move forward one, which moved the trigger bone backwards one (remember, the mesh is imported 180 on the z axis). the variables setting these LERP's where the alpha's from the Top_Slide variable I created in the Mod Blueprint and the Trigger_Pull variable that's built into Robo Recall. these were all created with an Blueprint Initialize Animation Event that cast the actions of this Anim Blueprint back to the Mod Blueprint, and then cast it to the Mygun variable. (look at the top picture for a visual on that)

Then the vector variables we set in the event graph were referenced in the action editor (the pic with the guy in a running pose) to transform the bones of the skeleton. The transforms were then run through a converter to translate from bone space to local space, and then connect to the pose to drive the animation. (See the second image above for those nodes).

it's kinda dark in here...

I then went back to the Mod Blueprint and set the Mesh's anim class to the Blueprint that I created.

that's... a lot of nodes.
blend modes

The final step to complete this mod was to make it dissolve like the other weapons in Robo Recall. To do that, I copied some nodes from the weapon_master material in the Robo Recall folder and pasted it into my own material and connected up the nodes to Emissive Color and Opacity Mask, and then created a instance of said material to activate the dissolve nodes. I then returned to the Mod Blueprint and assigned the dissolve instance material to the dissolve material slot in the main blueprint component. And with that, the mod was complete!

for a more in-depth look, check out the tutorial video down below, or my step by step Instructable, linked in the video description! (Both coming soon!)

Report Abuse

If you feel that this video content violates the Adobe Terms of Use, you may report this content by filling out this quick form.

To report a Copyright Violation, please follow Section 17 in the Terms of Use.