Corona-cation (Day 9)

Git Commit: None


    Still nothing finished yet for the Plague Doctor. It is proving to be much harder than I originally thought it would be. The only difference between this enemy and the others I have worked on is that this one has multiple attacks. That one difference has taken up two full days of work and it has yet to be fully figured out. 
    From the last time I worked on it I changed a few things. The first being the random attack generator. I had this in a service before but now it is a task. I realized that a service is not what I would want because it ticks and that would change the attack type rapidly, confusing the hell out of the AI. But with that figured out, I went back to figuring out how to have the attacks cycle. This was the part I was stuck on for the majority of my time today. 
    The problem was, once an attack was chosen it would do that attack (as expected) but then it wouldn't return to the state where it would choose a new attack. I experimented with multiple solutions, none of which fully worked. The first attempt was to have an empty attack state that would signal the BT to choose a new attack. This didn't work though as when it chose an attack the BT would lock up because now it had an attack type but the decorator that would reset the attack tree would close. 
    The next attempt was to make a custom decorator that would only abort when the AttackType was set to none. This didn't work, partially because I don't really know how the custom decorators work (because I didn't look for documentation) and because of that I didn't put too much time into it. As I write this retrospectively though I think that this approach might actually have some merit if I looked more into it.
    The third and final approach for today was to have a boolean Attacking that would dictate when to reset. This kind of worked, but with a new problem. Now the BT cycles too quickly. When it is supposed to move toward the player to do a slash attack it only tries for one tick until it picks a new AttackType. I don't quite know why yet but I will look more into it tomorrow.
    This is the current state of the attack branch of the BT:


Comments

Popular posts from this blog

Polishing the Foundation

Progress Update #13

A New Chapter