Home - Forums - Documentation - Gallery - Bugs

Contents

Using walktest

Walktest is an essential test application in Crystal Space. It provides you many commands and methods to test or change your map files, debug them, etc. This tutorial is intended to explain you the basics of Walktest, step by step.

Running walktest

After successfully compiling Crystal Space on your computer, walktest is ready to use. Open a console, and navigate into your CS directory. (For Windows users: Start menu->Run and type cmd . A console will pop up, now you have the console.)

Start the application with the command:

walktest

First walktest creates a new window, and you will see many informations from your Crystal Space version, from your graphics driver, etc. It will look like this:

Image:walkmsgms.jpg

Next walktest loading the castle map. When Crystal Space hadn’t found precached lighting data, you will see a warning:

Image:bp1.jpg


Walktest has a command console. Relight is one of the acceptable walktest commands, in this example we have to use it, or our map will be too dark. Press the ‘tab’ key, and the console will be visible to you. Type the command and press enter:

relight


Image:relightmsg.jpg

Calculating lighting needs time, especially, when you use large map files. So be patient. Pressing the ‘tab ‘key you will see the 3d world again. Ok, press ESC and your app will quit.

When you type in your console again:

walktest

You can see, the lighting infos have disappeared. Press ESC, and type this:

walktest -relight

The ‘relight’ command option ensures, that the lighting maps will be recreated, and Crystal Space saves this information into the /your_mapfile_directory/cache/ directory. Press ESC, and run walktest again without the relight option and you will see, that the engine loads the previously calculated lightmaps. (Note, cslight is a direct application to calculate map lightmaps).

Walking in the 3d world

In walktest, you can walk around in your newly created map, like in any other FPS (first person shooter) game. The most important walk key bindings are:

Key up: go forward

Key down: go backward

Key left/right: rotating the camera left/right:

Page up, page down: look up/down

Space: Jump

Alt+key left/right: strafe left/right

b key: Turn 180 degree from the direction you are facing.


When you use Crystal Space 1.0, walktest will load the grandiose castle map for you – enjoy and walk around. After pressing the left mouse button, the camera will go forward. When you want to walk only with the mouse (as in many FPS-games), press ‘tab’ to switch the console, and type this:

freelook on

Press tab again and from now, when you move your mouse, your camera will move too. When you like the inverse mouse look (like in the ace games), type this into the console:

inverse_mouse on

The commands:

freelook off

inverse_mouse off

are very useful, when you want to make this commands ineffective.

There are a special movement options for you to choose, the so called ‘move3d’. When you press ‘3’ or type into the command console:

move3d on

And switch to 3d view, you will see the result, when you try to move. You will move step by step, but most important., you can move in any direction(gravitation is off). Just look up with the Pageup key, and you can walk up. Your camera movement will be real 3d. Try it, and see the result. The left and right arrow keys which now rotate the camera how you would expect it. Switch back: press the ‘3’ again or type into the console:

move3d off

The command is more effective when you set freelook on (that is just the authors opinion).


More view

Walktest can easily splash your screen (like in a race game). Just press shift+s, and you will see something like this:

Image:bp2.jpg


Now you have two different views. To toggle between them, press ‘shift+t ‘. Pressing the 'shift+U' will switch to one viewpoint mode. The passive view will have disappeared.


Gravitation and collision detection

When you don’t need gravitation, just press ‘8’ or type the

do_gravity off

command. Now when you press the space command, the camera will jump, and remains in the air. So you are able to walk in the air like Jesus over the water. When you feel, that you want to go through walls but had not the opportunity to do this until now, you can type into the commnad console:

colldet off

Now, you can move through any solid object, like any normal ghost in a scottish castle can do.

More useful commands

To get an average frame-rate (frames per second), press ’P’ or use the perftest command. The command will render 200 frames (by default), then it prints the result into the console. The

perftest 1000

command measures 1000 frames, so by changing this parameter, you can try different measurements.

When you press ctr+C or type:

coordshow on

command in the console, walktest will display you your actual position and sector name, like this:

Image:bp3.jpg


You can save your camera position, and load it later. To save , press ‘shift+c’. To load, press ‘c’. Your camera will jump into the saved position. Less moving, less time – saving a good coordinate always makes the things faster. Note, the camera position will be saved into the /tmp/ VFS directory. When you run walktest next time, pressing the ‘C’ key will restore the position.

You can toggle the logo displaying with the key 'L' , or with the command ‘do_logo on/off’.

Walktest command line options

Walktest provides you many command line options. The most important command line option is the map path, that you want to load. To load the terrainf map, you have to type:

walktest /lev/terrainf


Or just:

walktest terrainf

Because the /lev/ is not necessary, when your maps were stored in the /lev/ VFS directory.

Other options:

Logo: the CS logo will be displayed

nologo : the CS logo will be not to displayed

colldet: collision detection on

nocolldet: collision detection off

saveable: engine saveable flag on

nosaveable: engine saveable flag off

help: displays command line help


Walktest script files

Walktest can execute scripts. Walktest scripts are regular walktest commands, which will execute one frame per command. Walktest reads the /cs/data/config/autoexec.cfg file at startup, by default. Here is the content of the file:


bind f8 exec /this/perfscript

bind tab console toggle

bind space jump

bind ctrl-l lightning

bind shift-a p_alpha ++1

bind alt-a p_alpha --1

bind a action

bind b turn

bind shift-c coordsave

bind c coordload

bind ctrl-c coordshow toggle

bind d emode front2back

bind shift-d emode back2front

bind alt-d emode zbuffer

bind shift-e frustum toggle

bind shift-l addlight 1,1,1,1000

bind alt-l addstlight 1,1,1,1000

bind l do_logo toggle

bind p perftest

bind q quit

bind esc quit

bind r record

bind shift-r play

bind alt-r playo nce

bind ctrl-t things toggle

bind z cosfact ++.1

bind shift-z cosfact --.1

bind shift-1 dellight

bind 1 addlight

bind alt-1 dellights

bind 2 picklight

bind shift-2 droplight

bind f1 extension sim_pal

bind f2 extension sim_grey

bind f3 extension sim_332

bind f4 fs_inter .01,100

bind f5 fs_fadeout

bind f6 fs_fadetxt spark

bind \ freelook toggle

bind ) db_procpol 0
bind _ db_procpol --1
bind + db_procpol ++1

bind ) db_octree 0

bind _ db_octree --1

bind + db_octree ++1

bind = lod 0
bind [ lod --.01
bind ] lod ++.01

bind = db_frustum 0

bind [ db_frustum --1

bind ] db_frustum ++1

bind status-left strafe_left
bind status-right strafe_right

bind status-alt-left strafe_left

bind status-alt-right strafe_right

bind status-left rotate_left

bind status-shift-left rotate_left

bind status-right rotate_right

bind status-shift-right rotate_right

bind status-up step_forward

bind status-shift-up step_forward

bind status-down step_backward

bind status-shift-down step_backward

bind status-pgup look_up

bind status-pgdn look_down

bind ctrl-left i_rotleftc 1,0

bind ctrl-right i_rotrightc 1,0

bind ctrl-alt-left i_left 1,0

bind ctrl-alt-right i_right 1,0

bind ctrl-up i_forward 1,0

bind ctrl-down i_backward 1,0

bind ctrl-alt-up i_up 1,0

bind ctrl-alt-down i_down 1,0

bind ctrl-pgdn i_rotleftx 1,0

bind ctrl-pgup i_rotrightx 1,0

bind ctrl-alt-pgdn i_rotleftz 1,0

bind ctrl-alt-pgup i_rotrightz 1,0

bind ctrl-shift-left i_rotleftc 0,1

bind ctrl-shift-right i_rotrightc 0,1

bind ctrl-shift-alt-left i_left 0,1

bind ctrl-shift-alt-right i_right 0,1

bind ctrl-shift-up i_forward 0,1

bind ctrl-shift-down i_backward 0,1

bind ctrl-shift-alt-up i_up 0,1

bind ctrl-shift-alt-down i_down 0,1

bind ctrl-shift-pgdn i_rotleftx 0,1

bind ctrl-shift-pgup i_rotrightx 0,1

bind ctrl-shift-alt-pgdn i_rotleftz 0,1

bind ctrl-shift-alt-pgup i_rotrightz 0,1

bind ctrl-alt-up i_up 0,0

bind ctrl-alt-down i_down 0,0

bind ` inverse_mouse toggle

bind status-0 fire

bind 3 move3d toggle

bind shift-8 colldet toggle

bind 8 do_gravity toggle

bind s sprlight toggle

bind f9 addsprite bot,1

bind f10 delsprite bot

bind alt-enter fullscreen

bind ' speed toggle

bind shift-s split_view

bind shift-u unsplit_view

bind shift-t toggle_view

bind alt-c cubemapshots


The ‘bind’ command (like in Quake-style games) binds the keys to the actions. When you rewrite this file, you can change the default key bindings, but you have to know, that walktest has a command line option to run scrips at startup:

walktest –exec=’filename’

So you can add at that way your config file without modifying the original autoexec (wise idea). The script file, any walktest command is possible.


There are many more walktest commands for you to try out and be impressed, you can find them all in the manual.

Have fun!

Nagyjoco 10:25, 4 October 2007 (CEST)

| Article | Discussion | View source | History |