Strange Bio encounter system behaviour


I was recently toying with an encounter system based on the Bioware default (1.69) for my next mod, and… it’s weird ! Let me explain:

I have a straight hidden corridor not accessible to PC. In this corridor you can find a encounter trigger and a minimal creature doing regular patrol, walking left and right, activating the trigger at every pass. The spawning point is on another place where generated monsters can obviously attack the PC. The final idea is to have a sort of perpetual monster fountain (with multiple encounter triggers) controled by distance between triggers and walking creature speed.

The system works, but… if the PC goes farther than 3 or 4 tiles from the hidden “monster spawning engine” corridor, monster spawn stops, and what is really strange, is that the walking peon continues stepping throu triggers exactly like he is supposed to.

Seems like standard Bio encounter system does not reach the whole (6x7 tiles) area. I tried various ideas (upping peon creature IA, etc.) to no avail. Now i am rolling my own complete creature spawn system, but i am curious. Did someone know more about this peculiar behaviour ? Is this in some way related to the triggering creature perception or some hidden switch somewhere ?

  Thanks for any help,

A puzzled gnome.


Hi, I’m not exactly sure if I follow how your system works (a screenshot?), but have you tried adding some SendMessageToPC to the triggers to see if they fire (and when)? Can you perhaps simplify this system by replacing the creature with a pseudo-heartbeat?



It’s been a while since I worked with the NWN toolset, but I would have thought there to be a potentially better way of handling what you are trying to achieve. It sounds like you are after a constant drip feed of creatures?

I would also warn of potential memory issues if these creatures are not dealt with. In my own NWN1 module, Soul Shaker, I recall using the encounter system and even having one or two creatures left unattended could have an impact on overall game performance. Even to the point where I altered them to ensure they did not repeat to help prevent potential “overload”.

It may be that the engine automatically prevents too many creatures being spawned due to such a potential problem? For the record, I also noted one or two slight anomalies with spawning creatures that made me rework a few to be more efficient.

At the very least, I think you would be wise to “throttle” the rate by doing current existing checks, or you may end up with performance issues.

1 Like

I also don’t understand what you are trying to achieve. But one note: vanilla encounter systems will never spawn new creatures until the previously spawned ones are killed (or destroyed via script) and respawn timer passes (in case the encounter is even set up as “continuous” and has no limit on number of times it can spawn creatures).

And to even be activated, an enemy of the faction that the encounter is set to (hostile by default) must enter it. It will not be activated from another hostile npc running into it.


Yes i added some SendMessageToPC to the Encounter triggers OnEnter. And yes, the walking peon is detected as entering. No problem, i can simplify the system and do it work (using your pseudo-hearbeat another time :-). By the way, your library works wonderfully in 2 or 3 of my systems. I have done subaquatic drowning and lava walking for ex. The initial idea for the “monster fountain” was to use a cheapo easy thing because i was lazy, but Bioware systems just don’t cut it this time.

Yep, what i want is a constant monster feed… :wink: because it is a quest ending area.I don’t think there will be a game performance inpact. This is just a single player module after all and the encounter system (like Shadooow said) doesn’t spawn new creatures until you kill the current batch (and you need to kill then as you progress to access the island). In this case, i throttle the rate with the peon walking speed, distance between triggers, and encounter timing before respawn.

I hope the picture will clarify what i want to achieve. My encounters are on “continuous” and the “spawn next batch only when predecessors are killed” was an expected feature. My “peon” activator is a commoner.

From what i understand, the problem seems to be “Encounter trigger to PC distance” related (right, this is weird… Bug?) because if i go to the extreme triggering limit, it spawns only the nearest encounter trigger. In 90% of uses this is not a problem because most modders make the PC walk on the encounter trigger.


hmm thats odd… especially when you already debugged that the peon still walks and triggers the encounter

either way your workaround while clever is still workaround and it would be better to use custom script to do this, NESS will most likely allow you do do this and my trigger based spawn too (with additional scripting that “triggers” it everytime after onexhausted

btw, how do you make this stop? what prevents player to abuse this for endless XP ? do you just kill the peon if player reaches middle or something?

1 Like

Thanks for the picture, @CaveGnome. Now I see how you use an NPC to keep the encounter triggered with no custom scripts. Nice.

Did you include distance of PC to the peon and the encounter in the debug message? That could be interesting. Have you tried replicate this issue in another area with no obstacles around the encounter? Because it seems that there is indeed a cutoff distance here.

And for the record, I wasn’t advertising my stuff :stuck_out_tongue: just thinking how you could (if you wanted) replace the encounter with a trigger-based spawn.

But speaking of triggers, wouldn’t the standard 6-second HB be enough? Monsters could be spawned from the source with a delay to simulate a “stream”. Or something like a feedback loop: area spawns a monster if there are none :arrow_right: monster walks on that trigger from the center island :arrow_right: which spawns another monster :arrow_right: repeat (with a throttle counter)?

1 Like

Thanks all for your useful comments. I will examine what you suggested and try to do my best.

Yes, you guessed it. After PC reaching the island and doing a certain thing, i will have killed the peon. That doesn’t solve the endless XP possibility if the quest finish is delayed, but the spawned monsters are strong enough (and perhaps multiplicating more frantically if the PC takes too much time).

As you suggested, i tried a no obstacle area with distance debug info. The cut-off is something like a 35 radius from encounter trigger. No (or little) obstacle effect.

The standard 6 sec HB is to slow for what i want. Maybe a feedback loop could be an alternative, but i think the less work path for me is probably with a pseudo heartbeat (if they run well concurrently, because there is another one doing chores in this area).

XP: since you’re making a singleplayer module, perhaps you could call SetModuleXPScale(0) in area’s OnEnter and restore to original in OnExit?

I also did a test in 1.69 and can confirm your finding that encounters are not working like they should (OnEnter fires but nothing spawns) when stepped over by NPCs while PC is too far away from the polygon.

35 seemed to me like something related to perception range, but I had it spawn at 39.99 to the trigger and 38 to NPC, but when approached from another angle, it didn’t spawn even if both distances were below 35. Weird.

You are not limited by 6second heart beat interval at all. You can start a recursive loop with any kind of delay you want when entering area or trigger in area and each time it fires check if the npcs spawned by script are alive, and if not spawn new. You could potentially spawn new even if previous enemies aren’t killed if you wanted since you would not be limited to encounter system at all.