Tutorbot

From Q4MAX

Contents

Overview

Tutorbot is a special type of bot, which can be used to playback demo-snippets while you're on the server with the bot. You can either choose to spectate the bot, so you can see what it is doing, or you can stay in-game with the bot and interact with it.

There are a number of uses you can put this to:

  • For true "tutorials", to teach new players how to do specific things - eg, strafe jumping, crouch sliding etc.
  • For showing specific moves - eg, showing how to do "bridge to rail", or some jump or trick that you've recently discovered possible.
  • For using as target practice. Record a bot dodging, or running down a particular hallway ; play that on a loop and keep trying to kill him.
  • "Team" trickjumping : have a tutor shoot a rocket at your feet for that extra height boost.

How to play back

First of all you must have the tutorial on the server - copy the tutorial/mp/<mapname>/<filename>.dat file to the server. Once it is there, you can use the "playTutorial" and "loopTutorial" commands in the server console.

As the file must be on the server, you may find it easiest to watch tutorials on either a listen server, or on a dedicated server on the same PC as your client (see the Server page for info on how to do this).

If you don't have direct access to the server console, then you can use "callvote playTutorial tutname" to play the tutorial, and this can be done via either the vote menu or the admin menu.

Note : When a Tutor bot dies prematurely, it will respawn and start over. If it gets stuck in a loop, just kick it off the server.

How to record

To record a tutorial, as a client you can simply use the "recordTutorial" command. This takes the name of the tutorial to save to, and if you don't supply one it'll use a default (much like demos).

Then do whatever you want, and when you're done, use "stopRecordingTutorial".

Remember : the tutorial must be on the server in order to play back. This means in a typical game, you probably cannot view tutorials you just recorded unless you're on your own listen server. To some, this may make listen servers the preferred environment to record tutorials in.

Note : Tutorials also record your own chat.

Known limitations

When recording, be careful not to interact with other entities too much, or the tutor might end up going off track more or less significantly. Tutors are very dumb and just keep on performing all the recorded input, sometimes humping walls or jumping into the void if something has changed a bit.

For example, if you pickup a haste in the tutorial, it'll only playback correctly if the haste is there. Also, what other players do is not recorded : avoid taking damage / knockback from them when recording a tutorial.

Tutorials are sensitive to tickrate. A tutorial recorded with si_fps 90 might play slightly differently at, say, si_fps 60 or 120. Again, this can result in the tutor going off track.

Distributing

If you wish to share a tutorial with someone, then simply send them the tutorial file, and they can play it back. They will not need to have the same pk4's as were on the server when playing it, so if you simply want to show a nice move this may be much easier than using normal demos.

Remember that it needs the right directory structure with the map name (i.e. tutorial/mp/<mapname>/<filename>.dat), so you may find it easiest to zip the file with the directory structure included before uploading it.

Mapping

If an enterprising mapper wants to build some tutorials into a level, this is certainly possible, and encouraged.

You should be able to create a trigger with a "call" keyword which will call the named function from the map.script. You can then use this to execute the console commands to playback tutorials. Using this, it should be possible to set up a nice interactive tutorial.

If you do create such a map, let us know...