The Game Engine and wandering Town NPCs

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
Post Reply
tynan
Posts: 1
Joined: Fri Sep 07, 2018 11:44 pm

The Game Engine and wandering Town NPCs

Post by tynan » Sat Sep 08, 2018 12:02 am

How does the Game Engine keep track of wandering town NPCs? Are the same NPC names placed in each town/city every time a New Game is started, or is it random?
I'm asking primarily for a mod I've been thinking about: the Armies of the Iliac Bay. At first I thought it could be possible to spawn a bunch of Knight/Town Guard billboards in marching formation, facing the same direction and about 7-10 person-width column, and several hundred persons long. This of course would pop up with the message "You see a Knight" when clicking on them or whatever.
Now I'm wondering if it's possible to actually "pull" some of the wandering NPCs in the towns/cities of a Region (like Daggerfall) and drop them into an army (like the Army of Daggerfall for lack of a better name). This fully-populated army (at least a thousand troops, perhaps more) could be spawned in various places when not at war, to march down walled-city streets in "parade review" etc. Just would be nice to see a huge army march through a large city now and then.
And of course those NPCs that were pulled would no longer be wandering the towns, so those towns would be a bit less populous.
Any thoughts?

User avatar
Interkarma
Posts: 3176
Joined: Sun Mar 22, 2015 1:51 am

Re: The Game Engine and wandering Town NPCs

Post by Interkarma » Sat Sep 08, 2018 12:16 am

Welcome to the forums tynan :)

Daggerfall Unity uses a population manager that spawns N count of NPCs (depending on city size) in a bubble around player. Once spawned, they align to a navigation grid overlaid with city area and wander around using a few simple rules, e.g. "prefer roads to dirt", and "don't walk on water". They pop in and out of existence as player moves around the city. You might be interested in the blog article I wrote about this last year.

The wandering NPCs pretty much fill the role of mobile sign posts. They help direct player to quest goals and shuffle about the place. There aren't many hooks for adjusting their behaviour.

But something you could do instead is work on custom path logic for marching using the navgrid and spawn your own mobiles to follow those rules. Then all you'd need is a hook in population manager to reduce the total number of NPCs spawned. You would then have full control over your mobiles rather than trying to adjust the behaviour of existing.

Post Reply