Subscribe:Atom Feed

"Non Player Characters..."

Posted: 13 May, 2021

Monday 10.05.2021

Change of tack, again…

When I stopped working on the overworld’s timeline, however many moons ago that was, I’d just about finished the initial experience, bar a few loose ends. The most visible was Fisherman’s Friend asking you to do a spin attack, which was supposed to start off a quest that leads you to the fishing rod, but er, didn’t…

I’d built my NPCs assuming they’d all be static, but I need this instance to get out of the way, else the charge for the spin attack triggers the dialog repeatedly. And the trees will fall through the NPCn which looks a mess...

I could have added a character controller and nav mesh, and moved the NPC to a location that way, or – what I decided to do today – try and use a level sequence to animate all the things, including the camera. Yes, I have a new hammer, and everything looks like a nail…

I thought that making a simple sequence to move the NPC would take minutes, but it ended up burning the entire day. Every time the level sequence ended, all the animated state – ie: the location of the actor, what animation it was playing, the camera’s mode, etc. – was restored to its initial state. Visibly popping along the way. None of the “Restore State” settings in the player seemed to make a difference.

In the end, pausing the sequence when it completed, rather than stopping it, left things how I wanted them, but I’m bothered that “Don’t Restore State” is seemingly ignored. I suspect this means that I’ve probably broken something.

Anyway, having tested the principal, sequences seem like a nice way to do slightly more complicated things with NPCs. I don’t want to make work for myself and have fancy NPC interactions everywhere, but it might make some of the training bits easier to do…

Tuesday 11.05.2021

Couple of other loose threads today; the main one being, how can NPC’s react to other NPC’s dialog lines, and why didn’t I write dialog for the Crone in the first baby dungeon…?

I don’t want NPCs to be directly tied to each other, but it would be handy to have the completion of one piece of dialog trigger a change of state in an unrelated NPC. In the end, I settled on added a broadcast delegate to the GameState class, so NPC1 can complete its dialog — which would be tracked and saved anyway —triggering a broadcast, that NPC2 can subscribe to. And it worked a treat, to the point where I’ll probably extend the player state class to have a few event delegates, as well.

As for the Crone’s missing lines; I was hanging back in case I pulled in another writer, but since I can’t really afford that, I’m going to have a stab at writing the whole game. I’ll bring in a sub-editor to knock the flabby bits into shape toward the end, but this means it’s full steam ahead on the puns and references to old video games…

Wednesday 12.05.2021

More work on the NPCs. I decided that I want Henge End to be a little busier when you first enter it. Today I added variants for all the existing NPCs so they’re loitering around nice and conspicuously. All plain sailing, just takes some time, and I’ve yet to give them dialog and idle animations, so a few more days left on this…

Hit a doozy of a bug with Rider for Unreal. I’d started using Rider to add new classes — normally I’d do that in the editor — and this has been working fine, until I tried to package a build this afternoon.

Unreal build tool was reporting a linker error. The “missing” class exists, is listed in the solution, and located where it should be in the file system. Sand obviously, I’ve been building the game and editor all week. No obvious reason why things shouldn’t be linking… I even pulled out Visual studio, which also compiled… Just Unreal Build Tool that’s doesn’t…

So I pulled the classes out, fired up the editor, and recreated them, and lo; UE4 wants class names <32 characters. My offending files had class names that were a couple of characters longer. So, Rider’s not respecting this limit, but building fine, and UBT is, so ignores the classes.

Live and learn.

Thursday 13.05.2021

Anims. Anims all day.

Added in the idles and dialog animations for the NPCs I’ve been working on this week. Annnnd, yet again, importing animations for pre-existing skeletal meshes turned out to be a ball-ache! Or, I just do it so infrequently I keep fucking it up.

Got there in the end, made a load of quick anims, and plugged them into the NPCs without break stuff. And my NPC dialog code passed the test of “can I work out what I did here, cos I’ve not used it in months”. It’s actually kinda nice!

Previous Post: "Eye Eye"


If you like any of my work, please consider checking out some of the fantastic games made by the following super talented people: