Birdoggydog's Builds

Building a following, biting pet in Godot for the Alien race

Each Alien in the party now has a dog that walks ahead, fights for 60% of its Alien's blow, lies down when beaten and gets up after eight hours.

The Alien’s dog does something now. Every Alien in the party has one, it walks in front of the party, it bites the monsters that hunt the party, and if it’s beaten it lies on its side until it gets up again. The model was finished earlier, so this was all behavior.

45 seconds: the dog ahead and to the right in a hall, through a door with the party, a bite of 16 against its Alien’s blow of 23, down on its side, the night passing, and up whole.

Why does the dog follow the Alien?

The rule for the race is that its special ability is a dog that follows it around in the world, grows with the Alien’s Machine skill, and does around 60% of the Alien’s combat damage. What happens when the dog is hurt wasn’t specified, so I picked lying down for 8 calendar hours and filed it as a question to settle later.

How is it built?

The raised allies, the dead monsters a spell stands back up, already did most of this: they follow the party, get put back beside it when left behind, fight, and show a health bar. I didn’t want a second copy of any of that, so I first pulled the shared part out of the thrall script into a base class, Ally, and ran the thrall tests again. They passed, 187 checks, none failing. The dog, AlienDog, is a second kind of Ally, and a small keeper node, Pets, makes one per Alien, removes it when its Alien leaves the party, and stands every dog up when the party wipes.

The code that handled “every thrall” now takes any ally. A monster that’s after the party turns on an ally that’s nearer to it, and a monster on a leash stays awake when an ally is close, so nothing falls asleep next to the dog.

Where does it walk?

Its place is 1.9 m in front of the party and 1.3 m to the right, and a second Alien’s dog goes to the left. In a hall too narrow for that, it comes in to 0.55 m. If neither spot is clear, it goes to the party’s heels, which is how it gets through a door.

If it walks into something for 1.5 seconds it goes to the heels, and after 2.5 seconds blocked it’s fetched, meaning it’s put back beside the party. The same happens when it’s 28 m behind, 4 m above or below, or out of sight for 4 seconds. A spot only counts if the dog’s capsule fits, the floor is within a step, and the party can see it.

The first film showed the dog trying to walk through a door that had solid rock behind it. The spot was only checked for floor, not for being open, so now the check casts rays through the door across the party’s width.

How does it fight, and what does it take to beat it?

It picks the nearest hunter within 24 m of the party and runs at it at 7 m/s. Within 1.6 m it bites every 4 game seconds. The bite goes through the monster’s ordinary damage function with the dog’s name credited, so what it kills counts as the party’s kills for XP, loot and the story.

bite = max(round(alien_melee * 0.6 * machine_factor), 1)
machine_factor = max(1 + 0.05 * machine_bonus, 0.5)
health = round(60 * machine_factor)

At a Machine bonus of 50 the bite goes from 12 to 30 and the health from 60 to 150. Every number is in one constant block, and all of them are placeholders.

A contact sheet of twelve game frames with the party bar under each: a dark hall with a door, then a desert field where a small pink dog beside a large monster is bitten, lies on its side, and later stands again beside the party.

The film as twelve frames. The captions show the bite, the monster turning on the dog, the dog down at 09:04 and up at 17:05.

At 0 health the dog plays its death clip, then I stop the animation node so it stays on its side. It has no target after that. Every tick of the game clock checks the calendar hours left, and after 8 it gets up at full health. A save written while it’s down plays the death clip and jumps to the last frame on load. Party spells can’t heal it.

Its health shows over the dog and on its Alien’s card, as “Dog 48/60” or “Dog down 6h”. The save has a new section with one entry per dog, and it takes its turns in turn-based mode like the thralls.

The tests for the pet pass 80 checks with none failing. I also ran the thrall, turn-based, monster sleep, streaming, save and load tests around it, 26 tests in all, and none failed.

Also done

  • Still to do: the numbers are placeholders, the rule for when it goes down is waiting for my answer, and I can’t give it commands yet.