Editing FAQ - Troubleshooting & How-To

From The DarkMod Wiki
Jump to navigationJump to search

Below are some common issues and questions mappers have had in the Editor's Guild forum with common solutions. Some of this assumes you've already gone through the A_-_Z_Beginner_Full_Guide_Start_Here! and Startpack_Mappers'_Guide

Troubleshooting FAQ

Rendering & VisPortal Issues

Q. Some of my brushes have disappeared or turned black and won't render.

A. This can happen when two touching brushes around the seam are not perfectly flush with one another and the rendering hiccups for those brushes & brushes behind it, either there's a tiny wedge or overlap or gap or weird angle between them. The usual solution is to make sure the brushes are snapped to the grid and perfectly flush against one another, or more generally to simplify the brushwork around the seam of the disappearing brushes.


Q. My visportal is not closing like it should (you can check this with by typing "r_showportals 1" in the console).

A. A common reason for that is that the two areas separated by the portal are not hermetically sealed and there's an internal leak, either (1) there may be an unportaled gap between the two, possibly covered up by func_static (which do not seal) or possibly caused by an inadvertent hole created by the first FAQ question above, or (2) an internal leak can happen when all sides of the visportal are not buried in or flush against sealing brushes, and there's a gap between the visportal and brush, or possibly even a tiny gap just touching the visportal side is enough to break it. A way to check if there's an internal leak, and locating it if there is, is described here: Visportals#Trouble-shooting. Other reasons it might fail are also described there (such as accidentally changing a nodraw texture to something else).


Q. I can see other rooms behind a mirror (or any reflective surface) through it, instead of just a reflection.

A. The area behind a mirror should be in a separate leaf (visportaled area) behind a closed visportal so it doesn't render. This problem usually means the two areas aren't in separate leafs, the portal isn't closed, or there's an internal leak between the areas in front of and behind the mirror.


Q. Help! I'm having rendering & visPortal issues all over the place ... broken portals, sparkly lines, disappearing brushes, z-fighting, uneven walls, etc.

A. As a general piece of advice, messy brushwork leads to trouble one way or another. To keep your brushwork clean: keep snapped to the grid (Cntl+G toggles) & stay away from small grid levels (Typing a number or Plus/Minus changes the grid scale; 8 is a good starting grid; staying at or above 2 or 4 is fine for most stuff; going below 1 is usually just for special situations). Make brush intersections perfectly flush. Stay away from unnecessary tiny brushes & wedges (leave detail work to func_statics; brushes are for closing off leafs and the void. Of course you can do fine detail work with brushes & convert them to a func_static). Don't use the "CGS Subtract" tool if it will shatter the brush into tiny slivers; use the cut tool instead. You can use patches for uneven geometry with square brushes underneath textured with caulk. When rotating geometry, avoid weird angles when you can (where vertexes end up off the grid), and for multi-brush structures, build the whole thing first *then* rotate it all together instead of rotating & placing each brush individually. These aren't rules set in concrete if you want to do something special once in a while, but general rules of thumb that will make life a lot easier if you generally stick to them.

Crashes

Q. I have encountered a malloc failure error while dmapping my level. Instead of finishing with the dmap operation, it crashes midway with an error message.

A1. One solution to this is given in the Dmap wiki entry here: Dmap#Malloc_Errors.

A2. This is what I've done to fix this exact issue. Open the map in DarkRadiant, select everything, copy to clipboard. Open another instance of DarkRadiant and paste from clipboard. Save as new filename and dmap new file and that has worked 3 times now with random unresolvable crashes.

A3. GC and I have found correlations between visportalling and mAlloc errors. Time to re-arrange your visportals. In NHAT, we had many malloc problems until we retooled how each area was portaled. Originally, every other visleaf had tons of entities, while half had hardly any. That's not neccessarily bad, but it strains the dmapper when one or two visleafs are cluttered with entities that really bloat your mapname.proc file. We added a few more portals to even out entity distribution, and dmap was happy again.

Q. My map has a leak in it, but a pointfile either isn't generated or doesn't make sense. (A pointfile is generated when dmap occurs and there's a leak, then you open DarkRadient and click File>Pointfile to see it. It normally runs a red line that ends in the void, pointing out the leak).

A. Make sure a gap isn't covered up with func_statics. If the origin of a model is in the void it will also cause a leak with a non-sense pointfile. Read more on the Leaking maps page.

Q. How do I scroll up through the console output to see what a problem was during dmap or map or in-game?

A. Use the mouse wheel or PageUp/Down to scroll through the console.

Performance Issues

Q. My map is so slow. How do I improve performance?

A. See these wiki entries: Performance:_Essential_Must-Knows, Pathfinding (Monsterclipping helps performance), and Interleaved_Thinking_optimization (reducing AI think-time helps performance quite a bit). Other quick tips include breaking-up long lines of sight, improving visportal & leaf placement (so less architecture is rendered at a time), converting ornamental brushwork into func_static, reducing the overlap of light sources on surfaces by adjusting their placement & reducing their light-radius, and setting brushes and objects to "noshadow" if it won't be noticable to the player (or you can use low-poly shadow meshes). There are also lots of other tricks out there if you check around the forums, including more advanced & optional tricks such as using the LOD system LOD or SEED system SEED, or putting distant architecture in the skybox instead of in the map, that you don't have to worry about if you're a new mapper.

Issues with Objects

Q. My streetlight, candle, lamp, light-creating object, causes a weird shadow I want to get rid of.

A. Put the spawnarg "noshadows" "1" on the offending object.

AI Issues

Q. My AI will not pass through a visportal no matter how I set up the path nodes.

A. Check that the sides of the visportal use the nodraw texture (except for the portal-face itself of course).


Q. How do you get AI to walk on complex terrain patches or func_statics?

A. You can always lay down invisible monsterclip brushes and the AI can walk on it. Overlay with a brush with a "material" clip texture so it causes the right sound for footsteps.

Issues with Lighting & Sound

Q. Some of the parallel lights I use for moonlight aren't giving off any light.

A. This is a known problem with parallel lights. For some reason in some arrangements you get no light at all. Just fiddle with it a bit - move it slightly, change the radii, move the vertex a bit - and it should suddenly work. Once you've got it working then it's stable. Likely the code chokes on certain values in its calculations. ... Also, to help optimize your moonlight, you should adjust the radius so it's only as big as it needs to be. You may also want to move the actual position of the little moon cube in the skybox to match the parallel light (and make sure to fix the texture on it if you mess it up - hint: lock textures before moving cube to make it easy)

General How-To Editing FAQ

Dark Radient Questions

Q. Can I manipulate brushes to resize and reshape them?

A. Yes. In DarkRadient you can select a brush and push "V" to select verticies to drag and resize, "E" to select edge(s) to drag and resize, and "F" to select face(s) to drag and resize. "Ctrl+#" makes a selected brush be #-sided. You can also use the Brush>Prism and Brush>Cone to convert a brush to those shapes.

Q. What are some common DR commands?

A. "H" hides selected items. "I" inverts selected. "Ctrl+I" inverts a patch's normal. "J" brings up entity list. "Ctrl+K" makes 1st-selected-entity "target" 2nd-selected-entity. "L" brings up light inspector. "N" brings up entity inspector. "T" brings up texture browser. "X" go into clipper mode. Brush manipulation modes: are "R" rotate brush, "Q" free-move & resize, "W" translate-move.

Q. I screwed something up! What do I do?!

A. Ctrl+Z undos. Ctrl+Y redos.

Q. Is there a way to build one section at a time without other sections getting in the way?

A. DR has a layer function that lets you build one "layer" at a time. It also improves DR performance, which is handy as the map gets bigger.

Q. How do I set up things like the pre-game shop, the player inventory, and an in-game map?

A. All these things are described in the Startpack Mappers' Guide: Startpack_Mappers'_Guide#Ammo.2C_Weapons.2C_Player_Tools.2C_Start_Inventory, Startpack_Mappers'_Guide#Purchase_Shop, Startpack_Mappers'_Guide#Adding_an_In-game_Map_to_your_FM

Objectives

Q. How do I set up a put-object-here objective?

A. Instructions are here [1]

Q. How do I set up a "ghosting" objective (e.g., you are busted if you are seen.)

A. Instructions are here [2]

Handling Objects

Q. How do I attach a door handle to a door?

A. Just position the handle and input "bind" and the door entity ID/name as a spawnarg.

Q. How do I make an object into loot?

A. Instructions are here [3]

Q. How do I make an entity frobable?

A. See the entry for Making an Entity frobable.

Q. How do I get a lever or button to open a door?

A. Instructions are here [4]

Q. How do I put some text on a sign or wall?

A. You can use this method [5]

Q. How do I bind something to a rope (like a body) so it doesn't fall?

A. Dynamic ropes are unreliable, so it's good to use a func_static like a chain or make a func_static rope from a cylinder brush. For a ragdoll, place the ragdoll so he clips into the func_static. You need to bind the ragdoll to the chain (so the spawnarg is on the ragdoll), with "bind" "func_static_...", where func_static_... is the chain. Or, through DR, you can just select the entity you want to attach (the ragdoll), then also select the thing you want to attach it to (the chain), and in the menus select "Entity" - "Bind selected entities". But it's been reported the clipping does the job, not binding. See this link [6]

Q. How do I make something switch from frobable to unfrobable like a used lever (or unfrobable to frobable, like contents in a chest or drawer you don't want frobable until it's open)?

A. Make a brush around the object with a clip texture and convert it to an atdm:target_set_frobable entity, with the property "start_frobable" 1 or 0 depending on your case (it affects everything inside), and a triggering entity targeting the set_frobable entity that triggers the switch.

Q. How do I make breakable glass?

A. Instructions are here [7]

Q. How do I make an object that you can frob and it does something or something happens?

A. If it's an object you made from patches or brushes, make it into a frobable func_static, or if it's already a func_static, make sure it's frobable (Making an Entity frobable). Then give it a Frob response whose effect is a trigger, and give it a "target" spawnarg to the entity that causes your effect when triggered.

Q. Can a lever or button target multiple entities?

A. Yes! Use the spawnargs "target1", "target2", "target3", etc, with each entity-target as a value. A quicker way is to use the keyboard shortcut Ctrl+K. Select the button or lever, then select the target-entity and hit Ctrl+K. De-select the target-entity then select the next one, hit Ctrl+K again. Each time adds a new target to the switch.

Q. How do I make a rotating entity, like a fan?

A. Instructions are here [8]

Q. How do I make objects non-solid so they still render but the player can walk through them?

A. Add the spawnarg: noclipmodel 1 to turn them into non-solids.

Handling AI

Q. How do I make sure a guard can unlock a door?

A. There are a few different ways, explained here [9]

Q. How do I attach a key or purse to an AI's belt, or similar kinds of attachments?

A. Place the key or purse around the belt area where you want it, sticking a little farther out than usual, and rotate it as desired. On the key add the property "bind" with the value of the AI's entity-ID or name, then the property "bindToJoint" with the value "leftHips_dummy" or "rightHips_dummy" as needed. For attaching things in other places (like a ring or hat or necklace), it's the same general principle but you should look up the joint to attach to. A list of all the joint names is here: BindToJoint. See this wiki entry for more info Attaching_Items.

Q. What about other kinds of attachments where special animations are involved, like torches and weapons?

A. For these you want to use Def_Attach. See this wiki entry Attaching_Props_to_AI. For heads & weapons specifically see this wiki entry Adding_Heads_and_Weapons_to_AI.

Q. How do I mute an AI?

A. Give the AI the spawnarg: def_vocal_set atdm:ai_vocal_set_mute. If you only want to mute some barks, you'll have to modify the AI's .def file by hand, taking or commenting out the barks you don't want, and packaging the new def file in your mission's pk4. For coughing and animation based barks, see this post [10]

Q. Can I hide an AI until I trigger him?

A. No, hide doesn't work with AI. Use a teleport to teleport the AI instead, or a teleporting script. (When I find instructions, I'll link to them. You also need to check about starting him on a path after a teleport; there are issues with it. There's a post talking about this problem I'll try to find & link here too.)

The Player

Q. How do I do things with the player's inventory, like trigger an inventory item to be deleted, or an item to be added to the inventory, or one item being replaced with another item?

A. You can do all these things by having your triggering mechanism trigger a script, then use the appropriate script command in the script on $player1. A list of the commands is here Inventory#Scriptsupport. Useful commands are (replacing the "Item" variables with the item ID): $player1.addInvItem(inv_item); and $player1.replaceInvItem(oldItem, newItem); (note: If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens.)

World Building

Q. What's a good way to make caves?

A. Some tips are here [11]

Q. How do I make a good looking roof using clean brushwork?

A. See this method as a good example [12]

Q. What's a good way for making a forest or a big outdoorsy area?

A. Link to answer coming.

Textures

Q. Can I blend textures?

A. Yes. This is particularly good for dirtying some textures up by blending in some grime. Link to answers coming.

Q. How about blending texture transitions so there isn't a sharp seam, e.g., for a dirt path in grass?

A. There are ways to do this. Answers coming.

A1. in NHAT that the blended terrain was made from patches broken into segments then exported as ASE models. Then the models were vertex painted in Blender and imported back into Dark Radiant.

Lighting and Sound

Q. How do I add music or ambient sounds? Q. Can I dynamically adjust the ambient lighting?

A. For both of these things, check out the article for Location Settings