PDA

View Full Version : Singleplayer: Spawning NPCs with triggers?


Emon
11-19-2002, 10:55 PM
Did Raven do this in their maps? I've noticed that if I turn on noclip at the start of the level (kejim_post for example) and move through the level and look down upon the "open" cielings, there are no NPCs! I figured they probably did this with triggers, had them spawn when you hit a certain point.

My question is: Is there an advantage of doing this? The disadvantage is obviously that it takes a lot of time, but what else does it do other than reduce the strain on the CPU (probably noticable only on low end machines)? It couldn't help to get around any entity limits, since the entity is still there, just not the NPC.

idontlikegeorge
11-20-2002, 12:49 AM
well, either here or on massassi there is a thread about problems with a bunch of NPCs in view start to flicker, cuz not all animations can be played for some reason... the fact that NPCs spawn in triggered positions was brought up there

so yeah, id say its primarily a performance issue, but i also like how it controls the environment, atleast from the mappers standpoint

lassev
11-20-2002, 01:58 AM
Ah, hah! One improtant thing: You can spawn enemies behind the player's back. That's quite an issue, for example in a situation where some imperial officer makes an alert. And it's always funny, when the player is running back the same corridor, thinking it's safe and all, and behind a corner there's a couple of grunts with blasters singing their sweet song. Well, that's a special issue, but anyway.

When you spawn a large bunch of enemies with one trigger event, there's a moment's lag in the game performance. I have this problem in my map, but I'm afraid I'm far too lazy to do anything about it (other than alleviate it somewhat by dividing the bunch to a few different targetnames and triggers).

Kengo
11-20-2002, 04:09 PM
Originally posted by idontlikegeorge
well, either here or on massassi there is a thread about problems with a bunch of NPCs in view start to flicker, cuz not all animations can be played for some reason... the fact that NPCs spawn in triggered positions was brought up there


I think I started that thread :0 I think I've got rid of the problem of flickering now after the good advice I got. The thread is here: http://66.250.145.38/showthread.php?s=&threadid=83072

There a re a lot of advantages to spawning the enmies section by section. Even if you can't see the NPCs, having a lot at once causes flickering. I think it all-round improves performance too, because the engine doesn't have to do anything with the entities until they are spawned. I really think it's well worth the effort of putting some well positioned triggers targeted to NPCs.

Also yes it can of course be used for some nice ambushes! And if the player has to repeat certain areas of the level (maybe running back to a door after finding the key for it) then you can put NPCs into that section so that you don't get the annoying problem of old FPS games - wandering around with all the enemies dead and trying to figure a way out!

Gabrobot
11-22-2002, 01:17 AM
Yeah, they're a good way of letting the player know that they're on the right track, and not on a useless trip to someplace that's on the opposite side of the level from where they should be! :p I've found this very useful when playing a game/level which does this.

I think (I don't know from first-hand knowledge) a level would probably become a huge mess, if all the enemies spawn and start patroling since, then, there is a lot of useless computing going on. Even on a fast system, serious framerate and flickering problems occur, dispite what you might think is a very simple task.