Guard With Lantern

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 light 13
Mid light 19
High light 44
Slow 5.49
Fast 8.25
Slow mod 0
Norm mod 5
Fast mod 10
Wall dist 1.75
Crouch mod -3
Wall mod -1
Corner lean mod 1059481190

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 light 0
Mid light 0
High light 0
Slow 5.49
Fast 8.25
Slow mod 0
Norm mod 5
Fast mod 10
Wall dist 1.75
Crouch mod -3
Wall mod -1
Corner lean mod 1059481190
high:
Low light 6
Mid light 10
High light 22
…….
normal:
Low light 13
Mid light 19
High light 44
…….

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
    • Renderer -> Self Lit: 250
    • Renderer -> Light: Set all numbers to zero.
    • Return to Main DromEd window
  3. Add to lantern’s properties
    • Act/React -> Sources
    • Click Add
    • Object: LanternGuard
    • Stimulus: LanternStim
    • Propagator: Radius
    • Edit Shape:
      • Radius: 50
      • Flags: None
      • Dispersion: Linear
    • Edit Life Cycle:
      • Flags: No Max Firings
      • Period: 100
      • Max Firings: 1
      • Intensity Slope: 0
      • Intensity: 50
  4. Select LanternGuard and click on links.
    • Flavor: Creature Attachment
    • From: LanternGuard
    • To: “X”
    • Click OK
    • Select the link and click Data.
    • Set it to “Left Fingers”
    • Return to Main DromEd window

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
    • Click Add
    • Object: Garrett (-2099)
    • Stimulus: LanternStim
    • Min intensity: No Min
    • Max intensity: 25
    • Effect: Set Property
    • Edit Effect:
      • Prop Name: AI_VisCtrl
      • Target obj: Me
      • Agent obj: normal
      • Click OK
    • Click Add
    • Object: Garrett (-2099)
    • Stimulus: LanternStim
    • Min intensity: 26
    • Max intensity: 38
    • Effect: Set Property
    • Edit Effect:
      • Prop Name: AI_VisCtrl
      • Target obj: Me
      • Agent obj: high
      • Click OK
    • Click Add
    • Object: Garrett (-2099)
    • Stimulus: LanternStim
    • Min intensity: 39
    • Max intensity: 50
    • Effect: Set Property
    • Edit Effect:
      • Prop Name: AI_VisCtrl
      • Target obj: Me
      • Agent obj: highest
      • Click OK

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 light 3
Mid light 5
High light 11
…….
medium:
Low light 9
Mid light 15
High light 33
…….

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:
    • Radius 50
    • Flags ‘Line of sight (raycast)’
    • Dispersion Linear
    • Click OK

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
    • Stimulus LanternStim
    • Propagator Radius
    • Intensity -10
    • Click the ‘edit shape’ button and set up the box as follows
      • Radius 50
      • Flags ‘None’
      • Dispersion None
      • Click OK
    • then click ‘edit life cycle’ and set up the box as follows
      • Flags ‘No max firings’
      • Period 500
      • Max firings 1
      • Intensity slope 0
      • Click OK

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
THIEF@DANCORDER.COM

Special Thanks to Totality and the TTLG Editor’s Guild


About this entry