Categories
Blog Blog Post

Atavism Dev Log 22 – Takeoff, Head Positioning, Giant Plan

Update 22: August 16th – September 5

It’s been a while!

Three weeks, actually, instead of the usual two since the last update, and this is entirely due to trying to adapt to the new schedule I have from starting this semester at University (fall of my 3rd year). I had accomplished so little last Wednesday that I honestly just forgot this was supposed to be the day to write a blog. A few days later I realized what was up and just decided to aim for next week. It’s likely that this marks the end of my consistent, content-filled updates that made the summer

On the personal side of things, I’m a few sessions into running that D&D game for my friends and my other 2.5-year-old campaign with the same group is shaking back to life from another hiatus. I finished Slaughterhouse: Five and I have to say I was pretty stirred by it, particularly the frank first chapter as Vonnegut tries to collect his thoughts before writing and the part where Billy watches the war scene backwards on his TV. The book gave me some pretty raw vibes about how ridiculous and terrible humans can be sometimes and how silly it looks from such an outside perspective.

On another track, I also finished The Last Guardian a few weeks ago, and I was totally wrecked by the ending in a way that no game or movie ever has before. It was an absolute journey – beautiful to look at and engaging to play all the way through – and I can probably say it’s the best game I’ve played from this decade. I binged a lot of the developer diaries and interviews about the game a bit after and they were also super cool and inspiring. I’m fully onboard for whatever they have next, and I can’t wait for it!

On the development side of things, the scattered handful of hours from the last 3 weeks came together to roughly form almost a devblog’s worth of content, so let’s just get right into it.

boringBlenderScreencapSorry

Rearing Back, Looking Up

The largest think I really worked on was the take-off sequence for the AveApex, which ended up being pretty easy now that I’ve got a few techniques under my belt.

First thing I did was think of the general state sequence necessary for this. Right now, they transition to a “Seek Flight” state after they lose track of their target for x seconds or exhaust their search state. If they need to seek flight for any other reason, I can also easily alter one script to change the animation, which will have it’s own visuals and logic events for takeoff.

Algorithm

I thought of a few options for the where and how part of taking off. One of the ideas bouncing around unconsciously for a while was just having them walk around until they’ve calculated that a few ray or spherecasts were clear, meaning they’d be ready to go up unobstructed. Even when they got to a point I figured they’d just spin around an array of points until they found a good path (like the landing array in the swooping section of this blog)  but when I sat down to map out what they’d do, I found this would obviously be a lot of work for such a small part of their process.

Like I’d done with the hiding places before them, I went for a node-based approach that shifts the onus of processing from the AI agent to the level designers. It doesn’t guarantee a smart, autonomous agent with unlimited intelligent take-off potential, but sometimes I have to remember I’m making a game and not a simulation. I’ll have to find a way to make the node-system more integrated with the editor so that it’s clear what’s good and what needs to be present for systems to work.

As of now, the “Seek Flight” state pops a bit of code that searches in a radius (and a bigger one if it finds nothing) for a “Node” layer item with the “Takeoff Node” tag. It briefly calculates the distance to each (which could be significantly optimized if necessary by pruning bad nodes) and selects the shortest one. After setting the destination, the AveApex will move towards the node until it enters the node’s radius (set manually by the level designer and visual in the editor) where it will play an animation.

Animation and Event logic

The animation itself is more slow and kind of calculated. I probably could have taken a little more time with it, but I like the way the creature rears up and prepares itself for the jump.

The logic for the jump is tied into events on the animation. One fires right after the part of the animation where it jumps, setting its velocity straight up in the air while flipping all states over to flight and disabling foot IK, unnecessary colliers, and the nav agent. Another event gives it lift, pushing up with force when the bird beats down its wings. At the end of the state, the Travelling state AI takes over and we’re back to where we started with a bird in the air. It turned out pretty well, providing a surprisingly seamless transition.

reminder

Keep Your Head Down… and Out of the Wall

One area of polish that was actually necessary for gameplay was getting the AveApex head acting accordingly. By default, it would just idly mosey on over to the hiding places and get its head stuck in the wall, causing its vision to act unpredictably and ruin the AI unless I fixed it. A simple problem, but it required a few components to solve it.

The first of which was implementing proper turn animations. As given, the bird kind of lurches forwards and around in a large circle to turn itself, but I made a non-motional rotation set for the creature to pivot around in a tight spot. I also reworked some of the root motion code that caused it to slide around on its feet (which is not entirely fixed, but largely helped).

The other problem was head IK, something that already activated upon attack but now needed to stay active when seeking a hidden target. For this I had to make some functions handle IK target location changes to have the head smoothly lerp between them now that they’ll change so much. After that it’s a matter of vector math and timing to get the head to shift it’s height dynamically (depending on the floor below it) while pointing towards the player.

To make the body positioning more natural for how the bird stalked the hiding prey, I also keep a target position projected on a line between two hiding place nodes that follows the bird’s movement and acts as a destination. With this, the AveApex always moves along the hiding place instead of directly into it.

This, more or less, stops the bird from sticking it’s head in the wall, but also makes it look more natural as it peeks under rocks for something to hunt.

klrpv9hxjrjy
http://www.demonui.com/raw/

Next Update and Goal Assesment

Last week I said I’d polish how the bird attacks and defends and that I’d finish the hanging and climbing features for the controller, maybe adding the bird takeoff. Given my small amount of time from trying to get used to the new semester, I finished an aspect of the first and went ahead and did takeoff instead, as doing the hanging and climbing requires some work on new viewmodels and some experimental programming that I’d like to tackle all at once.

I also said I’d try to make a demo level by September 7th, which I mostly wanted to do for 4chan’s Demo Day. This is looking unlikely unless I have a really wild Saturday, so I’ll ignore that thought for now.

Next up is gonna be a host of player-related stuff, which will hopefully, when it’s done, bleed into the AveApex getting done and then again into the Tribesmen.

The Plan:

First I’m gonna remake the viewmodels and animation for the player with the knife. They’ll be higher-poly (not a big deal), but also look nicer and have some actual purpose in their art direction that I’ll need for the gameplay. After that’s done, I can rework the knife combat which I’ve been meaning to do for a long while now. It shouldn’t require too many changes to my code, just sort of rearranging it and reanimating a lot, which is good because I don’t have to experiment with hit detection or anything strange (besides one new feature).

After reworking knife combat, I’m gonna add some placeholder footstep code onto the player so that I don’t have to make the body animations yet. With that working, I’ll be proper ready to get the AveApex Hearing senses, open combat, and eating AI finished to the point where it just needs some polish.

Once they’re done for, I can visually redesign the Tribesmen, refit their prefabs to the new model (and polish up their animations), then implement IK onto them without disturbing their AI very much. I’ll also add Sight and Sound senses to them with a simple IDLE placeholder state for non-combat activities.

Once THAT’s done I can pat the birds on the back, reassess what else I want to do with the Tribesmen (as I’ll have re-familiarized myself with them) before moving onto reworking the Rifle, which will involve making a new model and animations, but not much code, much like the knife. Also I’m probably (almost certainly) getting rid of the Spear.

From there, I’ll mull over implementing a save system and some other Act 1 effects.

And after all that is said and done, we’ll officially move into Act 2, which I’ll lay out a plan for, beginning with the dialogue system with NPC’s. I’ll make a somewhat basic placeholder NPC with a face to experiment with while I work this out.

Essentially, I’ll be finally laying off the AI and start making artistic and animation based updates for a bit. I’m a little more sure now of my schedule and how I can fit in dev time, so we’ll hope for some viewmodel progress two weeks from now.

(A day may come when I actually plan for and implement some sound design, but it is not this day!)

Until next time, cheers.

By Steven Zwahl

I'm a Computer Science undergrad at Kansas State University.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s