Feature Specification: Spawn System

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

User avatar
Fionn
Ancient Red Dragon
Posts: 2942
Joined: Sun Jan 04, 2004 7:07 am
Location: Seattle, WA

Post by Fionn »

Ronan wrote:Hmm, we could also keep PCs under cutscene invis and paralysis for a bit as they AT into the area.
that might be best. the current system for that gives the advantage to the PC with the fast vid card.
PC: Bot (WD)

Code: Select all

     -----          -----          -----          -----
    /     \        /     \        /     \        /     \
   /  RIP  \      /  RIP  \      /  RIP  \      /  RIP  \      /
   |       |      |       |      |       |      |       |      |
  *| *  *  |*    *| *  *  |*    *| *  *  |*    *| *  *  |*    *|
_)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_(
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

The cutscene is a great idea. It *should* work perfectly.
Ronan
Dungeon Master
Posts: 4611
Joined: Sun Feb 20, 2005 9:48 am

Post by Ronan »

Wondered if anyone had an opinion on the implementation of the "Spawns when PC nears" float value. I can think of two ways of doing it,

1) Create a AoE effect of the appropriate radius (we can add a range of effects from 1 to 50 meters or so in areaffects.2da easily enough) and use that to trigger the spawn.

2) Run a small, optimized heartbeat script on each unspawned, active spawn point with this option used, and check for nearby PCs. This is what NESS does.

#1 would offer more ideal behavior, since there would be no heartbeat delay. I'm not sure if it would execute faster. AoE entery/exiting is handled in native code and should be fast, but every added AoE effect adds significantly more math that needs to be done... And its not really profilable, since its not a script.
User avatar
Fionn
Ancient Red Dragon
Posts: 2942
Joined: Sun Jan 04, 2004 7:07 am
Location: Seattle, WA

Post by Fionn »

I'm not understanding #1.

Also, would this be the same mechanic to prevent ATing on top of a spawn? Cutscene may prevent several free hits, but it doesn't stop you from 'teleporting' in underneat a mob.
PC: Bot (WD)

Code: Select all

     -----          -----          -----          -----
    /     \        /     \        /     \        /     \
   /  RIP  \      /  RIP  \      /  RIP  \      /  RIP  \      /
   |       |      |       |      |       |      |       |      |
  *| *  *  |*    *| *  *  |*    *| *  *  |*    *| *  *  |*    *|
_)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_(
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

If I'm understanding correctly, this is for despawning creatures, right?

I'd favor #2 or a DelayCommand() psuedo heartbeat over #1. If NWN1 is any indication, AoE's will be expensive and can really bog down a server if used excessively.

Since spawning is transition based, does it currently factor in login/outs? If a player logs out in the middle of an area then comes back in 15 seconds later, will it clear the area of spawns? If yes, does the player have to hit another transition for the spawn points to reactivate?

Depending on how you've implemented it, spawning/despawning could be tied to area and client OnEnter/OnExit events instead. That eliminates delays and possible exploits as well. Not sure if we talked about this earlier in this thread or elsewhere but your question jogged my memory.
Ronan
Dungeon Master
Posts: 4611
Joined: Sun Feb 20, 2005 9:48 am

Post by Ronan »

This is for spawns configured to only spawn when a PC gets near them. Normal spawns are triggered OnAreaTransitionClick, OnEnter, or on the start of a seamless AT.

NWN1 currently does not trigger OnAreaEnter events for log-ins. We don't know if NWN2 will, but if not, its only one extra line in a PC's OnSpawn.

To prevent ATing on top of a spawn, builders just shouldn't configure spawn points near PCs. But in case they do... should we do something about that, aside from the temporary cutscene invis?
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Do we even want to provide that option given the problems we've seen in NWN1? The purpose of spawning during transitions was to avoid this kind of trigger based spawning, right?

I think the cutscene invisibility is sufficient to let players react in whatever way they think best. But I suppose you could just not activate any spawn points within a certain distance from the edge of an area, if it's possible to compute (check position vectors?). Some areas might be small though and this might cripple them inappropriately - we should definitely post a WARNING to server logs & DM channel if we do this. An AI workaround for this may consume computing cycles that are better spent on other things so I think we should avoid that.
User avatar
Fionn
Ancient Red Dragon
Posts: 2942
Joined: Sun Jan 04, 2004 7:07 am
Location: Seattle, WA

Post by Fionn »

Can we do a Flee() on any mobs within 15' of the AT target while the PCs are under Cutscene? This would have the effect of giving the PCs enough time to buff/equip prior to initiative (unless ranged).
PC: Bot (WD)

Code: Select all

     -----          -----          -----          -----
    /     \        /     \        /     \        /     \
   /  RIP  \      /  RIP  \      /  RIP  \      /  RIP  \      /
   |       |      |       |      |       |      |       |      |
  *| *  *  |*    *| *  *  |*    *| *  *  |*    *| *  *  |*    *|
_)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_(
Ronan
Dungeon Master
Posts: 4611
Joined: Sun Feb 20, 2005 9:48 am

Post by Ronan »

I've seen two primary uses of spawns which spawn only when a PC is near. One is simply optimization, it takes less CPU than keeping a huge area spawned in at all times (NU had to do this, or DS couldn't handle the mod). The other is simply things which should not be there until a PC nears. Ooze creeping up from a crack in the floor, Vrocks using their greater teleport ability (in combination with the VFX options in the spawn system) to attack a PC, etc.
User avatar
Fionn
Ancient Red Dragon
Posts: 2942
Joined: Sun Jan 04, 2004 7:07 am
Location: Seattle, WA

Post by Fionn »

Spawns near shouldn't care about ATs. You *may* even wish to have it wait until after they remove the Cutscene.

I'm worried about getting AT jumped. Even if you have Cutscene immunity, that don't help when your Mage is creeping through the woods, but suddenly finds himself under a Bear - the moment the Cutscene drops, you're dead.
PC: Bot (WD)

Code: Select all

     -----          -----          -----          -----
    /     \        /     \        /     \        /     \
   /  RIP  \      /  RIP  \      /  RIP  \      /  RIP  \      /
   |       |      |       |      |       |      |       |      |
  *| *  *  |*    *| *  *  |*    *| *  *  |*    *| *  *  |*    *|
_)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_(
Ronan
Dungeon Master
Posts: 4611
Joined: Sun Feb 20, 2005 9:48 am

Post by Ronan »

Fionn wrote:I'm worried about getting AT jumped. Even if you have Cutscene immunity, that don't help when your Mage is creeping through the woods, but suddenly finds himself under a Bear - the moment the Cutscene drops, you're dead.
There really isn't any way we can fix this, short of checking a spawn's faction's reaction to the incoming PC, and moving the spawn back if its hostile. The encounter system isn't going to place spawns within visible range of ATs, but builders might. And builders might need to, in the case of the many types of non-hostile spawns, or ambushes hidden from view until your inside the cave, etc.

I think we'll just have to trust builders not to be n00bs, or provided a mechanic for PCs to AT backwards while under cutscene invis.
Ronan
Dungeon Master
Posts: 4611
Joined: Sun Feb 20, 2005 9:48 am

Post by Ronan »

ç i p h é r wrote:I'd favor #2 or a DelayCommand() psuedo heartbeat over #1. If NWN1 is any indication, AoE's will be expensive and can really bog down a server if used excessively.
BTW, do you think this would be the case with dynamically-spawned AoEs? We can't dynamically spawn triggers, and obviously HBs aren't ideal (thinking of a demon which is summoned when a PC nears a pentrag, or something similar). I'm wondering how much CPU this would really eat up if only a few areas are active at once.
Locked