Skip to content

Tomb Engine Setting Up A New Level Tutorial

Stranger1992 edited this page Jul 6, 2022 · 4 revisions

Introduction

Hello and welcome to your starting point for the long-awaited, new Tomb Raider Level Editor engine called "Tomb Engine". This guide will show you how to properly set up your future projects and adventures for Lara Croft to go on.

In this tutorial, I will show you how to Create a Playable level and this tutorial covers the basics for setting up everything properly for TEN. _Please note that many of these topics can be applied to TRNG projects.

This tutorial does NOT serve as a replacement for the Official Tomb Raider Level Editor manual and does not show you how to create levels. It assumes that you have prior knowledge of creating a playable level in TRLE or TRNG. What will be covered here are topics and the workflow with the Tomb Editor suite and Tomb Engine.

Topics covered are:

  • Setting up a new project in Tomb Editor
  • Adding Level Objects and Textures
  • Creating a new Level file
  • Scripting a new level block in Lua
  • Setup the samples within Tomb Engine for TEN
  • Copy over objects from legacy games that retain their sounds
  • Enable custom footstep sound effects
  • Create a playable level.

Creating a new project.

In the provided download you will see a folder called "HelloTen". This is our project folder for this project and contains all necessary files and folders to run TEN. I recommend using this folder as a basis for your own projects as a template. We will be using this specific folder for this tutorial. Please do not modify any files on your own until you know what you are doing. Believe me: its not worth the headache.

  1. In Tomb Editor (Abbreviated as TE from now on) go to the top menu bar and select “Editor Settings”. Select the “General” tab and check “Enable Experimental Features” on the pop-up. Then press “Apply” to commit this change. This now enabled TE to use the new features specifically for levels built for the Tomb Engine Level (Abbreviated as TEN from now on).

  2. Next, go to the top menu bar and select Level Settings. Select the Game tab change and change the Game Version to Target to Tomb Engine. Then press “Apply” to commit this change. This has now made your project set for Tomb Engine and some new controls and options have been enabled that are specifically implemented when using TEN.

  3. Next, still on the Game tab, change the file paths so that the editor knows where your runtime and game engine files are kept. Please point the editor to the following paths in the provided project files:

Description Local Directory To Navigate To
"Folder In Which Game Components Reside" Hello TEN\Engine
"Target Folder and filename for level file" Hello TEN\Engine\Data\HelloTen.ten
"Target executable that is started with the "Build and Play button" Hello TEN\Engine\TombEngine.exe

Level Textures and Objects

Adding Objects from a .WAD2 file.

WAD2 file for this tutorial in the Hello TEN\Level Assets\Level 1\Graphics folder. The default Tomb Engine WAD2 can be found in the TE installation folder under Assets / WADS. This default WAD2 contains the bare minimum assets needed to build a level for the TEN engine. I highly recommend using this as a base and making a new version of the .WAD2 for our first level. This is covered in the next section.

Adding in Level Textures.

TE allows you to load the most common image formats as textures for your level. You can use multiple texture files per project and also supports the alpha channel (so no more magenta colour to show transparency!). Whilst this tutorial will not cover the technicalities of textures; I wanted to make you aware that we are only scratching the surface of what can be done now.

To load a new texture file: simply go to TE -> Top Menu Bar -> Textures -> Add Texture and point to the texture file "HelloTen.TGA" found in Hello TEN\Level Assets\Level 1\Maps\Level Textures in your supplied download folder for this tutorial.

Saving Your Project.

While this may not seem like it needs to be said, please remember to SAVE your project somewhere meaningful. Proper file organisation and file naming will make your life easier. For this tutorial, I will show you my methodology behind saving files and will refer to project files in the same way.

In TE:

Go to File -> Save As and save this blank project as HelloTEN_Start_Blank.PRJ2 in the Hello TEN\Level Assets\Level 1\Maps\Project Files directory.

Tomb Editor has an autosave feature too which you can access from the Tomb Editor menu -> Tools -> Editor Options. Enabling this will autosave your project in the same directory you saved the project.

Creating a New Level File.

The format for custom Tomb Raider levels has now changed when using the TEN. It is now saved as a .ten file. But the process in creating a basic level has not really changed. Tomb Editor will still allow you to create the geometry, texture it and trigger items and objects. But from Version 1.5.0 the functionality inside of Tomb Editor has been changed to allow exciting new additions to the level builder's toolset.

In the next section, you will need at least 1 room with textures and a LARA object in and the room saved out as a .ten file. This is in the next section we are going to add the sounds to the level (using the brand new sound system) and are going to build a script in Lua that will tell the game what level to load and how. This is the next step from the older and abandoned TRNG scripting or Script.txt to define level structures.

Scripting and Sounds

Introduction to the new Sound system.

For the TEN, the level samples have undergone a massive overhaul below I will list the changes:

  • Now ALL sounds from Tomb Raider (1996), Tomb Raider II: The Dagger of Xian, Tomb Raider III: The Adventures of Lara Croft and Tomb Raider: Chronicles have been made available for use straight away! They have been re-organised into a brand new soundmap.

  • 8 new "Custom" footsteps sounds have been made available in the TEN and the SAND and GRASS sounds have been separated.

  • XML files to instantly change all sounds from the default TR4 to either their TR1, TR2, TR3 or TRC counterparts have been provided (along with all samples). Tomb Raider Legend, Anniversary and Underworld are planned also. No more renaming sounds and ripping them from the data files. It has now all been provided to you.

  • All previously hardcoded sounds have been unlocked and given control back to the builder to change how they desire. Although some sounds are still called in by the game code: they are available now to change.

Adding Sounds to Your Level

In this section we are going to add the sounds to the level and then override all of Lara's sounds from TR4 to their TR1 counterparts.

tbc

How To Create A New Level Script

To start off with, this section will explain, in simple terms how actually create and program Lua Scripts specifically for Tomb Engine. For those who are familiar with Tomb Raider Next Generation (TRNG) or even Tomb Raider Level Editor (TRLE) then this guide as a gateway for veteran and new builders understand how Lua defines level scripts and how to program things in Lua for Tomb Engine.

Scripting A New Level

To first illustrate what files are what: see the table below.

TRLE File Lua File
Script.txt Gameflow.Lua
English.txt* Strings.Lua

*Or another language.txt depending on your preferences. For this tutorial I will refer to the file as English.txt as its the one I use.

Gameflow.Lua is the file where you put all the parameters so that you can play your new level and Strings.Lua is where you add any text that you need inside. A "STRING" is just programming term for "Text" by the way. The same as before where Script.txt would be the level block and English.txt would be where you are putting the level names and the names of puzzles, keys and so on and so forth.

Now let's move on and go into the comparison a bit more deeply by taking a look at some original Tomb Raider 4 scripts and then their new Lua equivalents.

See this script from Tomb Raider IV. This will be a familiar site to many who have used the level editor or subsequent improvements. In this script, you can see that there are some puzzle items, the sky clouds' colour and speed, the level name, and the data file for the level.

[Level]
Puzzle= 1,Nitrous Oxide Feeder, $0004,$0300,$0000,$0000,$0000,$0002
Puzzle= 2,Car-Jack, $0000,$0400,$4000,$8000,$4000,$0002
Puzzle= 4,Roof Key, $0000,$0300,$4000,$d000,$b000,$0002
Puzzle= 5,Weapon Code Key, $0000,$0200,$8000,$c000,$0000,$0002
Puzzle= 8,Mine Detonator, $0008,$0400,$8000,$0000,$0000,$2002
PuzzleCombo= 1,1,Valve Pipe, $0004,$0300,$0000,$0000,$0000,$000a
PuzzleCombo= 1,2,Nitrous Oxide Cannister, $0002,$0300,$0000,$0000,$0000,$0002
PuzzleCombo= 2,1,Car-Jack Body, $0000,$0400,$4000,$8000,$4000,$0002
PuzzleCombo= 2,2,Handle, $0000,$0300,$4000,$8000,$
4000,$0002
PuzzleCombo= 8,1,Mine Detonator Body, $0008,$0400,$8000,$0000,$0000,$0002
PuzzleCombo= 8,2,Mine Position Data, $0004,$0280,$8000,$c000,$0000,$0002
Layer1= 56,72,8,16
LoadCamera= 62359,-4966,62296,63155,-4380,63208,3
ResetHUB= 27
Name= Citadel Gate
Horizon= ENABLED
Level= DATA\HIGHSTRT,102

Within the English.txt file you can expect to see the puzzle names and level names listed somewhere as STRINGS:

Car-Jack
Roof Key
Weapon Code Key
Mine Detonator
Valve Pipe
Nitrous Oxide Cannister
Car-Jack Body
Handle
Mine Detonator Body 
Mine Position Data
Citadel Gate

No matter where you have them, as long as they are there in the English.txt file then they are in the right place.

Now lets take a look at the Lua equivalent and then I will explain what each one means. Please note that at this stage, as I have not discussed about proper indentation and formatting of your Lua scripts, I have removed the TABS and condensed things down.

Strings.Lua

city = {"Citadel Gate",},
cjack = { "Car-Jack",},
roofK = { "Roof Key",},
code1 = { "Weapon Code Key",},
mine = { "Mine Detonator",},
valve1 = {"Valve Pipe",},
nitro2 = {"Nitrous Oxide Cannister",},
cjackb = {"Car-Jack Body",},
chandle = {"Handle",},
mine1 = { "Mine Detonator Body",},

Gameflow.Lua

city = Level.new();
	city.nameKey = "city";
	city.scriptFile = "Scripts\\city.lua";
	city.ambientTrack = "102";
	city.levelFile = "Data\\city.ten";
	city.loadScreenFile = "Screens\\rome.jpg";
	city.horizon = true
	city.layer1 = Flow.SkyLayer.new(Color.new(56,72,8),16)
	city.farView = 20
		city.objects = {	
		InventoryItem.new("nitro1",InvID.PUZZLE_ITEM1,0,1,Rotation.new(0, 0, 0),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("cjack",InvID.PUZZLE_ITEM2,-25,1,Rotation.new(0, 0, 90),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("roofK",InvID.PUZZLE_ITEM4,0,1,Rotation.new(-45, 180, 90),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("code1",InvID.PUZZLE_ITEM5,50,1,Rotation.new(-90, 0, 90),RotationAxis.Y,2,ItemAction.USE),
		InventoryItem.new("mine",InvID.PUZZLE_ITEM8,50,0.5,Rotation.new(0, 0, 0),RotationAxis.Y,2,ItemAction.USE),
		InventoryItem.new("valve1",InvID.PUZZLE_ITEM1_COMBO1,50,0.5,Rotation.new(0, 0, 0),RotationAxis.Y,2,ItemAction.USE),
		InventoryItem.new("nitro2",InvID.PUZZLE_ITEM1_COMBO2,0,1,Rotation.new(0, 0, 0),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("cjackb",InvID.PUZZLE_ITEM2_COMBO1,0,1,Rotation.new(0, 0, 0),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("chandle",InvID.PUZZLE_ITEM2_COMBO2,0,1,Rotation.new(0, 0, 0),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("mine1",InvID.PUZZLE_ITEM8_COMBO1,0,1,Rotation.new(0, 0, 0),RotationAxis.Y,-1,ItemAction.USE),
		InventoryItem.new("mine2",InvID.PUZZLE_ITEM8_COMBO2,0,1,Rotation.new(0, 0, 90),RotationAxis.Y,-1,ItemAction.USE),
Flow.AddLevel(city);