There has been some talk in
this thread about improving the user's experience by providing tutorials that teach players how to drive the car. This makes sense for a lot of reasons, and VDrift is at a point now where this shouldn't be too difficult to do.
Before this stuff is coded it makes sense to discuss 1) what it should be like, 2) how it should be implemented, 3) what the file structure will be like, and what art requirements there are. Here are my ideas. Feel free to add yours.
1. I think we should use a combination of replays and allowing the player to try it alone. Both methods should include instructions in the form of on-screen text (we can add spoken instructions as well, once we have the available audio). For instance, a replay should play first showing the player what to do, while instructions explain what to do, why, and how to do it. After the player has seen it once, they can try it themselves. The game should evaluate if the player has successfully completed a goal, and report this to the player. After that, there should be a menu with options for what to do next: show them what to do again, let them try it again, go on to the next goal, or exit the tutorial. When a player has completed all the goals in a tutorial they should be told how they did overall, and returned to the tutorials menu.
2. The best way to implement the tutorials is probably to write some kind of generalized Tutorial system. This way we can make lots of different tutorials. I'm imagining that we might have tutorials for drifting, "grip"/road racing, autocross, rally, etc. So naturally each tutorial needs a title and description. Also, there should be a player skill level associated with each tutorial to tell users who they are intended for. Something like beginner, novice, advanced, expert.
Since VDrift already has a replay system it makes sense to reuse this as much as possible for the tutorials. However they will need to be supplemented with on-screen text overlays as well as audio (eventually). So there will need to be a sort of tutorial script file to orchestrate all this. Each tutorial can be made up of separate sections, "lessons" or "goals" or whatever.
Here's what I imagine a sample tutorial config file might look like.
Code:
name = Beginner Drifting Tutorial
level = 0
description = Learn the basics of drifting.
car = TL2
track = DriftTutorial1
[lesson-0]
name = Simple Drifting 1
description = Drift using trail breaking (low speed)
events = 0, 1, 2, 3, 4
[event-0]
# introduce trail braking
instruction = The simplest method to drift is to use a method called trail braking. This method does not usually provide a spectacular drift, but it is pretty easy to do, and works on almost any car.
# allow-user-input defaults to off
allow-user-input = off
delay-time = 500
display-time = 10000
# show corner and empty track
replay-file = simple_drifting_0.vdr
audio-file = simple_drifting_0.ogg
[event-1]
# location
instruction = First, pick a corner that's not too sharp on a flat road, and figure out a reasonable speed to go on this road driving fairly normally.
delay-time = 1000
display-time = 10000
# show car driving normally around corner
replay-file = simple_drifting_1.vdr
audio-file = simple_drifting_1.ogg
[event-2]
# explain trail braking
instruction = Next, once you are familiar with the road and corner, try a new approach. This time, enter the corner slightly faster than usual, turn in late, and brake later and harder (but shorter).
delay-time = 1000
display-time = 10000
# show car trail braking to drift corner
replay-file = simple_drifting_2.vdr
audio-file = simple_drifting_2.ogg
# ... event 3 - countersteering ...
[event-4]
# now you try
instruction = Now you try. Approach this 35 MPH turn, and use trail braking to make the rear end of the car slide. If you can get a drift score of 25 you're probably doing it right.
# start and end point
drift-score-target = 25
audio-file = simple_drifting_4.ogg
allow-user-input = on
ghost-replay-file = simple_drifting_4.vdr
The ghost replay file will need to be one that starts from the same point as the player, starts from a stop, and does a "pretty good" performance on the lesson. We don't want the ghost to be too good, so the user will be able to improve to better than the replay. After the event in the lesson where the user gets to try, another lesson can be defined, with its own set of events. In allow-user-input = on mode, the car starts at a predefined start point facing a certain direction. The lesson ends when the car comes to a stop, leaves the track, or passes the predefined end point.
Using a system defined in a way such as this, it should be possible to auto-generate menus to link together the lessons. The menus needed will probably include:
- Tutorials - list of tutorials
- Lessons - list of all lessons in a tutorial in order, quits to Tutorials
- PauseLesson - restart lesson/previous lesson/next lesson/quit current lesson, quits to Lessons
- AfterLesson - retry lesson/next lesson/quit lesson/quit tutorial
- AfterTutorial - show tutorial score, retry tutorial/return to menu, quits to Tutorials
The existing Game State class will need to be modified to include Tutorial modes, so the menu system knows to use the generated tutorial menus, and send commands to the tutorial system that do things like "start tutorial 5 lesson 6".
3. The file structure should be simple, with a data/tutorials folder containing all the available tutorials. Each tutorial will have a config file (tutorial.conf?) something like the example above. Each of the tutorial directories should have separate subdirectories for audio and replay files. There will need to be a way to ensure that a user has the necessary track required for the tutorial, perhaps one way to solve this is to include the track with the tutorial.
So the data required will be a track (though an existing one could be used), a configuration file to define the tutorial, some replays showing what to do, a script of what to tell the user, and voice-over audio files (optional).
Am I interested in coding something like this? Yes. Do I have time? No. I still need to package the last release for Linux first, and besides that I have a ton of work to do on other for-pay projects that I'm working on. However there's no harm in talking about it, in case someone else feels like working on it, or I do eventually have time, the design will already be done.
Besides, there are some issues that should be fixed before this is set up. I can think of at least one - replays created on 64 bit systems do not work on 32 bit systems, and vise-versa. (What about PPC systems?) This issue should be fixed so that the replays created for tutorials will work on any system.