Corona-cation (Day 10)
Git Commit: d8cb5eb
"Plague Doctor working prototype"
At long last... he is complete. (For now)
Today I made the changes I wanted to make from yesterday as well as added some extra features. The first and most important thing I did today was to make the enemy attack in a cycle of random attacks. I said yesterday that I thought I would do this with custom decorators but this turned out to be unnecessary. All I had to do was use what I already had along with conditional loops. Basically, the problem was that when the doctor needed to walk somewhere it would do It for a single tick then rerun the entire tree. I added a conditional loop to the MoveTo and that fixed it. Because I could now get him to go places reliably, I added MoveTo's to the other attacks to make sure he was within range and the attack would have a higher chance of hitting. (Picture 1)
Once I had a reliable system that would not lock up like yesterday I went on to testing the actual attacks. This is where I ran into problem number two of the day. The poison that I made last week didn't actually work. Through some rigorous debugging (print strings) I was able to figure out that, when the poison effect tried to deal damage, it was trying to deal damage to its parent actor. I had attached the poison effect to the player when it was spawned but apparently that didn't count as childing the actor. So the alternative (which also made a later feature easier) was to set the player as the owner of the effect. This worked and now the poison effect damages it's owner. (Picture 4)
After I had this done I realized that the poison effects would stack. So a player could have multiple poison effects active at the same time, meaning a multiple more damage. I asked a designer about this and they said the stacking was fine, however they only wanted a maximum of three to stack. Great, I just gave myself more work. It wasn't too bad though. All I had to do was, when adding another poison effect, check how many the player currently had and if it was over a certain number then just don't. (Pictures 2 & 3)
When that was done I explained how it worked to the same designer and they said that it would be better if the doctor sped up when chasing down a player. I agreed and got to work on a very simple BTTask that would set an AI walking speed to a given number.
And with all that... I made my first commit in three days. Now saying that though I really should have made my own branch to work off of so I wouldn't lose all that work by accident. Lessons for the future I guess.
Full Behavior Tree |
Example of an attack |
GetNumPoison Function |
Poison effect |
Comments
Post a Comment