• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Level Design Lighting, AI/Trader Path and Pickup Issues

Colonel Panic

Grizzled Veteran
Jul 5, 2009
313
5
Making one thread for the last 4 problems I'm trying to solve with my map.

Issue 1: I want to have some ambient lighting outdoors so that players aren't completely blind in the sun shadows, HOWEVER, I do not want the ambient light to penetrate to the indoor regions: I want some areas of the map completely black. I attempted putting an invisible light above the field and having it shine straight down with a very long radius, and it gave me the effect I wanted up top, however, the floor textures in some indoor areas suddenly started lighting up too. Seems like a bug, but I don't know what's causing it, or how to get around it.

Issue 2: I have some zombievolumes in a corridor where there are 3 exits: 2 slopes that they can climb up and jump down from into the main area, and one very strong weldable door. The intention was to have the zombies go around the door when leaving their area, but be agble to attack players if they went to that side of the door, while other varieties of zombies from outside the area from getting in without going through the door. Long story short: I can't get the zombies to use the path that goes around the door. Is there a way I can direct the AI to use the alternate path unless players are inside that room? (I want the door to start in a welded-shut state)

Issue 3: The trader path seems to show OK, but the trader arrow does not--it points to some arbitrary location completely apart from the trader, and not even at any particular volume. I can't figure out why it's pointing there instead of toward the trader. How do I fix this?

Issue 4: I can't place armor and weapon pickups on the map, unless I'm missing something... I'm loading the script from the actor browser, then right-clicking on the ground or object where I want to place the pickup, but the pickup does not appear. The surface highlights when I initially click, then de-highlights after I select to place the pickup from the context menu. Hitting back only re-selects the surface.

I've also noticed some weird instances of staticmeshes not appearing in the editor (though they appear in the game just fine) or appearing, but not highlighting when they're clicked on. They're also very, very dark unless highlighted, so if iy's not highlighting I can't tell which direction the texture is facing. Quitting and restarting the editor seems to fix this...


and I think that'll be all... since none of these are really game-breaking, I'll probably polish up a few things and submit a beta map for whitelisting in the meantime, but the sooner I can figure out these problems, the sooner I can have the map completed.
 
Last edited:
I just noticed the following when rebuilding all: I get a warning saying the weaponpickup0 actor has a NULL staticmesh. I assume this is due to a failed weapon pickup placement that I failed to undo. There's a new problem with this, however: since it has no mesh and no icon in the editor, I cannot click on it to delete it or change its properties/mesh. How can I fix it?
 
Upvote 0
Issue 1: I want to have some ambient lighting outdoors so that players aren't completely blind in the sun shadows, HOWEVER, I do not want the ambient light to penetrate to the indoor regions
Cut your map up into Zones so the outdoor parts and the indoor parts are different zones. Then place a ZoneInfo in every zone. You can use light settings in the ZoneInfos to make ambient lighting, just as you would in the LevelInfo, except it only counts for the Zone the ZoneInfo is in.



Is there a way I can direct the AI to use the alternate path unless players are inside that room? (I want the door to start in a welded-shut state)
Zombies usually use the shortest route to where they want to go. You can trick them by assigning a certain "ExtraCost" to a PathNode. The value you enter in the ExtraCost field of a PathNode adds that value to the number of unreal-units the bot think the node is away from him. I.e. he thinks it's 2000uu away from him, but with an ExtraCost of 500 he thinks it's 2500uu away. You can use this to make the two routes appear to be of about the same length and let the bots figure out the rest on their own.

I can't think of a better way except via AIScripts, but I honestly have no clue how this could be done with them.

Issue 3: The trader path seems to show OK, but the trader arrow does not--it points to some arbitrary location completely apart from the trader, and not even at any particular volume. I can't figure out why it's pointing there instead of toward the trader. How do I fix this?
It's pointing towards the pivot of the tradervolume. Snap it in its middle with the right-click menu.


Issue 4: I can't place armor and weapon pickups on the map, unless I'm missing something... I'm loading the script from the actor browser, then right-clicking on the ground or object where I want to place the pickup, but the pickup does not appear. The surface highlights when I initially click, then de-highlights after I select to place the pickup from the context menu. Hitting back only re-selects the surface.
It is placed at the nearest grid-cross. If you have a huge grid-size you might not realize it is already place. Set it to 16 or something and try again. If it still doesn't work a rebuild of the geometry may help.

If this also does not help you might have a little bug on your hand that prevents certain actors from being placed. Try placing them somewhere else in the map and move them from there to where you actually want them. This occurs from time to time. No idea how to fix it.
 
Upvote 0
Cut your map up into Zones so the outdoor parts and the indoor parts are different zones. Then place a ZoneInfo in every zone. You can use light settings in the ZoneInfos to make ambient lighting, just as you would in the LevelInfo, except it only counts for the Zone the ZoneInfo is in.

Now I'm going to have to ask, how do zones work? That's something I haven't figured out yet... I don't recall seeing a zone tool. Is it related to volumes? how do I make one? is there a tutorial on these?


Zombies usually use the shortest route to where they want to go. You can trick them by assigning a certain "ExtraCost" to a PathNode. The value you enter in the ExtraCost field of a PathNode adds that value to the number of unreal-units the bot think the node is away from him. I.e. he thinks it's 2000uu away from him, but with an ExtraCost of 500 he thinks it's 2500uu away. You can use this to make the two routes appear to be of about the same length and let the bots figure out the rest on their own.
Oh! ok, I tried messing around with the extra cost value, but I assumed it was counting in nodes, not distances... so understandably, my values of 2, 3, 5... did nothing. I'll give it another go. How far apart should nodes be? if they're too close together, can't zombies just walk right past the adjacent high-cost node to one right beyond it? I've tended to lump nodes together in tight places like doorways and ledges to improve pathfinding and prevent stuck zeds.


It's pointing towards the pivot of the tradervolume. Snap it in its middle with the right-click menu.
Awesome, thanks!



It is placed at the nearest grid-cross. If you have a huge grid-size you might not realize it is already place. Set it to 16 or something and try again. If it still doesn't work a rebuild of the geometry may help.

If this also does not help you might have a little bug on your hand that prevents certain actors from being placed. Try placing them somewhere else in the map and move them from there to where you actually want them. This occurs from time to time. No idea how to fix it.

Actually, I figured out that I was placing a bugged actor, and not the correct random weapon spawn one. The actor was using a null staticmesh, and so did not appear on the map. I found the correct actors for random item spawns and ammo, and they worked fine. I corrected the broken actors by using find actor to bring up actor properties, then assigning them a sprite instead of a staticmesh so that I could select and delete them. However, this still forces me to wonder... how do mappers create pickups for specific weapons? for example, a LAW rocket launcher, or crossbow, etc... I want to place nice pickups on my map in dangerous and hard-to-reach places as an incentive for players to... well, frankly, do stupid things that get them killed. :D

Thanks a ton Murphy! your tutorials are some of the best I've read, and you've really helped a lot. I'll be sure to credit you for helping me out with this on my map. I've gotten my first ever UE map from nothing to playable beta in under 24 hours, and I couldn't have done it without you.
 
Upvote 0
OR you could doube click the problem actor in the bug report (after complete rebuild) and it will select that actor in the map, so double click it, move in 3d a little bit without selecting anything, hit delete, and the bugged actor will be deleted even if you cant see it.

I tried that multiple times, actually, but it didn't work. The actor was selecting so I could view actor properties with F6, but hitting delete did nothing, since I wasn't highlighting it in the view. I imagine this is a bug, but either way, it was not possible to delete without first assigning it a placeholder to select.

By the way, I have another couple issues that maybe someone can help me with.... my kfdoormover objects (staticmesh) seem to be illuminated even when there is no light. I checked the unlit flag, but it's set to false. any idea why it's doing that?

Also a word on zombie spawns... I have a plan to make an extended tunnel system below the main area of the map, like a labyrinth of corridors, but the pathing through them would be somewhat linear when unfolded, so it would take a long time for zeds to reach the tunnels from the outer spawn areas, and vice versa when I add spawn points down below. Is there a way I can set spawn points to have a MAXIMUM distance to player, or otherwise make them not spawn zeds if players are not in the vacinity, so that, if players are on the field, they don't need to wait for zeds spawned in the tunnels to get to them, and vice-versa?
 
Upvote 0
my kfdoormover objects (staticmesh) seem to be illuminated even when there is no light.
Properties -> Display -> StaticLighting=True. By default it's false. As it can move it kind of makes sense to make it treat light dynamically so it can be lit differently in its different positions, however since dynamic lights do not have shadows and shine through walls this sometimes leads to doors being illuminated although they shouldn't be because some light from somewhere shines through the map onto the door.
With StaticLighting set to True it is lit like a normal StaticMesh.

Is there a way I can set spawn points to have a MAXIMUM distance to player
Not that I know of, but the game should chose intelligent spawn locations automatically. If that's not good enough increase the spawn-rate in the KFRules (I think it's called KFRules). If that's not good enough either you might have to reconsider the layout of your map.:(

Now I'm going to have to ask, how do zones work?
http://www.angelmapper.com/gamedev/tutorials/optimization1.htm
 
Last edited:
Upvote 0
I tried that multiple times, actually, but it didn't work. The actor was selecting so I could view actor properties with F6, but hitting delete did nothing, since I wasn't highlighting it in the view. I imagine this is a bug, but either way, it was not possible to delete without first assigning it a placeholder to select.

By the way, I have another couple issues that maybe someone can help me with.... my kfdoormover objects (staticmesh) seem to be illuminated even when there is no light. I checked the unlit flag, but it's set to false. any idea why it's doing that?

Also a word on zombie spawns... I have a plan to make an extended tunnel system below the main area of the map, like a labyrinth of corridors, but the pathing through them would be somewhat linear when unfolded, so it would take a long time for zeds to reach the tunnels from the outer spawn areas, and vice versa when I add spawn points down below. Is there a way I can set spawn points to have a MAXIMUM distance to player, or otherwise make them not spawn zeds if players are not in the vacinity, so that, if players are on the field, they don't need to wait for zeds spawned in the tunnels to get to them, and vice-versa?

it works fine for me, you just have to move a little bit in 3d, then just hit delete/or edit->delete, then rebuild, and the no-viewable actor will be gone.
 
Upvote 0
Properties -> Display -> StaticLighting=True. By default it's false. As it can move it kind of makes sense to make it treat light dynamically so it can be lit differently in its different positions, however since dynamic lights do not have shadows and shine through walls this sometimes leads to doors being illuminated although they shouldn't be because some light from somewhere shines through the map onto the door.
With StaticLighting set to True it is lit like a normal StaticMesh.

This makes sense now... seems dynamic lighting simply DOES NOT work properly in unreal engine 2.5. Is this the same reason lights will illuminate actors on the other side of closed doors, and trigger lights will seem to shine through the entire map, ignoring walls and distances? Are there any intelligent solutions/workarounds to the above?

This has been a huge pain for me, since I want specific effects, such as bright lights behind a door that spill through when the door is opened... but static lights on one side of the door will not illuminate walls on the other side, but will illuminate actors... and both of these regardless of whether the door is open or closed. :confused:

EDIT: I tried setting StaticLighting to true, but now the door is ONLY illuminated by my flashlight, not static lighting in the room. static lights still shine through to illuminate things behind it, though.

Not that I know of, but the game should chose intelligent spawn locations automatically. If that's not good enough increase the spawn-rate in the KFRules (I think it's called KFRules). If that's not good enough either you might have to reconsider the layout of your map.:(

I guess I'll settle for keeping spawn locations above only, and just giving zombies a shortcut to the lower levels. Should do the trick... it just opens up a can of worms with regards efficient pathfinding and balance...

EDIT 2:
I just had a long, descriptive post typed out, but then I accidentally hit reply instead of save, and lost all of it... so going to try and keep this short.
New problem:
after adding fixed weapon and armor spawns in a lower zone of the map, the random item spawns in the main area of the map no longer work. Specifically: items appear only VERY rarely (I saw a total of 4 items spawn across all 5 spawn points in 20 waves), and ONLY items with fewer than 2 fixed spawns will spawn at all. Ammo spawns also seem to be unreliable and less frequent with more ammo spawns elsewhere in the map.

How can I fix this? is there a setting somewhere for me to change the maximum number of item spawns or number of spawns per item for the game?
 
Last edited:
Upvote 0
This makes sense now... seems dynamic lighting simply DOES NOT work properly in unreal engine 2.5. Is this the same reason lights will illuminate actors on the other side of closed doors, and trigger lights will seem to shine through the entire map, ignoring walls and distances? Are there any intelligent solutions/workarounds to the above?
Dynamic lights don't cast shadows in UnrealEngine 2.5. Not in the version used by Killing Floor anyways. You can use projectors instead, but it's only feasible to use them for certain special occasions and not all over the map. a) because it's a p.i.t.a. to set up and b) because they are handled by the cpu and since KF can only utilize one core and is a cpu-hog all around one should be careful with letting it work even harder.

This has been a huge pain for me, since I want specific effects, such as bright lights behind a door that spill through when the door is opened...
Projectors. There is no other way.


EDIT: I tried setting StaticLighting to true, but now the door is ONLY illuminated by my flashlight, not static lighting in the room. static lights still shine through to illuminate things behind it, though.

Display -> bShadowCast=True to make it case shadows.
Rebuild Lighting to make it lit by lights that shine on it. Beware that StaticMeshes are only lit per Vertex, not with lightmaps. If your door is only a box and all of its vertices are hidden in walls then it won't receive any light and thus remain black!
 
Upvote 0
Dynamic lights don't cast shadows in UnrealEngine 2.5. Not in the version used by Killing Floor anyways. You can use projectors instead, but it's only feasible to use them for certain special occasions and not all over the map. a) because it's a p.i.t.a. to set up and b) because they are handled by the cpu and since KF can only utilize one core and is a cpu-hog all around one should be careful with letting it work even harder.


Projectors. There is no other way.
What exactly is the point of lighting that doesn't cast shadows? heh...
I tried it with a couple diff projectors, but the end result never seemed to differ from a static light, which is to say it didn't work. Oddly enough, the light didn't seem to penetrate beyond the bounds of the radius [/i]until[/i] I gave one of the zones an ambience (the other two have no ambient, but all actors and staticmeshes in them are now illuminated). I'll give it another go here in a bit. You wouldn't have any recommendations for a better tutorial on projectors would you? so far I've tried the headlight one, which acted like a static, and the flashlight one, which crashed the editor.




Display -> bShadowCast=True to make it case shadows.
Rebuild Lighting to make it lit by lights that shine on it. Beware that StaticMeshes are only lit per Vertex, not with lightmaps. If your door is only a box and all of its vertices are hidden in walls then it won't receive any light and thus remain black!
will try this. my doors are indeed boxes, though the vertices were flush with the walls, not inside them... would this be a problem? I ended up adding trim to the walls until it intersected with the edges of the door thinking it might solve the problem of light shining through, though since it didin't there's really no reason to keep it that way other than aesthetic, which I can work around... I was going to rebuild the door mesh anyway.

EDIT: I just checked, and bShadowCast IS set to true... :/ any other ideas?
here's the file if you want to look at it... the doors that light are shining through are traderdoor and armorydoor (the one to the room at the very bottom of the map) http://skycommand.org/savage/KF-Colosseum-v0-9b.zip
 
Last edited:
Upvote 0
For question 2 look at Departed this map in ceiling sections uses Zombienodes, a special type of node to force zombies in a particular path.

Look how they have also set the property of 'forcedpaths' to the particular tag of the node they want it to go to, this should force the zombies to use a particular route.

The nodes I refer to are located in the ceiling holes of the map, where they essentially want the zombies to use the hole and not try to run around horizontally if the players are beneath their position.

This isnt a complete answer however its just better to look at how its been done there.
 
Upvote 0
For question 2 look at Departed this map in ceiling sections uses Zombienodes, a special type of node to force zombies in a particular path.

Look how they have also set the property of 'forcedpaths' to the particular tag of the node they want it to go to, this should force the zombies to use a particular route.

The nodes I refer to are located in the ceiling holes of the map, where they essentially want the zombies to use the hole and not try to run around horizontally if the players are beneath their position.

This isnt a complete answer however its just better to look at how its been done there.

Well, the main problem with this is, if players DO get into that room, the zombies need to attack them, not run outside as before, then circle back to bust through the door.

I've gotten it to mostly work at this point using a few mode nodes for smoother pathfinding, and by setting the door node to a high distance penalty... but for some reason, ONE solitary clot will ALWAYS knock at the door until it's down, even thogh all the others take the correct path.... I'm not sure why, but it happens every wave. :/
 
Upvote 0