Walking Lantern Guard Tutorial


This is a tutorial for a guard that carries a lantern and lights up your visibility gem. This was made for Thief: TDP and Thief: Gold. It is not for Thief II as one can use the renderer "Dynamic Light" instead. This was added to by Dan "Thiefs_Pawn" Corder after being originally created by Daniel "Sneaky Acolyte" Garcia. We are not to be held responsible for any damages caused by this document or the following of the directions held within. It is HIGHLY recommended that you read a Tutorial on Sources and Receptrons prior to reading this document. It is assumed that all preliminary actions of building a level have been implemented.


Background

This tutorial will explain two ways of creating lantern guards, though the second is really just an extension of the first.
The default AI->Utility->Visibility Control settings for a Ramirez guard are shown below:

Low light13
Mid light19
High light44
Slow5.49
Fast8.25
Slow mod0
Norm mod5
Fast mod10
Wall dist1.75
Crouch mod-3
Wall mod-1
Corner lean mod1059481190

We are really only interested in the first three of these settings. It seems that these numbers represent the intensity of light Garrett must be in to be regarded as being in low, medium, or high light by the AI. The other numbers modify the light intensity depending on Garrett's posture and speed so we can leave them alone. So to make Garrett more visible all we need to do is set the top three numbers to lower values.

Stuff you need for both methods
- A room not connected to the rest of your level (a 'blue room')
- At least two guards in the blue room. If you want x levels of light you'll want x + 1 guards. For the first example we'll use 3 guards in the blue room. They will be called normal, high, and highest.
- A guard in your level to hold the lantern (lanternGuard)
- A lantern (note its ID number, for the purposes of this tutorial we will call it "X")

1) The easy way:

As we want 2 light levels we need to divide the light level numbers above by 2 and use these numbers as the increments, which we'll reduce the numbers by.
So for 'highest' we need to add the property AI->Utility->Visibility Control as below

Low light0
Mid light0
High light0
Slow5.49
Fast8.25
Slow mod0
Norm mod5
Fast mod10
Wall dist1.75
Crouch mod-3
Wall mod-1
Corner lean mod1059481190
 
high:
Low light6
Mid light10
High light22
.......
 
normal:
Low light13
Mid light19
High light44
.......

We can also add
AI -> State -> Current Mode : Asleep
to all the guards as a safe-guard.

Now we need to create a custom stim

  1. Open up the Object Hierarchy
  2. Select Act/React Stimuli from the Show Tree drop-down box
  3. Click on Stimulus, and then click Add, and type in what you want to call your stim (I used LanternStim).
  4. Save the gamesys file. Make sure that you also save the mission and set that mission to use that gamesys with the set_gamesys command.

Next we will set up the lantern

  1. Open the lantern's properties
  2. Add to lantern's properties
  3. Add to lantern's properties
  4. Select LanternGuard and click on links.

Now we need to make the new stim affect Garrett

  1. Open up the Object Hierarchy
  2. Go to Physical->Avatar->Garrett and click Edit
  3. Now click Add->Act/React->Receptrons

That's it, this method is relatively simple but does have a couple of drawbacks - the extra light doesn't know about walls or corners and so will pass straight through them. In areas with thick walls and gentle bends this is not a problem and this method is fine.
However if you want to make your lantern work in a more realistic manner you'll need to read on to....

2) The slightly harder way

Do all the stuff in method 1 using more light levels if you want. E.g. add two more guards (medium and higher) with AI->Utility->Visibility Control set up as below:

higher:
Low light3
Mid light5
High light11
.......
 
medium:
Low light9
Mid light15
High light33
.......

And alter the receptrons on Garrett to use these new visibility levels.

The first thing we need to deal with is the light traveling through walls. This is actually surprisingly easy; all we need to do is change the source on the lantern.

  1. Open the lantern's properties
  2. Edit the LanternStim source, click the 'edit shape' button and set up the box as follows:

and voila you can sneak up on guard around a corner and not be lit up until you round the corner. The only problem now is that if you duck back round the corner you'll still be lit up and will stay that way forever :(
A solution is to add another source to the guard carrying the lantern with a radius a lot larger than the light radius and no 'Line of sight' flag set on the shape. To do this;

  1. Open the guard's properties and add a source set up as follows

The reason for adding the source to the guard and not the lantern is that if the guard is knocked out and falls forward and is then picked up and dropped by the player the lantern drops completely below floor level and its sources seem to stop having any effect (even without the 'Line of Sight' flag checked). This way the player will always revert to normal visibility.

So there you go working lantern guards, which method you choose depends on whether or not you need the extra realism, as it does cost extra processing power to do the second source and probably to calculate the line of sight for the first source.

Notes: The values used in this tutorial for radii, light intensity and Source strength are only a guide. You can have a much more powerful lantern if you wish, you'll just need to experiment with the LanternStim's range and the Receptron's intensities until you get an effect that looks right. Just remember that in the second method the stim on the guard must be much larger than radius at which Garrett starts to be lit.

Remember: You MUST include your custom gamesys in your .zip, so that other Thief players can play your mission.

Daniel "Sneaky Acolyte" Garcia
dgarcia@techie.com

with additions by

Dan "Thiefs_Pawn" Corder
dcc@softwire.co.uk

Special Thanks to Totality and the TTLG Editor's Guild