Three Laws? Pfff…

THE GLORIOUS ROBOT ARMY HAS BEEN CREATED

Working on these guys made me pull in all of the knowledge of unreal and blender I’ve learned over the years. I’ll break it down into hurdles that I had to overcome.

1.) Retargeting skeletons

All of these models have their own skeletons, and each animation that you import has its own skeleton assignment. For the life of me I had no idea how to swap animations that I imported from version 1 of a model to version 2 (i.e. all of the skeleton bones had the same names). I went down a dark path of ik rigging just to realize I should’ve just right clicked a single animation.

…nuts…I had to re-import the assault rifle because I removed the stock for the bot and I made a new animation for the bot:


2.) Making the bots reload.

Again so the goal was to make the bots throw a physical object into the air so that the player would have the opportunity to shoot it. This is a crazy concept that requires a lot of tweaking to get right. The idea here is that I mark a point on the back of the bot as a “throw point” where I spawn a mag.

Then Unreal has a system called “Animation Notifies” which lets me communicate from an animation asset through an animation blueprint back to the controlled pawn.

You can see there are two here: “release Mag” which is the bot dropping a mag and “Spawn Mag” which creates and throws the new mag.

These are then tied to triggers within the animation blueprint to call back to the pawn.

Honestly not a great system but its apparently how unreal wants us to handle these things. Ideally you would have a nicer hierarchy of ownership but making what I would consider “Good” software left the room once I decided to go with blueprints.

3.) Unreal’s AI is helpful and horrible at the same time.

The tree I showed yesterday was very simplistic relative to this. When looking at this the first reaction is “oh yeah that makes sense” then “wait why would you do it this way” then finally “I don’t understand what this picture is”. So quick explanation: start at the root node, go down to the sequence node which triggers the nodes below it from left to right. The green box uptop is called a “service” and essentially is a while(true) loop that triggers while the sequence is executing. The blue boxes are if checks that happen before executing each node, for example “doIHaveAmmo” is used twice here and checks if the bot has ammo before executing. In the event that these blueboxes return false the entire sequence is canceled and you go back to the first node in the sequence(which in this case is the reload node).

4.) Niagra confuses me and I might get back into HLSL to avoid it

I made the muzzle flashes but I still kinda hate how they look. I started trying to make some 2d stuff but that ended up not really working:

The idea there was to try to make a ribbon that had a sinewave of width that would be lower frequency and a radial sinewave that would give bumps on the side. That didn’t really work however.

Then I got creative with making a mesh in blender and importing it in as the firecloud that comes out the front of the gun.

I stuck with that 2nd iteration and it seems like its better than the ribbon but I still want some more cloud-ness to it.

When firing (as seen above) it kinda looks like an orb just kinda spawned in front of your barrel. Most other games try to do this with 2d sprites however I’m a big fan of 3d sprite muzzle flashes like those from the tf2 announcement trailer:

Image taken from : https://gamebanana.com/mods/198837

I might just add some more spikes onto the current model and call it quits on that front.

Now next up for work is probably the environment, I have a bunch of reference images of place I thought were cool in boston and the surrounding area I’m going to try to generate some textures using them as inspiration. I then eventually have to do audio but I’m really dreading looking back into unreal’s dsp system. It’s very intense (and I literally do hardware based DSP in my day job).

Leave a Reply