Corona-cation (Day 7)

Git Commit: b6e0596

"Changed first person UI, Fixed enemy pathfinding"


Changed first person UI:

    The simple change of today had to do with the first person UI, namely the health bar. Our UI artist finished the first edition of the health bar and wanted to see how it looked in-game as to adjust anything necessary before he went on to make more. The first thing we noticed was that the .png file that was exported had really bug padding around the edges that made the scale wonky which really screwed with positioning and getting clean values. Right now, it looks like this:


Fixed enemy pathfinding:

    When I loaded up the project today I was prepared to work on the archer enemy. Before starting that though I wanted to make sure everything else worked up to that point. I added a standard melee character to the level to make sure they play nice. They did, but I noticed that the melee character would jump up to the statue's pedestal, and, given enough time, so would the scarab swarm. This was a problem as we didn't want just any old enemy being able to jump up there. 
    I started out on the nav link trying to find a way to restrict its use to only one class or something, but that didn't work. Google was also not helpful in the searches I made (Side note: throughout this whole process documentation was staggeringly unhelpful, only really restating what you could already see. As a bonus, the only somewhat helpful google search came when I new the lingo and only confirmed what I had already figured out on my own). So I set off on my own to try to figure out what would allow only the statues to use the nav link.
    The first thing I saw was that the link had a section that said 'Supported Agents: all'. I thought I would just be able to change some agent type but searching everywhere I found nothing. The next thing I saw was an 'Enabled Area Class' and this was the start of the right path. I figured out that I could change this value and even make my own nav area class. So I did made one, NavArea_StoneStatue, and set the nav link to use it. That alone was not enough though. I now had to find a way to explicitly tell the statue to use that new nav-area. 
    After more messing around in the editor I found nav filters. This allowed me to add different nav areas to it which, I assumed, would make the AI it controlled use them. It was not that simple though. Through a little trial and error I figured out that the new nav filter was working I just hadn't applied it in the right way. See, when it worked I was using the scarab swarm which uses a MoveTo node in blueprint whereas the other enemies use behavior trees. The behavior tree 'move to' (used on the other enemies) also has an area for nav filters but, here's the kicker: it just doesn't work. No matter if I restarted the editor, made a new filter, whatever, it just would not take effect. 
    So cool, now I can't use the built in nodes and have to make my own. Honestly though, it wasn't that hard, I just made a new task that would take in the same parameters as the built in node plus a nav filter and, ta-da works first try. The last thing that I had to do was check a checkbox that would make non-statue enemies unable to use nav areas marked as NavArea_StoneStatue. 

Comments

Popular posts from this blog

Polishing the Foundation

Progress Update #13

A New Chapter