DOOM 3
Недостатньо оцінок
Maxell's Tutorials for id Tech 4 engine (aka DooM 3 Engine)
Автор: Professor Icros
This is the complete translation of the tutorial made by Martin Pezlar aka Maxell that will help to understand and modify the id tech 4 engine, keep in mind that this is the "old" way meaning that most of the tools and procedures described are around the time the game was released.

Over the course of the years there's been some plugins and tools being developed unfortunately some of them are no longer compatible with newer software or they're still unfinished or simply there's not enough documentation on how to use them

That's why despite this tutorial being seemingly outdated it will provide a good reference on the workflow for making custom content and maps for DooM 3. Most of Maxell's tutorials are in Czech so i'm taking the time to finish translating them to english and later to spanish.
   
Нагородити
До улюбленого
В улюблених
Прибрати
Tutorial 01 - Introduction to id Tech 4 engine
Creation of models, animations, environment and all other content for computer games is quite specific issue. Compared for example with creation of models and animations for CG scenes for films, some procedures are similar, other completely different. And what is worse, each game engine has its own procedures for content creation. However, there are main “rules” that apply to content for all computer games. One of the most important “rules” is an effort to create optimal and effective representation of content while maintaining adequate hardware requirements and high audio-visual quality.

These tutorials deal with procedures of content creation and its transfer to id Tech 4 engine (rather Doom 3). Keep in mind that these tutorials require knowledge of Adobe Photoshop, Autodesk Maya etc. In other words, you have to have skills with bitmaps, 3D modeling and animation. For this reason, tutorials will not deal with teaching these areas. Contrary, main attention will be given to procedures directly related to transferring content to id Tech 4 engine, workflow in associated editors and other useful tools, which will ease our work.

In the beginning, id Tech 4 engine was referred to as Doom 3 engine. First alpha versions were based on previous Quake 3 engine (id Tech 3). During the development id switched from C language to C++ and so part of an older engine were rewritten too. Like previous Carmack’s 3D engines, this id Tech 4 engine was also build under OpenGL. So main advantages at that time were kick-ass visuals and also cross-platform support (Microsoft Windows, Linux, Mac OS X).

John Carmack began work on id Tech 4 after completing the Quake 3 Arena, so that means in the end of year 1999. But unexpected long development caused that the first game on this engine – Doom 3 – wasn’t released until summer of year 2004. This game was quite successful. But there was also a wave of criticism aimed particularly at the darkness of the game. Some people claimed that Doom 3 is just “pitch black darkness with sound“. Despite similar criticisms this game earned its place in the world of computer games and received many awards.

The main technological contribution of the engine is feature called “Unified lighting and shadowing”. Previous three-dimensional games, such as already mentioned Quake 3, used separated type of lighting for static elements (game environment aka map) and dynamic elements (characters, moving models etc.). Data for storing lights and shadows in the static map has been made in advance and saved into so-called “lightmaps”. On the contrary, dynamic lighting on the moving models etc. has been rendered on fly. This separation often led to unrealistic lighting of dynamic objects in otherwise static-lit map. Simply put, that is why the id Tech 4 has “unified” lighting. This also dropped off the need to pre-render map lighting, which saves a lot of time during map development.

Another important technology is called “Megatexture”. This technology allows us to use high resolution texture instead of small tiled textures on terrains. Doom 3 supports Megatexture technology in very limited way. When Doom 3 was released, this technology was still under development. First game, which used all capabilities of Megatexture was Enemy Territory: Quake Wars. This was the game where id Tech 4 engine proved its ability to render also huge beautiful outdoor scenes, which were missed by that time in this engine.

Id Software is currently developing new remarkable technologies that will be used in games based on id Tech 5 engine. According to recent reports on upcoming Rage and Doom 4 we can just look forward to.

File structure of id Tech 4 engine
After quick introduction to id Tech 4 and its important details, we will focus first on how game content is stored and used by engine. If you have any experience with previous engines (Quake 2 and higher) from id Software, here will come handy. The principle is very similar. The entire game (executable file, libraries, config files etc.) is stored by default Windows install on the following path:

C:Program FilesDoom 3

In this directory you can find executable file “Doom3.exe” and subdirectory named “base”. Maybe you can find there more other files or subdirectories, but they are not significant for us. If you open subdirectory “base”, you will find different types of files. Below is description of these types:

.cfg – Configuration ASCII files aka “configs”. These files contain engine settings (video resolution setting, graphical quality, sound setup, settings of input devices etc.). Config files can be edited in a text editor.

.pk4 – Files containing the game data - there are two kinds these files. Ones are named like “game##.pk4” and other “pak###.pk4”, where # symbol represents any digit. Files that start with “game” in name contain game libraries, other with “pak” in name contain compressed game content.

Note: In the “base” directory there is also another ASCII file named “doomkey”. This file contains your game license (so-called CD-KEY) for Doom 3.

Further, we will look on “pk4” files containing game content with greater detail. These files are nothing “special”; they are just Zip format archives with changed extension. If we rename them back – change extension from pk4 to zip – we can open them.

Tip: For opening and extracting content of pk4 files we can use any Zip-compatible utility. I recommend free open source program 7-Zip.

When for example file “pak000.pk4” is opened, we can see that within this archive is lot of files and directories. There is directory called “maps” which contains maps, there is directory “textures” that stores textures and so on. As you can see names of files and directories speak for themselves.

Also it is good to know, that if several pak-files contain a file with same name, the engine will use that file which is located in the pak-file with the highest number. So if we have two identically named textures – one blue texture in “pak007.pk4” and other red texture in “pak008.pk4” – engine will use just the red texture.
Tutorial 02 - Tools and Editors (part 1)
In this chapter we go through the list of tools and editors that we are going to use for creating content. This includes both – editors integrated directly in engine as well as third party tools. We briefly describe all of them; more information will be given during next chapters.

Note: For creating this series of tutorials I’ve used my personal experience as well as these sites as help source: iddevnet, modwikidotnet, discussion forum doom3worlddotorg.

The sites mentioned above are down and only archived version are available

Adobe Photoshop
Photoshop is well-known and widely used program among professionals. This is a 2D bitmap with many useful features. We will use this program mostly to create textures. If you are used to any other bitmap editor (Paint Shop Pro, Gimp etc.) that is fine, you don’t have to strictly use Photoshop.

Autodesk Maya
Also Maya is very known 3D program. Especially it is popular among animators, but it is full-featured 3D package. So we will use it during tutorials not only for animation but also for modeling. To convert Maya models to Doom 3 you will need older versions of Maya - versions 4.5, 5.0 or 6.0.

Pixologic ZBrush
ZBrush is relatively new tool, it was introduced to public in 1999, and its demo wasn’t released until 2002. This tool combines the best of 2D and 3D graphic editors together. Modeling of 3D objects takes place in a way of painting or rather sculpting with brushes. ZBrush allows you to create very detailed 3D models, which can be also textured by this tool etc. In the process of content creation for id Tech 4 we will use ZBrush to produce high detail models (aka nextgen models). Basic work-flow for creating high detail models will be shown in the final chapter dealing with character models. Trial version of ZBrush is available on its home page.

Crazybump
Crayzbump is tiny but very handy tool for creating and editing normalmaps. With help of Crazybump, we can create high quality normal maps right from digital photos. This tool also offers creation of specularmaps, displacmentmaps, and fake occlusionmaps. During these tutorials we will use Crazybump mainly for normalmaps for textures or editing existing normalmaps exported from ZBrush. Demo of Crazybump is available on its home page.

Id Tech 4 Editors
Unlike most other engines, id Tech 4 has built-in editors. These all editors are in single executable file “Doom3.exe”. Therefore these editors can be started by commands in the running game. The engine has built-in different kinds of editors. Let’s describe them all step by step.

There are two ways how to start editors. The first way is to run command from the console. Follow steps below.
  • Run “Doom3.exe”.
  • Open console by pressing “~” (it is a tilde key under the “Esc” key). If nothing happened, try to press “Ctrl + Alt + ~” instead.
  • Type commands in the command-prompt of the console.
Tip: Similar to Linux terminals, also id Tech 4 console is possible to complete commands and variables by pressing “Tab” key. For example, if you type in console “noc” and then press “Tab”, this command will be automatically completed to the “noclip”. When there are multiple commands/variables starting with same letters then engine will make list of them and print them in the console. If you keep pressing “Tab”, engine will change completed command/variable gradually by the entries in that list.
Tutorial 02 - Tools and Editors (part 2)
The second way is to use parameters on “Doom.exe” startup. This method is especially suitable for frequent use of editors. It saves time because you don’t have to type same commands again and again. Further, we will create shortcut file with required startup parameters.
  • Create ordinary Windows shortcut of “Doom3.exe” and place it on the desktop (or wherever you want).
  • Go to shortcut’s properties (right click on shortcut and choose Properties).
  • Go to tab named “Shortcut” and edit content of the field named “Target”. There is path to “Doom3.exe” – after that path enclosed in commas, add your required parameters.
    "C:Doom3Doom3.exe"
  • After addition of startup parameters, whole field may look like example presented below.
    "C:Doom3Doom3.exe" +set r_fullscreen 0 +editor
  • Then confirm changes by pressing “OK” button.
Now, when we learned the ways how to start editors, we will take closer look at each of them. Each built-in editor is listed below by its exact command name (though id Tech 4 console isn’t case sensitive). Also short description and basic controls will be mentioned in this list.

editPDAs
If you have played Doom 3 you know that there is PDA in the game. So this is simple editor for creating and editing PDA entries (editor isn’t quite finished so you can edit only emails). When you run “editPDAs” command you will see editor’s window. On the left side there is list of PDA items. On the right side there are text fields for editing of selected item. Also there is “Save” button for saving your changes (if this button is grayed out check you writing rights or whether you don’t try to save directly into pk4 file).

editGUIs
Id Tech 4 engine has sophisticated graphical user interface (GUI) system. These GUIs are used in the maps (interactive computer screens, buttons etc.) but also as a main game menu (menu with save game, load game, game settings etc.). To make GUI, you have to create its images and script its functionality – and that isn’t easy. Therefore Raven Software developed basic WYSIWYG editor for GUIs. It doesn’t support all features of the GUI system but it is very useful editor for creating basic custom GUIs and other tasks such as setting up right coordinates of images in your GUI etc.

When you run “editGUIs” the main window of GUI editor will appear. On the upper left side there is typical program menu “File, Edit, View …” and other menu items which are also available under right click menu on the background of GUI editor window. In the main editor window there are smaller tool windows. Namely there are following tool windows: “Transformer”, “Properties” and “Navigator”. The first mentioned window displays XY coordinates of selected GUI element and its dimensions, these values can be adjusted instantly trough the window. Next “Properties” window – it shows properties of the selected GUI element, all properties are also editable trough this window. And the last window “Navigator” is perhaps the most important tool window. It displays entire tree of GUI elements - something like layers in Photoshop. When you expand some layer all its properties will appear, you can directly edit them. Also visibility of each layer can be enabled/disabled.

editDecls
This editor is for viewing, editing or creating game declarations. When you start editor by “editDecls” command window of editor will pop up. This window displays tree list of all declarations used in the game. If you want to open up some declaration, just double click on its name in the list (or select its name and click on “Edit” button). Opened declaration is displayed in the new window. You can edit declaration in this window. Basically it is text editor with color syntax highlighting and with check for unclosed brackets (hit “Test” button for checking).

Tip: If you want to edit game scripts use Script editor. But don’t do it usual way by running its command (“editScripts”). Rather fire up Declaration editor (“editDecls”) and browse to “scripts/” branch and select one script and hit “Edit” button or use double click for opening. New window will appear and guess what – your selected script is opened in the Script editor.
Tutorial 02 - Tools and Editors (part 3)
Note: The following four editors (editParticles, editAFs, editSounds, editLights) need running game or the DoomEdit with loaded map to work properly. You can start these editors even without running game but you can’t do anything in them.

editParticles
This command starts Particle editor. This editor is in the form of window with lot of editable items, but it is very intuitive. You can create custom particle effects like smoke, fire, lighting, bubbles, etc. When you want to create your own particle effect, first try to find one that roughly matches your needs and then edit it according to your wishes. It is really faster way than creating new one from scratch. Just change its material and parameters (Speed, Size, Count...). If you start up Particle editor in the running game with loaded map you can see your selected effect right in front of you in the game world. Changes of parameters are immediately shown on ingame particle effect preview.

editAFs
Letters “AF” in the command stand for “articulated figures” – better known as “rag dolls”. These terms refer to physical simulation of character’s body anatomy which replaces “static” death animation. For example after you kill an enemy character, the engine will switch to rag doll animation of this killed character. This rag doll animation is based on collisions of rag doll bodies in real time. Articulated figures editor is tool for defining these rag doll bodies in id Tech 4 engine. More information about Articulated figures editor will be given in the final chapter dealing with character creation.

editSounds
As the name of this editor suggests, this editor manages sound effects. With this Sound editor you can only insert sound entities into your maps and set their parameters. You can’t create or generate new sounds in this editor; all your source sound files have to be prepared in advance. Doom 3 supports Wav and Ogg formats. You can use these formats directly in the engine or in sound shaders. In the case of sound shaders, the engine offers better control over sound effects (you can set variants of one sound, volume, looping…).

The Sound editor is designed primary for sound guys (non-level designer) to run around the levels and create a spooky acoustic experience, so it works independently of DoomEdit. Inserted sound entitles can be eventually saved in the level (directly saved as a sound entities in the map file).

editLights
This command activates Light editor (in the DoomEdit press “J” key). Light editor itself is very simple. The Doom 3 engine has three types of lights (or exactly two types, while the Parallel Light is a special type of the Point Light).
  • Point Light – is the omnidirectional light; it is similar to light bulb in the real life. There is a center point, and it lights up everything in some radius around that center point. Objects closer to the center point are illuminated more. Size of the light is set by the Radius parameter. Brightness of the light is influenced by a brightness of used color.

  • Projected Light – A projected light goes off in one direction only, away from the light source (like a flashlight). Size and shape of light cone can be adjusted. You can adjust it by changing matrix numbers in the Light editor or easier way by dragging pink points of the light in the DoomEdit (adjusting cone size and its orientation in a space). Appearance of projected light can be changed by setting up texture.

  • Parallel Light – By marking the light as parallel, the light acts as if the center is extruded out to infinity. All the shadows will go in the same direction, and all the highlights in the bumps will face the same direction. This is very handy for creating ambient light or sunlight. In comparison with normal Point light you have to use higher Radius values to match normal results.
Tutorial 02 - Tools and Editors (part 4)
editor
This command starts DoomEdit – the map editor of Doom 3. DoomEdit is loosely based on previous Quake 3 Radiant map editor, so user interface and tools are very similar. However, there are also completely new and different features.

DoomEdit can be launched by “editor” command entered in the engine console. But if you use DoomEdit often, the better way is to create “Doom3.exe” shortcut with parameters (instructions have been already mentioned earlier). To launch DoomEdit properly use following parameters.
"C:Doom3Doom3.exe" +set r_fullscreen 0 +set com_allowConsole 1 +editor
Note: The example above assumes Doom 3 installation in the “C:Doom3”, use own actual installation path. If DoomEdit crashes on startup or doesn’t start at all, try to disable antialiasing by adding one more parameter “+set r_multiSamples 0”.

Doom 3 maps are defined by four different file types. Each of there file types is stored in ASCII format for easy handling and easy development of third party tools. Let’s describe propose of these file types now.
  • .map – The .map file is the main file that is created when you edit a file; it defines all the entities and brushes in the map. The other three files are all generated from the .map file with the dmap command. The format hasn't changed much from the Quake series.
  • .cm – The .cm file defines the collision geometry in the map. It is used by the physics system for collision detection.
  • .proc – The .proc contains all the pre-processed geometry in the map. It stores all the visible triangles, batched up in to surfaces. It also stores all the portal information and any pre-calculated shadow volumes (if a light doesn't move, and a brush doesn't move, the shadow volume can be pre-calculated).
  • .aas – The .aas files contain the “area awareness” data for the AI to navigate through the level. A separate aas file is generated for each size monster. Generally an aas48 and an aas96 file is generated for most monsters sizes. If a map has a special monster in it, such as the mancubus, saboth, guardian, or cyberdemon, then it will generate a special aas file for them.
Doom 3 level editing is all about placing convex polytopes, also known as “brushes”. A brush is basically an arbitrary convex shape. Making a map with brushes is similar to making a structure with Lego blocks. You have a series of convex blocks that you fit together to create rooms and other objects.

To create a brush, just click and drag within the 2D view window. This should create a red rectangle which defines the size of your brush. If you continue to click and drag, you will only resize the selected brush. In order to create a new brush, you must first unselect the old brush by hitting “Escape”. You can reselect a previously created brush by clicking it while holding “Shift” key. If there are multiple brushes stacked on top of each other, you can cycle through them by clicking while holding “Alt + Shift”. You can duplicate the selected brush by hitting “Space Bar”, and you can delete it by hitting “Backspace”. Detailed table with keyboard shortcuts can be found in DoomEdit – Keyboard shortcuts article. Closer look at the DoomEdit workflow will be given in the next chapter about map creation.

Leak!
The next important thing is to know the meaning of a “leak” term. Levels in Doom 3 (and Quake for that matter) have to be completely sealed in. This means there can't be any cracks from the “inside” of the level to the “outside” of the level (also known as the “void”). For a map to be completely sealed in, the brushes should form a complete volume with no gaps between them.

There are three common situations that cause leaks:
  • 1. There is an entity outside the map. All entities must be completely inside the map. There cannot be any entities poking through a brush or hanging out in the void (unless they are marked as noflood).
  • 2. There is a gap between two brushes. This is simple enough to imagine.
  • 3. A “hull” brush has a non-solid texture applied to it. This is probably the hardest situation to figure out because it will look like there is no leak. The problem is even though there is a brush there; it may have a texture indicating that it is not solid (for example a trigger texture).
There is a tool to help track down leaks known as the “Pointfile” tool (in the “File” menu). This tool draws a line from the leaking entity to the location of the leak. If the leak was caused by the entity being halfway inside the map and halfway outside then nothing will be drawn (because the entity location and the leak location are the same). After loading the point file, you can press “Ctrl + Shift + K” and it will take you forward to the next node of leak line or “Ctrl + Shift + L” which will take you opposite direction.

Some texts on this page are originally from: iddevnetdotcom/doom3/editor (archived)
Tutorial 03 - Maps - DoomEdit basics (part 1)
First of all, we will learn how to work in the DoomEdit. DoomEdit is the main editor, in which we bring each element of the game world together. It is necessary to learn how to create at least simple one-room map. We will be using this map for testing of our created content in the engine. Essential information about Doom 3 maps and DoomEdit were presented in previous chapter, so in this chapter we will show practical demonstration how to make very simple map for Doom 3.

Note: Before starting, it is recommended to carefully study keyboard controls of DoomEdit. Detailed tables of keyboard shortcuts and their functions can be found in DoomEdit - Keyboard shortcuts article.

1. Run DoomEdit. In the 2D view, press left mouse button and drag; it will create our first brush. For adjusting height of this brush you need to change 2D view; press "Ctrl + Tab". Left click near each side of the brush and drag; you can adjust brush dimensions as needed (Figure 1). When you work on brush in 2D view don't forget to check it also in 3D view (controlled using cursor keys and mouse - for details see keyboard shortcuts). Open the Media Inspector (Figure 2) and choose some texture (= material) to use it on the brush.


Figure 1


Figure 2

2. With still selected brush, press "Hollow" icon in the toolbar (Figure 3). This command will turn your selected brush to "hollow box" of identical dimensions; this box is composed of six separate brushes - walls - the final thickness of the walls depends on actual grid size of 2D view during Hollow command (Figure 4).


Figure 3


Figure 4

3. For clean and nice results, it is good habit to adjust six walls of the room to touch each other only by edges (see Figure 5 - fix default hollow command intersecting behavior). This can be done quickly by adjusting opposite pairs of walls. Hold "Shift" and left click on brushes to select them; to cancel selection hit "Escape".


Figure 5


Figure 6

4. Change the texture of ceiling and floor (Figure 6) - use Media Inspector again. Then add light entity to this basic room. Press right mouse button in the 2D view somewhere where you want to create light. Right mouse menu with all kinds of game entities will pop up. Choose entity called "light" (Figure 7). The Light source in your room is represented by that small diamond-shaped object. Check if your light is roughly in the center of the room, if it isn't - switch between different 2D views and correct its position.


Figure 7


Figure 8

5. If you select light you can see pink block around it - light radius. It shows space in which is selected light effective. This is very handy for quick view of light's power. The Stronger light is the bigger pink radius. Now edit properties of this light. Select the light and press "J" - it brings up Light editor (Figure 8). Input "Radius" value appropriate to your size of room. Then click on the color swatch to set up light color (this color palette can be also directly opened outside of the Light editor by pressing "K"). DoomEdit offers new feature that allows you to switch render modes of 3D view; you can see preview of lights/shadows, materials, models. rendered like in normal running game. You can toggle render modes by pressing "F3", sometimes you also have to hit "F7" to rebuild render data.
Tutorial 03 - Maps - DoomEdit basics (part 2)
6. Now we will show how to use a tool called "Clipper" which can cut and split brushes. Create a new brush within your room and cut off all its corners - this brush will be the foot of an obelisk, which will be used to practice different ways of brush editing. For cutting off corners, select your newly created brush and hit "X" key (this toggles Clipper tool, also you can do it by clicking the triangle icon on the right side of Hollow icon). When you are in clipper mode, click in the 2D view to define points of the cutting plane. Three points are needed to define a plane. However in most cases you will need to set just two of them. These two points defines cutting plane that is perpendicular to current 2D view (see Figure 9). The part highlighted in yellow indicates result after cutting. You can press "Ctrl + Enter" to switch resulting part. If you set your cutting plane and right resulting part, press "Enter" for applying it. When you want to keep both parts of that brush (just split it up), press "Shift + Enter" instead.


Figure 9


Figure 10

7. Another way to adjust shape of brushes is edge and vertex editing. We will continue in building this rugged obelisk. Create new brush and press "E" - this enables edge editing mode. Now you can drag blue edge points and reshape the brush (Figure 10). If you want to edit vertexes in similar way, hit "V". Vertexes of the brush are represented by green points (Figure 11). In both mentioned modes you can edit points either in 2D or 3D view. Finish the obelisk (Figure 12).


Figure 11


Figure 12

8. In this step we will try handling of textures. When you want to change brush texture, simply select (hold "Shift + left click" on the brush) requested brush and assign texture in Media Inspector. But if you want to assign texture only on certain sides of brush, you have to first select desired sides by holding "Ctrl + Shift" and left clicking on them, then assign texture as usual. Keep the sides selected and press "S", which opens up Surface editor (Figure 13). This editor is used to adjust texture mapping on the brushes/sides. For example hit "Fit" button, this will match the texture size with the brush side size. Used texture with its mapping properties can be copied and then applied on different brushes or its sides. To do this, you have to select source brush side first then for applying hold "Ctrl + Shift" and middle click on target brush side. Finish your texture work on the obelisk; next we will try to duplicate it. Select all brush parts of your obelisk and hit "Space bar", newly duplicated obelisk will appear right next to original. Place duplicated obelisk somewhere near to original; check correct placement in all views (Figure 14). Objects (brushes, entities) can be also copied by "Ctrl + C" and then pasted by "Ctrl + V".


Figure 13


Figure 14

9. Once we have learned how to work with Clipper, adjust edges, vertexes and edit texture mapping, we can move on. Create another nearby room, and then connect these two rooms with corridor (see Figure 15). Use same steps for building this new room as in the case of the first one. You have to interconnect rooms with corridor by cutting door holes (use Clipper) in their walls (Figure 16). Don't forget to fill holes with small brush in the floor between the room and the corridor.


Figure 15


Figure 16
Tutorial 03 - Maps - DoomEdit basics (part 3)
10. Create brush for the first part of corridor; use same steps as in building of a room. Connect this first part of corridor with the first room (Figure 17). To create second part of corridor, duplicate the first one and rotate it 90 degrees along Z axis (use 8th icon on left side in the toolbar – “z-axis Rotate”). Connect the second part of corridor with your second room (Figure 18). If needed, adjust its length.


Figure 17


Figure 18

11. Skew corner ends of the corridor to nicely form corridor’s corner. This can be done easily by edge adjustment (“E”) or Clipper cut off (“X”). See properly built corner on the Figure 19. This concludes building of interconnecting corridor. Also add couple of small lights into the corridor for illumination (Figure 20).


Figure 19


Figure 20

12. Now we will learn how to add static model into a map. It is the same way what we used earlier for adding light entity. Click on right mouse button somewhere in area of 2D view; context menu will appear. Choose “New Model” which is almost at the top of menu (see Figure 21). Then new window will pop up. Use this window to browse available models. Choose for example “models/mapobjects/com/modconsole4.lwo”; in this window there is also model preview, so you can instantly see what selected model looks like. Correct the position of added model – place it somewhere in the second room. Duplicate the model and rotate it 270 degrees along Z axis (Figure 22). Models can be rotated in two ways. First way is to use arbitrary rotation – hit “R” and then use mouse to set angle in 2D view. Or other way – press “N” to open up Entity editor and there are angle buttons – so press the one with a “270” label (Figure 23); this sets key “angle” with value of “270” for this entity. Don’t forget to insert light also in this room.

Tip: Don’t forget to save your work in DoomEdit regularly. Sometimes it happens that editor crashes unexpectedly. If something like this happens and you lost your unsaved work, don’t be upset. Try to look in the root of your C drive, where DoomEdit autosaves every 5 minutes current state of a map. There should be files named “autosave1.map” and “autosave2.map”.


Figure 21


Figure 22


Figure 23
Tutorial 03 - Maps - DoomEdit basics (part 4)
13. In this step we will add necessary entity which is required for player spawning in the map. This entity name is “info_player_start” and it specifies place where the player spawns and the direction (angle) of his view in the map. So now place “info_player_start” entity in the first room – open right mouse button context menu and click on it (see Figure 24). If needed, adjust its position; it must be right above floor brush – no intersection (Figure 25). Set view direction of this spawn entity the same way as in previous static model case (Figure 26).


Figure 24


Figure 25

14. In this final step, save your map and run “dmap” command, which will generate other required files for your Doom 3 map. This command can be found in the main menu of DoomEdit in the submenu “BSP > BSP” (see Figure 27). When command is finished, you can close DoomEdit and try the map in the game. So run Doom 3, open console and type “devmap YourMapName” and confirm it by hitting “Enter”. If everything is done properly, you should see loading screen and then you should spawn in your map (Figure 28). So be proud – enjoy your first own Doom 3 map.


Figure 26


Figure 27


Figure 28 - in-game screenshot of the map

Maps – summary of learnt information
After finishing this chapter we should be able to create at least simple Doom 3 maps. We have gone trough all essential and often used tools in DoomEdit. We can use Clipper tool, adjust edges and vertexes, add entities; we can adjust brushes and build rooms from them. But keep in mind that this editor has number of other tools and aspects that we purposely omitted.

All this learnt skills will be very useful in the next chapters. I recommend you to build own test map – one-roomed and well illuminated map is just fine. In this simple map you will tune and polish your custom materials, sound shaders and models...
Tutorial 04 - Materials
Materials
The term materials refers to the definition of textures. In these definitions, we assign various properties and functions to otherwise static textures retrieved from the bitmap file. The material definition engine loads and applies the required properties. Examples of such material properties can be different types of transparency, gradients, or how an object should behave with the material in the game - for example, if we specify "noShadows" for a material, then the object does not cast shadows on the map. The Doom 3 engine currently supports the following bitmap formats for textures.

.tga - Today referred to as the Targa format, originally developed by Truevision in the 1980s, the format is capable of storing depths of 8, 16, 24 and 32 bits (24 bits + 8 bits alpha channel - transparency), and also supports lossless RLE compression.

.jpg - This format was developed in the 1990s by the Joint Photograph Expert Group (hence the name JPEG), allows you to store 24-bit bitmaps and, thanks to the optional loss compression rate, offers a friendly ratio of image quality and the resulting file size.

.dds - The suffix of this format was created by shortening the name DirectDraw Surface. This format was developed by Microsoft for DirectX, but is currently used in the competitive OpenGL interface. The format is able to store textures and cubic maps of the environment, both in compressed and uncompressed form. It also supports 32-bit rasters.

In order to fully exploit the potential of uniform lighting technology in the engine, all materials must be composed of several components. The basic component is the "diffusemap", which indicates the color. Next we have a "specularmap" which defines how much the material reflects light. A specularmap is a bitmap that can be both full color and grayscale. And the last but no less important component is the "bumpmap", this texture simulates a plastic surface, creating the impression of a much more detailed geometry (see Figure 29).

In the id Tech 4 engine, we can create bumpmaps in two ways. The first way is to use "heightmaps", which are also grayscale bitmaps. The closer the shade is to white, the sharper the surface will appear, while the darker the shade, the deeper the area will appear. The advantage of heightmaps is the ability to easily create and edit them in any bitmap editor. On the contrary, the disadvantage is the small number of shades (256), which does not allow us, especially in larger textures, to create smooth transitions.

The second, better way, but also more complicated, is to use "normalmap". Its complexity lies in the fact that we are not able to create normalmaps ourselves in a bitmap editor. To create a correct normalmap, we must use a program (eg ZBrush, CrazyBump…) that calculates such a bitmap for us.

without bumpmap (White Line) / with bumpmap (Colored line)

Figure 29 - Light reflection on a flat surface

To give you an idea, we will give examples of individual bitmaps. In Figure 30 we can see the components of the acidic material from Doom 3.


Picture No. 30 - from left: diffusemap, specularmap, bumpmap (normalmap)

We store material definitions in text files with the suffix "mtr" in the "materials" directory in the main "base" directory. We will now look at one such simple definition. The meaning of each line is described in the comments (the comment is preceded by "//") in the example below.
textures / object / windowpane2 // material name { // Global material properties // texture used in DoomEdit qer_editorimage textures / object / windowpane2.tga twoSided // material has both sides (normally only the front is displayed) noshadows // material does not cast shadows glass // material is glass - affects sounds { // diffusemap definition using alpha channel blend diffuseMap map textures / object / windowpane2_d.tga // bitmap path alphaTest 0.5 // transparency trimming level for alpha channel } // specularmap definition specularmap textures / object / windowpane2_s.tga // bumpmap definition bumpmap textures / object / windowpane2_local.tga }
Tip: The fastest way to learn how to create your own materials is to study the ready-made materials contained in Doom 3. Going through these definitions and subsequent modifications will lead to an early understanding of their functions.
Tutorial 04 - Creating your own material
In this chapter we will show you how to create a simple material along with everything that belongs to it. We will go through the procedure of creating individual bitmaps. For this purpose, we will need some digital photography, which will be the basis for creating diffusemaps, specularmaps and normalmaps. You must also have CrazyBump installed, which we learned earlier in the Tools and Editors chapter.

1. Let's start Photoshop or another bitmap editor. We will open a digital photo, which we will adjust so that its left edge follows the right edge, as well as the upper edge to the lower edge. This will achieve a smooth texture as it repeats (see Figure 31) on the map. Save to Targa file format (.tga).

Figure No. 31 - example of texture continuity

2. Let's launch CrazyBump. On the start screen, select the folder icon at the bottom left (Figure 32), which will move you to the next screen with a selection of different types of bitmaps to load (Figure 33). We choose "Open photograph from file" and choose a pre-prepared photo.


From left: Figure No. 32 and Figure No. 33

3. CrazyBump analyzes the photo after selecting it - this may take a while depending on the size of the photo and the speed of the system. When the analysis is complete, the program will offer us two default options for creating normalmaps (Figure 34). The possibilities differ only in that the second is the negative of the first - the places simulated as protruding will be immersed in the negative of the place. In our case, we will choose the first option.


Figure No. 34 & Figure No. 35

4. We now see a screen with the default normal map (Figure 35), which we will continue to work with. Using the sliders on the left, we can adjust various parameters, based on which the resulting normal map changes. When manipulating the sliders, the changes that we can see both on the normal map itself and on the 3D preview take effect almost immediately.

5. When we are satisfied with our normalmap, we move on to creating a specularmap. In the lower right part of the program, click on the "Specularity" button, which will take you to the required editing mode (Figure 36). As in the previous case, we have a set of sliders with different parameters, which we adjust as needed. Doom 3 needs fine and relatively dark specular maps to display the material correctly. We almost always have to subsequently adjust the specularmaps from CrazyBump using the Histogram or curves in Photoshop.


Figure No. 36 & Figure No. 37

6. After editing the specularmap, we go to the "Diffuse" button, which is located next to it (picture no. 37). Here we will edit our pre-prepared digital photo on a diffusemap. The correct diffusemap should not contain any bright spots - glosses, shadows - in short, none of what was previously used in game textures for the illusion of a plastic surface. This plasticity is created in id Tech 4 by a bumpmap together with reflections, the extent of which we define in the specularmap. For this reason, we adjust the values ​​of the "Remove Shading" and "Remove Highlights" parameters, which remove highlights and shadows.

Note: The same effect — removing glitter and shadows — can be achieved by editing a digital photo directly in Photoshop. However, it is very important that the pre-prepared photo that we import into CrazyBump contains lights and shadows - according to them, the analysis and subsequent creation of a normal map takes place.

7. Once we are satisfied with the result, we save the individual bitmaps. We will do this for each bitmap separately by clicking on the floppy disk icon (Figure 37), which is located at the bottom of the program.

8. We will now move on to creating a material definition. If the "materials" subdirectory is not in the "base" directory, we will create it. In this directory we will create a text file, which we will call eg "cubes.mtr", and we will write the following definition in it.
textures / mxl / cubes { qer_editorimage textures / mxl / cubes_d.tga stone // will emit matching sounds on impact // for stone materials diffusemap textures / mxl / cubes_d.tga bumpmap textures / mxl / cubes_n.tga specularmap textures / mxl / cubes_s .tga }
As a next step, we must copy all bitmaps to a position that matches our material definition. In the current case, in the "base" to the "textures / mxl /" directories. We have thus done all the necessary steps to create our own material.

9. To test the material and its debugging, it is necessary to apply it in the map. Therefore, let's not hesitate to use it in our test map. For the material to work properly, we often need to modify the bitmaps many times before we achieve the desired look. We have to keep in mind that we have a 3D preview in CrazyBump, but it does not correspond to the way id Tech 4 engine displays material in the game. We can see this well in picture no. 38, where our new material is used. It is obvious that there is too much reflection of light on the stone material, and thus shine, so it would be necessary to further adjust the specularmap, which we would darken and thus reduce the reflections.


Figure No. 38 - screenshot of the newly created material in Doom 3
Tutorial 05 - Sound shaders
A novelty compared to older engines from id Software are also "sound shaders", which is similar to bitmap materials, here we can talk about "sound materials". We already learned a little when introducing the sound editor in the Tools and Editors chapter. We will now clarify other things and, above all, show you a practical procedure on how to create your own sound shader and how to place it in the map environment.

The behavior of the sound effect on the map is best explained in the following example of a simple sound shader. Note that all definitions in id Tech 4 have a similar syntax. As usual, we explain the meaning of keywords directly in the definition, in the form of written comments.
sounds_village // name of sound shader { minDistance 10 // size of sound center at full volume maxDistance 64 // distance to which sound can be heard no_occlusion // sound is heard through closed door etc. volume 5 // volume in sound center no_dups // does not play same sound 2x in a row sound / my_sounds / village / sound_01.wav // sound variants which sound / my_sounds / village / sound_02.wav // engine randomly plays sound / my_sounds / village / sound_03.wav sound / my_sounds / village / sound_04. wav sound / moje_zvuky / vesnice / zvuk_05.wav }
For a better idea of ​​the behavior of the sound on the map, let's look at Figure 39, according to which we can clearly see what exactly affects the attributes "minDistance" and "maxDistance". The size of the sound center is determined by the value at "minDistance", here the sound has full volume, in our case "volume 5". Towards the center to the "maxDistance" distance, the sound fades until you can't hear it at this distance.


Figure No. 39 - illustration of the volume of the sound effect in the game environment

(inside circle) - sound
(inside circle border) - full volume (up to minDistance)
(outside cirble border) - audibility limit (maxDistance) - sound begins to fade outside the circle, when it's outside of the glare it cannot be heard.
Tutorial 05 - Creating and using your own sound shader
We will go straight to a practical example of how to define your own sound shader, including inserting it into the map using the Sound Editor. We will need an audio file for the demonstration. Doom 3 supports the following two audio formats.

.wav - The suffix is ​​an abbreviation of Waveform audio format. This format was developed by Microsoft and IBM as a standard for storing sounds on a PC platform. By default, wav files are uncompressed.

.ogg - A freely distributable audio format called Ogg Vorbis. It is constantly being developed and improved by the XiphdotOrg Foundation. The format has the ability to store multiple audio channels and excellent lossy compression.

Tip: The Ogg Vorbis encoder and decoder can be freely downloaded at xiphdotorg, eg in the form of a simple oggdropXPd program . Also worth mentioning is the excellent database of free sound effects at freesounddotorg .

1. We will prepare sounds in ogg format and place them in the directory "/ sounds / my_sounds" in the main directory "base". Next, we will create a text file in the "/ sound" directory, which we will call, for example, "cvrcek.sndshd".
2. We will write the following definition of our new sound shader in this file.
cricket { minDistance 10 maxDistance 40 volume 2 no_dups sound / my_sounds / cricket_01.ogg sound / my_sounds / cricket_02.ogg sound / my_sounds / cricket_03.ogg }
3. This completes the definition of the sound shader. We will now show how to insert the created shader into the map using the Sound Editor. Launch Doom 3 in the window and load the map to which you want to add sound effects. Open the console and type "bind r editSounds" into it - this command assigns the start of the sound editor to the "R" key. Let's close the console.

4. In the map we will go to the place where we want to place the sound. Press the "R" key to start the audio editor. In the middle part of the editor window there is a list of all sound shaders and simple sounds that we can place on the map. Double-click to select our shader "cvrcek_vecer" from the list and press the "Drop Speaker" button and confirm the name of the new sound entity.

5. Now an object has appeared in front of us, which represents the location of the sound on the map (see picture no. 40). Using the sound editor, we can further manipulate it - change its position (buttons + x / -x, + y / -y, + z / -z) or modify other parameters (volume - "volume", delay between repetitions - "wait" …).


Figure 40 - Doom 3 with Sound Editor running

6. We add other sounds to the map in a similar way. When we are done, we save the map with the distributed sounds by pressing the "Save .MAP" or "Save .MAP As…" button.
Tutorial 06 - Static models & Materials
Converting a static model to the id Tech 4 engine is a relatively easy matter. Static models do not contain any animation framework. They are mainly used in the creation and decoration of the game environment, for example, they can be models of vegetation, furniture and other things. However, they can also be whole houses or even uneven terrain, which would otherwise be difficult to create in DoomEdit.

The engine supports the following formats for static models:
.ase - 3ds Max ASCII files from Autodesk
.lwo - LightWave 3D files from NewTek

Note: Static models can be further animated in the game engine. If we need to create a machine or mechanism in the game environment, we can create its individual components in the form of static models. In DoomEdit, we compile the whole from the components, and then perform the animation using scripts.

Preparation and conversion of static model
Remember that this is the "classic way" there are other methods in development as i write this there's an updated version of this workflow around somewhere
1. We will prepare a ready-made model, which we wish to use in the game engine. For proper operation, we must perform a series of actions and modify the model before converting to one of the above-mentioned formats. We will go through this procedure in Maya with an ASE file. If we use other 3D modeling programs, the procedure is basically similar.
The Maya program does not support the ASE format by default, to enable the transfer we will need ActorX, a tool from Epic Games.

The site contains ActorX for various versions of Maya, but also for competing 3D programs. After downloading, we will install the tool - we will copy the ActorX.mll file to the "plug-ins" directory, which we will find during the standard Maye 8.5 installation at the following location.

C:Program FilesAutodeskMaya8.5binplug-ins

For other versions of Maya, the location of the "plug-ins" directory is similar, you will always find it in the "bin" subdirectory. We can now run the program. To activate the ActorX tool, we must load it using the Plug-in Manager, which can be opened from the menu "Window» Settings / Preferences »Plug-in Manager" (see figure no. 41). In the Plug-in Manager window, find the line with ActorX.mll and check the "Loaded" attribute, which will immediately load and activate this tool (Figure 42).


Picture No. 41 & Picture No. 42

2. Now we can open the scene with the model we wish to convert to a game engine. First, we check to see if the model is OK - if it doesn't have overlapping polygons, or if some polygon normals point in the opposite direction than we want. The location and size of the model in the scene is very important. When manipulating static models in the game or in DoomEdit, their position relative to the X, Y, Z = 0, 0, 0 coordinates (so-called "origin") in the scene is essential. Origin is the base point / axis of each static model, according to which we then move / rotate the model. Therefore, it is good to always keep in mind the location of the model on the stage in relation to the orgine and the functions placed on this model in the game.

3. Whether the model consists of one integral part or several separate ones, we execute the command from the menu "Modify» Freeze Transformations ", which" resets "the attribute values ​​of individual objects. If we omit this action and, for example, we have the attribute "Scale X" with the value 2 for one of the objects, we will see an unpleasant surprise after the conversion. The attribute "Scale X" is applied to the current form of the object for the second time, and in the game the model appears twice as large in the x-axis - that is, slightly elongated.

Note: Before any conversion of the model to the id Tech 4 engine, the model must be adjusted from polygons to triangles (tris). This can be achieved in the active mode "Polygons" by the command from the menu "Mesh» Triangulate ". However, ActorX includes the ability to convert to triangles, so we don't have to make the adjustment ourselves. Just check the "Auto Triangulate" option before transferring.

4. And now we will select the model on the stage that we wish to convert to ASE (if it is from more than one object, we will select all its parts). Launch the ActorX dialog box for exporting static models. We do this with the command "axmesh", which we write at the bottom left in the command line marked "MEL" and confirm with the "Enter" key (it is advisable to create a shortcut to the command in the toolbar). Then a window will appear where you can check "Selected items only" and the already mentioned option "Auto Triangulate" and then select the directory where you want to save the model in ASE format (see figure 43). Then we just press the "Export Mesh" button to convert the model.


Picture No. 43

Materials on static models
For the proper functioning of materials on static models in the game, we must use relative paths to the textures used. Or absolute paths containing the "base" directory or the "\ base" string. However, this path must not contain gaps, which is a problem in practice. Suitable paths look as follows.

For example:
C:doom3basemodelsmapobjectsplasticbag
or
// base / plastic bag
We can solve this problem by additional editing of the ASCII file (ASE) in a text editor. We start a text editor (eg Notepad or another plain text editor) and open our model file in it. For the ASE file, we then look for lines with the string "* BITMAP", which introduces the path / name for the use of the material.

We will make the adjustment, for example, as follows:
*BITMAP "//base/plasticbag"
and save the file. The name of the material modified in this way then refers in the engine to the material with the name "plastic bag" (note not to be confused - it does not refer to the material with the name "base / plastic bag").

We can also come across models that contain more material. In this case, we can use only one material for each object. It follows that if a static model contains 3 materials, it must also be divided into 3 objects according to the material used.
Tutorial 06 - Collision of static models
Collision of static models
An important component of the models in the engine is their interaction with the player or other models. More precisely, we will now deal with collisions in static models. If we insert a static model into the game environment, the engine will automatically ensure that the player cannot pass through it (unless we choose otherwise in the entity properties). The engine bounds the model with an invisible barrier that the player cannot enter.

If we work with more complex models - such as a building model, when it is necessary for the player to be able to enter the interior - we use a different procedure. Together with the building model, we will create a simplified boundary model. This model bears the main shapes of the original model. Collision calculation is quite demanding and can playfully take up all CPU performance when overused or misused. Therefore, when creating collision models, we try to achieve their simplest shapes with regard to the correct function of the model in the game (see Figure 44).

Figure 44

If we want a player to be able to manipulate a static model in the game environment - to move it - we have to do a few things. First of all, we have to define a new game entity. We do this as follows:
  1. In the directory "/ base / def" we will create a text file named "moveable_bag.def".
  2. In the created file we write the definition of our new entity as follows:
    entityDef moveable_plasticbag { "inherit" "moveable_base_fixed" "model" "models/mapobjects/bag/bag.ase" "density" "0.04" "friction" "0.2" "bouncyness" "0.15" "snd_bounce" "paper_impact" }
  3. We save the file.
  4. When DoomEdit is restarted, our entity "moveable_plasticbag" will appear in the menu under the right mouse button in the "moveable" section. This is also how we insert a moving static model into DoomEdit. Leave the model marked and select the command "Selection» Export »To CM" from the top menu (see figure no. 45). The editor will then request the required model - in our case "bag.ase" - and then write the collision model (create a new file "bag.cm"). The CM files contain collision models to the static models that the game needs for the rigid body collision system to work properly. These files must be in the same directory as the model and have the same name (eg my_model.ase and my_model.cm).


Figure 45 - collision model export in DoomEdit
Tutorial 07 - Character models (part 1)
Character models
In this chapter, we will focus on character models. We will go through the process of getting our character model into the Doom 3 engine. We will also show the creation of normalmaps for this model in ZBrush. Finally, in the game we define the already mentioned articulated figures, more often referred to as "rag dolls". To export character models, we must use older versions of Maya, 4.5, 5.0 or 6.0 (currently the only supported).

The Doom 3 engine, unlike previous id Software engines, uses skeletal animation. Previously, vertex animation was used, where for each vertex the position for the current frame was saved. However, this was not entirely advantageous. That's why the id Tech 4 engine switched to skeletal animation, where individual vertices are bound to a skeleton. The animation is then saved for each bone. The advantage is also the ability to modify animations at runtime using the engine. If we have a character who walks on an uneven surface, the engine can adjust the individual steps so that the feet touch this surface and do not sink or, on the contrary, do not improve (use of IK animation).

The engine in Doom 3 uses two types of files for animated models, both in ASCII format.

.md5mesh - A file containing the data that makes up the model and skeleton. Contains all geometry, vertex weighting, skeleton hierarchy.

.md5anim - This file type contains individual animations. The contents are the coordinates of the skeleton positions for each animation frame.

1. The Doom 3 engine offers relatively free character creation options. The characters do not have to contain a standardized skeleton or a precise anatomical arrangement. We can easily create various three-legged monsters with several heads, etc. However, the models must contain a mandatory bone called "origin" (Figure 46, 47), according to which the game engine manipulates the model. It is basically the main bone - figuratively speaking, "a handle for the invisible hand of the engine." This bone is located in the character models at the level of the area over which the model moves. Another important, but this time optional, bone / bones are the "directional bones" (Figure 46, 47), which indicate the direction of joint bending. This achieves animation of the limbs in the game while running IK - the already mentioned adjustment of the positions of the feet depending on the relief of the surface. The bone called "origin" can be created in Maya in the form of a locator, which we attach to the main bone of the skeleton. We do this with the "Constrain» Point "command with the maintaing offset maintained and the translation transfer limited to the X and Z axes only (the origin then moves in the area). We also create bones to determine the direction of limb bending. This time, however, we will not connect them using constrains. In each hierarchy, we assign the corresponding limb bone to each such locator. This time, however, we will not connect them using constrains. In each hierarchy, we assign the corresponding limb bone to each such locator. This time, however, we will not connect them using constrains. In each hierarchy, we assign the corresponding limb bone to each such locator.


Picture No. 46 &Picture No. 47

2. Before linking the model's geometry to the skeleton, it is necessary to have a UV mapping created for textures and the model must be converted to a triangular mesh (this is done using the "Triangulate" command - Figure 48). If we have these conditions met, we attach the model to the skeleton in the animation mode using the command "Skin» Bind Skin »Smooth Skin". Subsequently, we carefully weigh the character model to the skeleton, using the "Paint Skin Weights Tool" and spreadsheet in the "Component Editor".


Picture No. 48 & Picture No. 49

3. Next we will create basic animations. Unlike previous id engines in Doom 3, we animate walking, running, jumping, etc. in space (picture no. 49). In the older game title Quake 3 Arena, the animation of the characters was done in one place - the character in the 3D program walked, ran on the spot. During the game, the engine moved the entire character model, which often caused the legs to "slip" (if the engine moved the model at a different speed than the one at which it was animated). It is advantageous to create a single file containing a model with a linked skeleton and animation drivers (so-called rig) before starting the animation, which we will refer to other scenes. In such referenced scenes, we create a walk loop or a run loop. In addition, an attack animation, an intervention and an "idle" animation, which is used when the model is idle.

4. Once we have completed the animations, we will move closer to exporting them to the engine. We will gather all the necessary files in .mb or .ma formats with the character model and animations in one directory. For example, in our case:
C:Doom3basemodelsmonstersmag
Now we need to create a model definition with animations for export. We will also write a definition in one file, which will determine the characteristics of the character in the game, such as its available animations, sounds. Then we have to list all the required bones after the "-keep" parameter in the definition file, or modify the parent relationships using the "-parent" parameter. In our case, we will create a file "mag.def", in which we will write the definitions in the following location:
C:Doom3basedef
Contents of the definition file "mag.def" - the first part (see definitions below), in which we specify the model and its animations for export. In this case, the introduction of "options" is followed by an assignment, where the "origin" bone after export will be the parent of the "root" bone. Next to the "-keep" parameter is a list of bones to keep when exporting. If necessary, we can rotate the model ("-rotate") or resize it ("-scale") in this section. We also set the source directory "-sourcedir" (containing .mb or .ma files) and the destination directory "-destdir" (after exporting the engine .md5mesh and .md5anim files are saved in it). Then follows a section listing the files used - the skeleton model (introduced "mesh") and its animation (introduced "anim"). Note that it is also possible to use only the animation section with the "-range" parameter.

Note: The section with three dots "…" indicates a shortening of the list of bones for clarity of writing.

Section of the "mag.def" file with the definition for exporting the character model
export mag { options -parent root origin -keep origin skull neck Larm Lforearm Lwrist Lfgr2p1 Lfgr2p2 ... -rotate 90 -scale 19 -sourcedir models/monsters/mag -destdir models/md5/monsters/mag mesh mag.mb anim initial.mb anim idle1.mb anim walk.mb -range 1 26 anim attack1.mb anim attack2.mb anim pain_chest1.mb }
Tutorial 07 - Character models (part 2)
As the next part, we will write down the definition for the animated character model (see definitions below). The keyword "mesh" is followed by the path to the .md5mesh file containing our model. Next, we write the animation channels "channel torso" and "channel legs" and behind them we define in parentheses the appropriate bones belonging to the torso and legs. This allows you to combine animations - for example, the feet walk and the hands play the animation of the attack. By entering "* name" we assign all the bones in the hierarchy below it, including itself. The exact opposite - that is, the removal of all given bones, including the said bone from the area - is achieved by writing "- * name".

In the rest of the definition, we write the type of animation and the path where the appropriate .md5anim file is located after the keyword "anim". Note the definitions of sounds (introduced by "sound_"), we can determine exactly on which frame of the animation the sound should play.

Tip: In most cases, it is better to use a .def file from a similar existing model in the game and then modify it. The notations are often very similar and differ only in the skeleton used and the paths to the specific model and animation.

Section of the "mag.def" file with the definition of the animated character model
model monster_mag { mesh models/md5/monsters/mag/mag.md5mesh channel torso ( *BaseSpine ) channel legs ( *root *origin -*BaseSpine ) anim af_pose models/md5/monsters/mag/initial.md5anim anim ik_pose models/md5/monsters/mag/initial.md5anim anim initial models/md5/monsters/mag/initial.md5anim anim idle1 models/md5/monsters/mag/idle1.md5anim { random_cycle_start } anim sight models/md5/monsters/mag/walk.md5anim { frame 1 sound_voice snd_sight } anim walk models/md5/monsters/mag/walk.md5anim { random_cycle_start frame 4 rightfoot frame 4 sound_body2 snd_footstep frame 17 leftfoot frame 17 sound_body2 snd_footstep } anim melee_attack1 models/md5/monsters/mag/attack1.md5anim { frame 1 sound_voice snd_chatter_combat frame 11 melee melee_zombie_maint_Right } anim pain models/md5/monsters/mag/pain_chest1.md5anim { frame 1 sound_voice snd_pain } }
The rest of the "mag.def" file can be found again a little below. In this section, we define a new entity - the character of the enemy for the game world. If we go through this definition briefly according to the attribute names, we see a number of seemingly clear settings. Here we can set properties such as the enemy's health ("health"), whether the enemies should cooperate ("team"), the range of the melee attack ("melee_range"), etc. As we can see, the attribute names have a very apt English name, and therefore it is we will not explain at length. We prefer to clarify the less obvious attributes. These are, for example, the attributes indicating damage zones ("damage_zone"). From the following definition, we see that in a similar way as for animation channels, we write zones using parts of the skeleton. This is how we simply define the different areas where we can hit the enemy,

The final section of the "mag.def" file with the character entity definition
entityDef monster_mag { "inherit" "monster_default" "scriptobject" "monster_zombie" "model" "monster_mag" "ragdoll" "monster_mag" "editor_mins" "-50 -50 0" "editor_maxs" "50 50 100" "size" "48 48 40" "use_aas" "aas48" "team" "1" "rank" "0" "health" "300" "melee_range" "75" "attack_cone" "70" "attack_accuracy" "0" "damage_zone head" "*neck" "damage_zone chest" "*BaseSpine -*neck -*Larm -*Rarm" "damage_zone left_arm" "*Larm" "damage_zone right_arm" "*Rarm" "damage_zone legs" "*root -*BaseSpine" "damage_scale head" "2" "anim" "idle1" "mass" "500" "ragdoll_slomoStart" "0" "ragdoll_slomoEnd" "0" "ik_numLegs" "2" "ik_footSize" "4" "ik_waist" "root" "ik_hip1" "Lhip" "ik_hip2" "Rhip" "ik_knee1" "Lknee" "ik_knee2" "Rknee" "ik_ankle1" "Lankle" "ik_ankle2" "Rankle" "ik_dir1" "LkneeA" "ik_dir2""RkneeA" "ik_foot1" "Lball" "ik_foot2" "Rball" "snd_sight" "bernie_sight" "snd_footstep" "monster_zombie_commando_footstep" "snd_footdrag" "bernie_footdrag" "snd_melee_attack_1" "bernie_attack" "snd_melee_attack_2" "bernie_attack" "snd_melee_attack_3" "bernie_attack" "snd_chatter" "bernie_chatter" "snd_chatter_combat" "bernie_chatter_combat" "snd_pain" "bernie_pain" "snd_death" "bernie_death" "snd_thud" "monster_zombie_maint_thud" "snd_swipe" "monster_zombie_maint_swipe" "snd_ambient" "monster_zombie_ambient_burn" }
Other interesting and especially very useful attributes with the prefix "ik_". With these attributes we determine both the number of limbs, the size of the feet, but also the individual bones of the limbs needed for the proper functioning of the already mentioned IK animations of the limbs on an uneven surface. For proper limb bending, it is necessary to define the "directional bone" (see Figures 50 and 51) using "ik_dirX", where X represents the limb number.

Figure 50 & Figure 51
Tutorial 07 - Character models (part 3)
Note: First of all, before exporting, we will check if we have the library "MayaImportx86.dll" in the same directory as "Doom3.exe". This library is necessary to convert models and animations from the Maya format to the Doom 3 md5 format. You also need the correct version of this library according to the version of Maya you are using. If we do not have a library, it can be obtained from the official Doom 3 SDK package (web: wwwdotiddevnetdotcom ).

5. After the successful completion of the definition file, we can start exporting the model and animations. Run in the Doom 3 window. Open the console and enter the "exportModels" command with the name of our definition file. In our case "exportModels mag" and confirm with the "Enter" key. If everything works as it should, we see an extract from the model export and individual animations in the console. If the conversion did not take place, Doom 3 will print an error message with the possible cause of the problem. In some cases, Doom 3 may prompt you to locate the Maya installation directory. We will select the directory. Subsequently, the export should take place in the usual way.

6. Once we have the Doom 3 format exported files in the selected directory, we will modify the material used on the model. In our case, we will open the file "mag.md5mesh", containing the model, in a text editor. We will find the string "shader", after which we specify the material for the character model (see the Materials chapter for how to create a material). If the model is composed of several objects, we will modify the material for each of them. In order to test the model, we insert it into the test map (see chapter Maps). Select the new enemy entity from the menu of entities in DoomEdit "monster» moster_mag "(Figure 52).
Figure No. 52

7. If the model is fine with the animations and everything works as it should, we can start creating articulated figures (rag dolls). These "articulated figures" simulating the anatomy of figure bodies can be created from the ground up using the Articulated figures editor ("editAFs" command). However, it is far more convenient to modify any of the existing .af character sets similar to the body structure. In our case, we will find these files in the following directory (if this is not the case, we will extract them from the pk4 file).
C:Doom3baseaf
Below we can see the modified "mag.af" file (abbreviated for clarity). It is necessary to change the overall name of the definition to "monster_mag", as well as to specify the used model "monster_mag". Everything should be in accordance with the previously created definition of "mag.def". To edit an .af file, you must customize the skeletal bone names in it. At first glance, this procedure may seem laborious, but in reality we will save a lot of work that we would otherwise devote to creating the entire joint figure from scratch. As we can see in the previous example, .af files consist of the main settings - introduced by the word "settings" - where we affect the figure as a whole. Furthermore, the definitions of bodies (after the designation "points"), which are nothing but primitives such as blocks, pyramids, etc., from which we assemble the individual parts of the joint figure. The final part of the set consists of definitions of joints with which we connect individual bodies. We should always keep in mind that the more bodies and joints the figure contains, the more difficult it will be to calculate for the processor. Therefore, it is appropriate to try to compromise between the complexity of AF figures and the requirements for their deformation.
articulatedFigure monster_mag { settings { model "monster_mag" skin "" friction 0.0099999998, 0.0099999998, 0.5, 0.5 suspendSpeed 20, 30, 40, 60 noMoveTime 1 noMoveTranslation 10 noMoveRotation 10 minMoveTime -1 maxMoveTime 15 totalMass -1 contents corpse clipMask solid, corpse selfCollision 1 } body "waist" { joint "origin" mod orientation model box( ( -10, -11.5, -4 ), ( 10, 11.5, 4 ) ) origin ( 0, 0, 46 ) density 0.0099999998 friction 0.0099999998, 0.0099999998, 0.5 contents corpse clipMask solid, corpse selfCollision 1 containedJoints "*origin -*root -*Rhip -*Lhip" } ... universalJoint "rwrist" { body1 "rhand" body2 "rforearm" anchor joint( "Rwrist" ) shafts ( 0.0000004888, 0, -1 ), ( 0.0000001629, 0, 1 ) friction 0.5 coneLimit ( -0.0000001629, 1, 0 ), 60 } }
8. After we have edited the file for our character, we can fine-tune the details using the editor. Run Doom 3 in the window, load the test room. For faster work and access to the Articulated figures editor, we enter the command "bind X editAFs" in the console, where X can be any key that we want to start / switch to the editor. After starting the editor, its window will appear (picture no. 53). Select our character "monster_mag" from the list at the top of the window and press the "Spawn" button. This will place the character in front of us on the map, if we want to remove it, press the "Kill" button. On the first tab "View" we have a number of options that we can activate by checking. We activate at least the option to display "bodies" in the first section "Articulated Figure".

Figure 53 - Doom 3 with editAFs running

In the second tab "Properties" you will find elements for editing the options of the whole figure (previously mentioned section "settings" in the .af file). The next tab is called "Bodies", here we adjust the individual bodies, adjust their size, shape and location according to the needs of our figure. The last tab is "Constraints", where we can debug the joints connecting the bodies of the figure. Here we can set their properties such as the type of joint, its friction, bending section, etc. After tuning all the elements, do not forget to press the "Save" button, which will save the current changes to the original "mag.af" file. The result of a suitably adjusted articulated figure can be seen in Figure 54.


Picture No. 54 & Picture No. 55

9. By debugging the articulated figure, we completed our new model (Figure 55). However, this is not always the case. In most cases, we have to tune the animations, material or other settings associated with the game engine over and over before we are really happy with the result. After understanding and learning this procedure, we can create any other character by analogy. The model conversion procedure is identical.
Tutorial 07 - Creating normalmaps using ZBrush
Finally, we will show you how to create normal maps for your own models relatively easily. We will therefore return to the phase when we completed the model in the Maya program, including its UV mapping for texture application. To create a highly detailed model, we will use the ZBrush program, about which we have already mentioned a little in the introductory chapter Tools and Editors. Subsequent comparison of the highly detailed model with the original model (the so-called "lowpoly model") gives their difference, which we store in the form of a normal map. We will now explain how we will carry out this process.
  1. Models with quads are ideal for ZBrush. Of course, we can also import triangular geometry, but this causes problems with further refinement ("subdivision"). For this reason, it is a good idea to check the model before exporting from Maya and possibly modify it. We are duplicating the current model. We will create two versions. We will continue to use the original version - triangular - for animation and in the game. We will modify the duplicate version to suit ZBrush. We'll convert all the triangles we can into quadrilaterals. However, we must be careful not to change the layout of the UV map (more precisely, its border areas - "seams"). We also try to distribute the quadrilateral network evenly. It is inappropriate when there are significantly different quadrilaterals in size in different parts of the model.
  2. We will mark the modified model (or all its parts if they are to be on a uniform texture). From the main menu, select "File» Export Selection ". We specify the directory where we want to save the model and select OBJ as the file format.
  3. Run ZBrush and select "Import an OBJ file" on the start screen. We browse the directory in which we have prepared the model and select it. Subsequently, we find ourselves in the working interface of the ZBrush program and we have imported our model on the stage (Figure No. 56). First of all, we will briefly explain the control of the program. As soon as we imported in the beginning, our model was inserted into the scene and the "Edit" mode was activated. In this mode, we can edit the model in the scene. We can rotate it by clicking and dragging the left mouse button on an empty background of the scene. If we hold down the "Alt" key during the same action, we move it around the scene. If we release the "Alt" key while dragging, we enlarge or reduce the modified model depending on the direction of the mouse movement. The same functions can be achieved using the icons on the bar at the right edge of the scene.
    Figure No. 56 - ZBrush 3.1 user interface
    On the opposite left side, below the "ZMapper" button, we find a panel for brush settings. Let's go through the order from above. Use the first "Brush" field to select the types of brushes. The next field "Stroke" changes the types of brush strokes, followed by the field "Alpha", which we use to select the shape of their profile. Then we have a box for choosing the texture, material and finally a color palette. At the top of the scene there is a panel where we can see on the left a button to switch to the already mentioned "Edit" mode. Other modes follow - drawing, moving, rotating and resizing. Behind them we will find other options for adjusting the behavior of the brush. Using "Zadd" and "Zsub", we determine whether we add material (or push it outwards) or remove (push) the material when "sculpting" with a brush. There are also sliders for resizing the "Draw Size" brush, changing the hardness of the edges of his "Focal Shift" track and setting its RGB intensity together with the choice of the sculpting force - "Z Intensity". All of these controls can be accessed using the right-click menu (see Figure 57).

    Picture No. 57 & Picture No. 58 & Picture No. 59
  4. After a brief explanation of the interface and its basic functions, we move on to the process of creating a detailed model. We have an imported model of our character on stage. First of all, we will save the original shape of this model. On the far right, open the "Morph Target" item and press the "StoreMT" button (see figure no. 58). As the detail of the geometry increases, there are minor changes in the shape of the model. This will ensure that we can return to its original shape at any time during further refinement of the model. We will now refine the geometry of the model. Above the item "Morph Target" there is another item "Geometry", we will open it. Inside, press the "Divide" button (see figure no. 59). We switch between the individual levels of geometry complexity using the "SDiv" slider, the number indicates the level of refinement.

    Picture No. 60 & Picture No. 61

    We then draw with a brush - sculpture - on the surface of the model. We always gradually adjust the model from the lowest level of refinement. When we need even finer geometry, we break it down again using the "Divide" button. In this way, we will gradually enrich the model with details, or we will slightly change some of its shapes. When sculpting, we often use the "Alt" key, which toggles between the "Zadd" and "Zsub" options. Holding the "Shift" key smoothes the brush - similar to a "Smooth" type brush. In our case, the model consists of two parts - the body and the head. A similar procedure must be performed sequentially for all imported parts. In pictures no. 60 and 61 we can see the finished version of the body and head model enriched with a lot of details.
  5. Once we have finished decorating the model, we move on to the final stage - creating and saving normalmaps. Use the "SDiv" slider in the "Geometry" section to reduce the level of geometry detail to the original level "1". Next, in the "Morph Target" item, press the "Switch" button to return to the original shape of the model. In the upper left corner of the interface, press the "ZMapper" button (Figure 62).

    Figure No. 62 & Figure No. 63
    This will take us to the ZMapper environment. In the "Display" section on the far right, activate item No. 2 "Tangent space N. Map". In the footer of the window, activate the "Normal & Cavity Map" tab, then other setting options will appear. To export to the id Tech 4 engine, activate the "Flip Image Vertically" and "Flip Green Channel" items (see Figures 63 and 64). Finally, press the "Create NormalMap" button. After a while, the normalmap for our model is calculated. Its preview will be displayed on the model. In this tab we can also further modify the normalmap - focus details or emphasize them, etc. Sometimes it can happen that due to the change of the model shape the normalmap will not be calculated at some point, we can solve this problem by increasing the value "Raycasting Max Scan Distance" in the sub-tab Projection.
    Figure 64
Creating normalmaps using ZBrush & Conclusion
6. Now it remains to save the normalmap. After the calculation, the normal map is included in the texture selection (Figure 65). We export the texture from here, for example, to the PSD format for Adobe Photoshop. Mark the texture and press the "Export" button.
Picture No. 65
7. We can then open the exported normalmap in Adobe Photoshop or another bitmap editor. If the model consists of several objects, but they have a common texture, their normalmaps must be combined. In our case, we have to combine the normalmap of the head and body. To do this, simply select the white areas in both normal maps and delete them so that they are transparent. We merge the individual normalmaps and fill the transparent areas with normalmaps with a neutral color value RGB 255, 127, 127. To complete the textures for our model, we will create a diffusemap and a specularmap in Photoshop. We have finished the textures for the game material (see picture no. 66). In a similar way, we should now be able to create a normalmap for any model.

Picture No. 66 - from left: diffusemap, specularmap, normalmap

Conclusion
During the work, we browsed into various specific areas of content creation for the id Tech 4 engine. We demonstrated ways to proceed with the creation of content for individual specific areas (materials, sound shaders, maps). Of course, we should take into account the fact that the demonstrated procedures are not the only correct way to create the content. There are a number of other ways in which similar results can be achieved. The demonstrated procedures were chosen with regard to their least difficulty and labor, so that their basic principle is primarily clear.

Note: In creating these tutorials, I drew from the websites wwwdotiddevnetdotcom , wwwdotmodwikidotnet , the discussion forum wwwdotdoom3worlddotorg and last but not least from my own experience.
Unfortunately only archived version remain and they're really scattered, however there's a new version of the first two websites currently active.
DoomEdit - Keyboard shortcuts (Part 1)
General
Internal name
Shortcut
Function
ShowDOOM
F2
switch to the game
Preferences
P
opens the settings window
EntityList
I
opens a window with a list of entities
MakeProjectedLight
J
opens the Light Editor
SurfaceInspector
S
opens Surface Inspector (brush / face properties)
ToggleCamera
Ctrl + Shift + C
shows or hides the camera window
ToggleZ
Ctrl + Shift + Z
shows or hides the Z window
ViewEntityInfo
N
displays entity information
ViewConsole
O
displays the console
ViewTextures
T
displays a selection of textures
MediaBrowser
M
displays the media selection
ShowAllTextures
Ctrl + A
show all textures (not only used)
FileOpen
Ctrl + O
opens the dialog for opening the map
FileSave
Ctrl + S
save the map
FindOrReplaceEnt
Ctrl + F3
opens the search / replace window
NextLeakSpot
Ctrl + Shift + K
go to the next leak point
PrevLeakSpot
Ctrl + Shift + L
return to previous leak point
AutoCaulk
Ctrl + Shift + A
automatically applies caulk to suitable brush locations

3D view
Internal name
Shortcut
Function
CameraForward
arrow up
move forward
CameraBack
down arrow
move backwards
CameraLeft
left arrow
turn right
CameraRight
right arrow
turn left
CameraUp
D
move up
CameraDown
C
move down
CameraAngleUp
A
tilting upwards
CameraAngleDown
Z
tilting down
CameraStrafeRight
.
move right
CameraStrafeLeft
,
move left
CenterView
End
centering view
UpFloor
PgUp
move one brush up
DownFloor
PgDn
move one brush down
ToggleRenderSound
F9
toggles playback of sound effects
RebuildRenderData
F7
restores render data (used if the 3D view does not match the 2D view)
ToggleRenderAnimation
F6
toggles the display of animations
ToggleEntityOutlines
F5
automatically restores render data
ToggleRealtimeRenderBuild
F4
automatically restores render data
ToggleRenderMode
F3
switches display modes
ShowClip
Ctrl + L
toggles the display of clip brushes
ToggleShowPatches
Ctrl + P
toggles the display of curve geometry (patches)
ToggleCubicClip
Ctrl +
toggles visibility restrictions
CubicClipZoomOut
Ctrl +
extends the visibility distance
CubicClipZoomIn
Ctrl +
shortens the visibility distance
DoomEdit - Keyboard Shortcuts (Part 2)
2D view
Internal name
Shortcut
Function
NextView
Ctrl + Tab
changes 2D views (Top, Side, Front)
Copy
Ctrl + C
copies the selection to the clipboard
Paste
Ctrl + V
inserts a selection from the clipboard
ToggleView
Ctrl + Shift + V
toggles the display of the 2D view window
Undo
Ctrl + Z
undo last action
Redo
Ctrl + Y
redo last undone action
ToggleGrid
0
toggles the grid display
SetGridPoint125
2
grid size 1/8 (0.125)
SetGridPoint25
3
grid size 1/4 (0.25)
SetGridPoint5
4
grid size 1/2 (0.5)
SetGrid1
1
grid size 1
SetGrid2
2
grid size 2
SetGrid4
3
grid size 4
SetGrid8
4
grid size 8
SetGrid16
5
grid size 16
SetGrid32
6
grid size 32
SetGrid64
7
grid size 64
GridDown
-
increase the grid size
GridUp
+
reduce grid size
ZoomOut
Insert
zoom out on the 2D view
ZoomIn
Delete
zoom in on the 2D
ToggleCrosshairs
Shift + X
toggles the display of the
ToggleSizePaint
Q
brush size information (only when holding the key)
ZZoomOut
Ctrl + Insert
zoom out
ZZoomIn
Ctrl + Delete
zoom in

Working with textures
Internal name
Shortcut
Function
FindReplaceTextures
Shift + F
opens the search / replace textures window
AxialTextureByHeight
U
sets the vertical texture dimension of the width / height of the face
AxialTextureByWidth
Ctrl + U
sets the horizontal texture dimension height / width of the face
AxialTextureArbitrary
Shift + U
toggles texture snap modes
InvertTextureX
Ctrl + Shift + I
flip the texture vertically
InvertTextureY
Shift + I
flip texture horizontally
TextureFit
Shift + 5
stretches the texture exactly to the size of the face
TexRotateClock
Shift + PgDn
rotates the texture clockwise by 45 °
TexRotateCounter
Shift + PgUp
rotates the texture counterclockwise by 45 °
TexScaleUp
Ctrl + up arrow
enlarges the texture vertically (does not work)
TexScaleDown
Ctrl + bar down
shrinks texture vertically (does not work)
TexScaleLeft
Ctrl + left arrow
enlarges the texture horizontally (does not work)
TexScaleRight
Ctrl + right arrow
reduces texture horizontally (does not work)
TexShiftLeft
Shift + left arrow
shift texture left
TexShiftRight
Shift + right arrow
shift texture right
TexShiftUp
Shift + up arrow
scroll texture up
TexShiftDown
Shift + down arrow
scroll texture down
TogTexLock
Shift + T
turns on / off texture snapping on the brush
DoomEdit - Keyboard Shortcuts (Part 3)
Working with curve objects (so-called patch)
Internal name
Shortcut
Function
BendMode
B
turns on / off the curve bending mode
ThickenPatch
Ctrl + T
adds missing sides to curve objects
MakeOverlayPatch
Y
permanent display of control points for selected curves
ClearPatchOverlays
Shift + Y
turn off the display of control points for curves
PatchInspector
Shift + S
opens the Patch Properties window
CapCurrentCurve
Shift + C
fills the empty top and bottom walls of the selected curve object
CycleCapTexturingAlt
Shift + P
changes the methods of applying texture to the top and bottom walls of a curved object
CycleCapTexturingAlt
Ctrl + Shift + P
changes the methods of applying texture to the top and bottom walls of a curved object
RedisperseRows
Ctrl + E
regularly spread out rows at a curved object
RedisperseCols
Ctrl + Shift + E
Spread columns on a curved object regularly
InvertCurve
Ctrl + I
toss normal at the object
IncPatchColumn
Ctrl + Shift + +
inserting a column into a curve object
IncPatchRow
Ctrl + +
inserting a series into a curve object
DecPatchColumn
Ctrl + Shift + -
removing a column from a curve object
DecPatchRow
Ctrl + -
removing a series from a curve object
Patch TAB
Tab
in bending mode switches between different axes in insert mode switches between different positions in axis mode
Patch TAB
Shift + Tab
switches between different axis
NaturalizePatch
Ctrl + N
applying the texture in the usual way
NaturalizePatchAlt
Shift + N
applying the texture in an alternative way
SnapPatchToGrid
Ctrl + G
snaps checkpoints to the current grid

Working with brushes
Internal name
Shortcut
Function
ToggleMoveOnly
W
turns off brush resizing (only can be moved)
Brush3Sided
Ctrl + 3
changes the selected brush to a triangular prism
Brush4Sided
Ctrl + 4
changes the selected brush to a quadrilateral prism
Brush5Sided
Ctrl + 5
changes the selected brush to a pentagonal prism
Brush6Sided
Ctrl + 6
changes the selected brush to a hexagonal prism
Brush7Sided
Ctrl + 7
changes the selected brush to a heptagonal prism
Brush8Sided
Ctrl + 8
changes the selected brush to an octagonal prism
Brush9Sided
Ctrl + 9
changes the selected brush to a nine-sided prism
ToggleClipper
X
turns on / off scissors (clipper)
ClipSelected
Enter
cuts the selected brush (removes the unmarked part)
FlipClip
Ctrl + Enter
cuts the selected brush (removes the selected part)
SplitSelected
Shift + Enter
splits the selected brush (keeps both parts)
MoveSelectionDOWN
-
moves the selected brush down (by 1 grid unit)
MoveSelectionUP
+
moves the selected brush upwards (by 1 grid unit)
SelectNudgeLeft
Alt + left arrow
moves the selected brush to the left
SelectNudgeRight
Alt + right arrow
moves the selected brush to the right
SelectNudgeUp
Alt + up arrow
moves the selected brush up
SelectNudgeDown
Alt + down arrow
moves the selected brush down
CSGMerge
Shift + M
merging multiple brushes into one (not always possible)
DragEdges
E
activates edge editing mode
DragVertices
V
activates vertex editing mode
DumpSelectedBrush
Shift + D
prints the coordinates of the selected brush to the console
DoomEdit - Keyboard Shortcuts (Part 4)
Working with entities
Internal name
Shortcut
Function
EntityColor
K
opens the color selection palette
Ungroup
Shift + G
converts the group back to a normal brush
CenterOrigin
Shift + O
centers the origin of the brush entities
SelectCompleteEntity
Ctrl + Alt + Shift + E
selects all objects of the entity
CombineSelection
Shift + K
combining multiple entities into one
ConnectSelection
Ctrl + K
creates a target between two entities
SelectAllOfType
Shift + A
selects all entities that are of the same type as the currently selected entity

Working with brush entities
Internal name
Shortcut
Function
HideSelected
H
hides the current selection
ShowHidden
Shift + H
shows hidden
HideNotSelected
Ctrl + Shift + H
hides everything except the current selection
CloneSelection
Space
duplicates selected brushes or entities
DeleteSelection
Backspace
deletes selected brushes or entities
UnSelectSelection
Escape
deselect
MouseRotate
R
activates rotation mode
ToggleFlatRotation
Ctrl + R
toggles between different types of rotation
CycleRotationAxis
Shift + R
switches between X, Y, Z axes of rotation