Thursday, September 27, 2012

Blending Achieved!

I have finally solved an issue that I had since I started animating the character! The blending aspect! Before I had issues with the character not blending animations correctly. For example, if the character initiated the reload animation and then started moving, the model would glide until the reload animation was finished which then would cause the run animation to initiate. The two animations would never blend and the same goes for any animation that only involves the top half of the body like shooting. However, I did some more research on the topic and found out a tiny bit of information that I was apparently missing. I had my set up right in the character animtree involving the two animation nodes: tophalfslot and fullbodyslot. It turns out just like my professor had stated, that I needed to specify the bones in the properties that the tophalfslot node would be initiating the animations from. Once I did that and changed the script files so that only the tophalfslots would initiate animations for the top half of the body (like shooting, reloading, etc) and the fullbodyslot took care of the full body animations, I was golden! Everything is blending well now. You can see an example of it in the screenshot below.** Just pay attention to the legs animating while the reload animation is playing.

Reloading and Running! YES!


I also started on developing the blood particle for human blood. I created the texture of the blood using a blood brush that I downloaded from a source and then imported that into UDK to create the material. The material is not the best it could be, but it is sufficient. I quickly ran into a problem that I am still unsure as how to solve though. The material is correct but the particle system is spitting out a black version of the material. I have no idea why but I'm currently looking into it.

Wednesday, September 19, 2012

More Animations and A Little Scripts

This week I worked more on trying to make my animations look a little better. Because our main character has custom bones for his skeleton, it's really hard to show the weight impact on the feet when the player is running. I tried to implement that sort of animation to the best that I could, but it's not looking that good. It gives him more of a skiing animation then an actual run.
Another adjustment I made was the reload animation for the revolver. The previous animation was a bit of a mystery to the player because from their view all they say was the hand moving to the front of the character's body. I changed this to make the character take his left hand and act as if he's reaching into his pocket each time and putting a bullet into the revolver. This animation looks much better and is definitely more obvious in a visual sense as to show what exactly the character is doing.
One issue I ran into while implementing the reload animation was that when the reload animation was called, the player could actually hit the fire button and cause the fire animation to occur which would break the reload animation before it finished. This issue was not too difficult to solve. It just took some digging around in the weapon and pawn class. What I did was create the bool variable bIsReloading in the base UTWeapon class, and I check that if it's true in the pawn class then prevent the firing animation from taking place. This will be helpful when the rifle is implemented because the same check will prevent the rifle reload animation from being broken as well. You can see the code snippetof the StartFire function below from the pawn class.

simulated function StartFire(byte FireModeNum)
{
    local UTWeapon Weap;

    Weap = UTWeapon(Weapon);
    // firing cancels feign death
    if (bFeigningDeath)
    {
        FeignDeath();
    }
    else
    {
        if(!Weap.bIsReloading)
        {
            super.StartFire(FireModeNum);
        }
    }
}

Wednesday, September 12, 2012

Arrival of the Beta Phase!

Hey everybody, I'm back to blogging and as you can tell from the title we are officially in the beta phase for this project before we reach our deadline. The team got together and set up a new statement of work so that each of us know what we are responsible for by the end of the beta phase.
Our first and foremost concern was to address the bugs that were compiled from our bug testing session. I guess I forgot to mention that we had a bug testing session after our alpha phase. But anyways, the bugs were are main concern. One of the bugs that I worked on was disabling the fire animation if the player is in a state where he should not be firing at all. This wasn't that tough and it mainly involved me implementing the reload animation which is also what I did. I created the animation and coded a reload function for our revolver with some help from the web on how to exactly go about coding it. You can see that code below. The issue at this point was making sure the player could not initiate the fire animation during the reload animation because that breaks the reload animation. This was not too difficult to resolve because I just needed to check a bool variable that checked if the weapon was currently reloading, and if that variable was true then the firing and its animation will not initiate unless that variable changed into being false.
Looking forward, I'm going to create some reload animations for the repeater rifle and the laser rifle. I also need to get the dynamite throw animations and possibly damage animations created so that they could be implemented coming up.

simulated function bool DoOverrideNextWeapon()
{
    if(clips == 0)
        super.DoOverrideNextWeapon();

    return false;
}

simulated function WeaponEmpty()
{
    local AFTU_Pawn P;

    foreach AllActors(class'AFTU_Pawn',P)
    {
        Player=P;
        break;
    }

    if(clips > 0 && !bIsReloading)
    {
        WorldInfo.Game.Broadcast(self, "Reloading");
        bIsReloading = true;
        SetTimer(2.5, false, 'Reload');
        Player.FullBodyAnimSlot.PlayCustomAnim('DW_Reload_Revolver', 0.5, 0.2, 0.2, false, true);
        return;
    }

    super.WeaponEmpty();
}

function Reload()
{
    bIsReloading = false;
    clips = clips - 1;
    AddAmmo(30);
    ClearTimer();
}