A - Z Beginner Full Guide Page 4: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Line 126: Line 126:
// items the player starts with:<br>
// items the player starts with:<br>
"startingItem_1_item" "weapon_blackjack"<br>
"startingItem_1_item" "weapon_blackjack"<br>
"startingItem_1_qty" "1"<br><
"startingItem_1_qty" "1"<br>
"startingItem_2_item" "weapon_shortsword"<br>
"startingItem_2_item" "weapon_shortsword"<br>
"startingItem_2_qty" "1"<br>
"startingItem_2_qty" "1"<br>

Revision as of 17:39, 21 September 2007

written by Fidcal

Previous Page ... Next Page

Dark Radiant Filters

If the rain/snow brushes get in the way you can filter them out with Hide but it gets a bit repetitive so you can define a Dark Radiant filter...

	<filter name="Weather">
		<filterCriterion 
			type="texture" 
			match="textures/darkmod/weather/.*"
			action="hide" />
	</filter>

First close Dark Radiant then insert the above in between two other filters in G:\DarkRadiant\games\doom3.game using a plain text editor. I recommend you back up the original first in case of errors.

Next time you open Dark Radiant the new filter will be in the Filters menu under 'Weather'.

More details in Defining custom Filters in DarkRadiant


Proper Lighting

We put in temporary lights for quickness. Now we must consider how we are really going to light the mission. Some game developers make an entire mission and do this last; some do it as they go along at every stage; I mostly do it section by section and this mini-mission so far is what I call a 'small section'.

Visible light in-game like gaslights and torches have no light of their own; we simply use the type of lights we have already used placed next to them. Generally avoid putting in these lights without a physical light object as it makes little sense in game to just have a place lit without reason. Exceptions are ambient and selective highlighting where it might be supposed some light falls, extending the reach of a visible light. Use your judgement, does it look alright?

Begin by deleting all the lights we put in so far EXCEPT for the

  • main ambient light
  • the ambient light in the pool
  • If you wish you can disable the fog without removing by adding an X to fogs/delta1_fog so... fogs/delta1_fogX or just delete them.

There is a wide variety of lighting objects in Dark Mod. For a full list, scroll down to Lights in the Objects Index and feel free to use different types here. But remember, this must be a playable game, however short so we may well be relying on lights that the player can extinguish with water arrows in certain places. Also consider atmosphere, placement and brightness: the player is likely to come in over the yard wall, lockpick the door, explore the downstairs rooms and later we may add an upstairs to demonstrate ladders, elevators, and stairs, all while avoiding the enemy. So plenty of shadows to hide in! And of course, if you leave it raining then don't leave extinguishable torches uncovered! We'll use niches in the wall. You can use a non-extinguisable; maybe there is a lantern or even a street lamp type suitable but remember the player must not be seen!

We don't want the player to start right next to the door then go right in. Let's assume the mission will start at the south end of the yard - leave that area in shadow. Except for special cases, don't normally start a mission with the player exposed; he/she will want a few seconds to get their bearings and admire your mission!

Let's add a wall torch to the first little room we did. These will be static visible models in the models list but have separate functioning flickering flames and those will be in the entity list...

  • RMB menu > create model > darkmod/lights/extinguishable\torch_metal_wall from the model selector and place it flush against the east wall in the middle and maybe a little above the height of the player start box. You may need to rotate it so its bracket is against the wall. This would set fire to a beam above so let's move some aside from the middle to make space. Make sure you have grid size 8 set. There was an excess gap on one side of the room so move some beams 8 units in that direction and this leaves a 24 unit gap roughly in the middle. Line up your torch below that.
  • You will probably need to reduce the grid size for fine positioning of models.
  • RMB in Entity Inspector; add to its properties noshadows with a value of 1. This stops the torch itself casting a huge moving shadow which is unnatural.
  • RMB menu > create entity > light_torchflame_moving. This is extinguishable. Do NOT use 'light_extinguishable_moving' which has no visible flame.
  • Place the flame exactly over the walltorch and about 8.25 units above it. It should sit like an ice cream in a cone roughly. You will need to see it in-game to make sure it looks correct. Use all views to make sure it is aligned in all directions (you only need do this once then we can clone them both together for other torches.) Do NOT rotate a flame; we might need to adjust its vertex origin which is its light source and this can give odd effects if rotated.
  • Press V for drag vertices mode or press DRsVertices.jpg on TBB and move the flames vertex out about 8 or 10 units to the front of the flame. The light is cast from this single point so it helps to cast light sideways naturally from the front of the flame. This is why you should not rotate the flame as the vertex will not show with the same rotation in Dark Radiant. When you come to rotate torch/flame combos in the future to place on different walls, select the torch separately if you have moved the flame vertex (or adjust it all after!)
  • Press V to DEselect drag vertices.
  • With the flame selected, in the Entity Inspector check the 'show inherited properties'
  • Select the _colour property. This is set to an orangey light but is slightly bright for our small room. Reduce its brightness VALUE to say 80 or 85.
  • Now we come to light radius. Adjust this by typing in the values in the light_radius property in the Entity Inspector so that the light centre does not move. For wall lights, the light radius must not extend much beyond the far walls. The reason is that the light will fade to zero beyond those walls which means those walls will be proportionally brighter (as they catch the light well within the brightness rather than near the end of the fade). Because the wall on which the torch is mounted receives light at a very shallow angle and it fades rapidly to zero along it then it will look much too dark if the other walls are very bright. In the worst cases it can look almost black by comparison. Try it out and you will see what I mean. If you then reduce the radius so it only extends beyond the far walls by 10 or 20 units then it will look much more natural. Place other lights if you need to add more light on those side. You will have to experiment in each individual situation. In this particular case the torch is not quite central so will extend about 30 or 40 units on one side and maybe 10 on the other. Similarly set the height radius so it just extends beyond floor and ceiling. Too much and you will have a super bright ceiling compared to the torch wall.

Save the mission and clone both torch and flame and move to the north wall of the big room between the central vertical beam and the west wall. You don't want to illuminate the player character as he/she sneaks in the door.

  • You will need to rotate so remember to keep the flame vertex (light source) sticking out at the front of the flame. If the flame is rotated it will not show the vertex in the right position so if rotated, delete any rotation property from the flame and adjust the vertex in the grid view.
  • Adjust the light radius so it just protrudes beyond the south wall. The west wall I found could be extended 75 or 100 units without spoiling the torch wall and this means it exends equally to the east a realistic amount.

I don't think either of those rooms needs any more large lights but a candle or two carefully placed might look good...

  • RMB menu in grid view > Create Entity > darkmod > atdm:moveable_candle1 or 2. Place it on a table or shelf etc.
  • RMB menu in grid view > Create Entity > darkmod > light_candleflame_moving. Place its centre at the tip of the candle's wick.
  • To the flame, add the property bind and the value will be the name of the candlestick. Get this by selecting the candlestick, highlight the 'name' property (NOT the classname but the next line down) and the copy the name from the input box at the bottom of Entity Inspector. Reselect the flame and paste this in as the value for the bind property you added. This will attach the flame to the candle so if the player picks it up then the flame won't stay behind!

Now we can add a torch or two in the yard. But it may be raining! If so, here's a way to make some wall niches...

CSG Subtract, Another Cutting Tool

This is another way to cut out a section of a brush (or rather split the brush up to simulate rather like hollow and room) using CSG subtract. Be cautious with this as it might not always work the way you expected. It involves using a small brush as a guide for which piece to 'cut out' of another brush...

  • Grid Size 8
  • Select any yard wall where you would like a torch niche
  • We made these walls 8 units deep which is not deep enough for a torch niche so deepen it to 16.
  • Clone it.
  • resize its height to 68 (fits between courses of bricks) and 16 wide (along the wall Y direction.) Leave it the depth of the wall.
  • Position it midway up the wall so it fits between courses of bricks not cutting into bricks vertically. Adjust its height if necessary to do this. Sideways it's obviously not possible to avoid half bricks but that's true in the real world.
  • Position it anywhere on the wall but not too near the south end of the yard where the player starts.
  • On the Brush menu select CSG > CSG Subtract. Nothing might seem to have happened but this will have split the wall up into smaller brushes surrounding the small clone and deletes the part of the wall where the clone is still selected.
  • If you were to delete the clone now there would be a hole right through the wall. Instead push it back into the wall the whole depth of the wall so it can form the back of a niche. We might have deepened the wall and neatly trimmed this back piece but it isn't worth it. Let it stick out the back into the void. Don't leave a gap of course!
  • Check the texture inside the niche. CSG Subtract cleverly uses the right texture but is the scale, etc. OK? Adjust if necessary so it all lines up.

You might also consider a supporting stone across the top of the niche if you were doing a 'real' mission but we must press on....

  • Clone a torch and flame together and drag them low in the niche with a generous gap above the flame.
  • Select the flame, V for drag vertex, and move the vertex (light source) in to the centre of the flame I found best. V to DEselect vertex mode!
  • I increased the brightness to the max 100 and extended the radius to about 250. Always try to make the radius value a cube generally so here depth and width I set to 250. But the height I reduced to 90 as it looked too bright on the ground.

Looks good to me; how was yours?

Save with a new name, dmap, map to take a look. Make one or two more if you wish but don't make the yard too bright! Take one more look around in-game to check out the lighting. Atmospheric? Too difficult for the player to get by? Maybe we should look at arming the player character with a few tools and weapons, especially something to help put out those lights!...

Tools, Weapons, Equipment

Inventory

To add an item to the player's or any AI game character's inventory at mission start it can be included in the player's equipment shop as 'starting gear (see later) or it can be added this way...

  • Create the item in the map. It can be placed anywhere but will not be visible in the editor once it is assigned to the inventory. In fact it will not even exist in the map technically. However, it will always have its original coordinates and will re-appear there if removed from the inventory in the editor. So you might consider...
  1. Create a 'blue' room (a room not accessible by the player) and store all items intended for the inventory in there (purely for management purposes)
  2. Just place each item in any place that makes sense to you. Normally you will never see them again anyway. Should you wish to select any inventory item in the editor to modify or delete, etc then use L to list all the entities and select from the list.
  • Add the property inv_map_start with a value of 1 (a setting of 0 means it is not in an inventory.)
  • If it is to go in an AI's inventory, eg, you want a guard to have a key, then add another property inv_target and give it the value of any entity's name (it's individual name not class name.) Yes, even inanimate entities have an inventory. The default inventory is 'player1 (the default player name) so no need to use this property for the player.
  • If the item is one of many of its type, eg, 4 health potions then add the property 'stackable' and give it the value of how many you want.

Dark Mod provides inventory categories to group all of a type together and many other features. Read Inventory for details.


Weapons

During development a standard set of weapons is assigned already. This tutorial can be updated later about this

Meanwhile, mission designers can give or sell the player weapons and other equipment in the pre-mission shop described in the next section...


Pre-mission Player Equipment Shop

NOTE: some items still not defined for the shop as at September, 2007. To be reviewed

You can optionally provide a pre-mission 'shop' for the player to select, drop, or purchase items. See Purchase Items for full details. For our particular mission this is what you do...

  • Close your mission editor, eg, Dark Radiant.
  • Open your mission 'map' file in a plain text editor.
  • Copy and paste the following immediately beneath the "classname" "worldspawn" line and resave it. MAKE SURE the file is saved with the .map suffix. If you afterwards load it into Dark Radiant and select any primitive brush you should see the following listed in the entity inspector under worldspawn.....
This list to be reviewed again nearer completion of this tutorial

// the amount of starting gold you want the player to have to buy equipment: "shop_gold_start" "700"
// items the player starts with:
"startingItem_1_item" "weapon_blackjack"
"startingItem_1_qty" "1"
"startingItem_2_item" "weapon_shortsword"
"startingItem_2_qty" "1"
"startingItem_3_item" "weapon_broadhead"
"startingItem_3_0_qty" "15"
"startingItem_3_1_qty" "10"
"startingItem_3_2_qty" "5"
"startingItem_4_item" "weapon_waterarrow"
"startingItem_4_0_qty" "10"
"startingItem_4_1_qty" "5"
"startingItem_4_2_qty" "0"
//"startingItem_5_item" "atdm:playertools_compass"
//"startingItem_5_qty" "1"
"startingItem_6_item" "atdm:playertools_lockpick_bent"
"startingItem_6_qty" "1"
"startingItem_7_item" "atdm:playertools_health_potion"
"startingItem_7_0_qty" "1"
"startingItem_7_1_qty" "0"
"startingItem_7_2_qty" "0"


//items available for purchase:

"shopItem_1_item" "weapon_broadhead"
"shopItem_1_0_qty" "25"
"shopItem_1_1_qty" "15"
"shopItem_1_2_qty" "10"
"shopItem_2_item" "weapon_waterarrow"
"shopItem_2_0_qty" "15"
"shopItem_2_1_qty" "10"
"shopItem_2_2_qty" "5"
"shopItem_3_item" "weapon_firearrow"
"shopItem_3_qty" "2"
"shopItem_4_item" "weapon_ropearrow"
"shopItem_4_qty" "4"
"shopItem_5_item" "weapon_noisemaker"
"shopItem_5_qty" "3"
"shopItem_6_item" "atdm:playertools_flashbomb"
"shopItem_6_0_qty" "5"
"shopItem_6_1_qty" "3"
"shopItem_6_2_qty" "1"
"shopItem_7_item" "atdm:playertools_health_potion"
"shopItem_7_0_qty" "3"
"shopItem_7_1_qty" "2"
"shopItem_7_2_qty" "1"
"shopItem_8_item" "atdm:playertools_spyglass"
"shopItem_8_qty" "1"

AI, patrolling, teams, etc.

Windows

containers

lockpicking

Readables

Maps

Ladder

Elevators

Teleports

Sounds

Add a global? or another atmospheric in the house?

Objectives

  1. Break into Creep's House
  2. Steal back the scepter he stole from you
  3. Kill him (normal level)
  4. KO him and lock him outside (hard level)
  5. Drop the incriminating message. Don't get seen (Expert)
  6. Creep is a thief and must have other loot worth stealing - take at least 500 (normal)
  7. Creep is a thief and must have other loot worth stealing - take at least 750 (Hard)
  8. Creep is a thief and must have other loot worth stealing - take at least 1000 (Expert)
  9. Find his key and exit by the front door (expert)

Zipping up

link to zip up wiki

Your own Build Design

link to build design wiki

Previous Page ... Next Page