On this page
Heroes: the tutorial's task panel and the missions' lines
Two small parts of the Heroes HUD tell the player what to do: the task panel of basic training (the task's text, its picture, "task complete") and the lines of his missions (a mission's name with its criteria and their counts). Both were read in the original by the HUD and screen sweeps. Everything on this page is a reading: the listing of version 1.126 was read function by function and written down; where the port has the rule and a test, the page says so, and where it does not, it says that.
No retail client was run for this page. The rules below are what the functions at the cited addresses do as far as the sweeps read them. A row can be wrong until a test from the address or a played scenario confirms it; the page names the state of each.
Basic training's task panel#
Basic training is a game mode of its own (gpm_tut, one layer; see game modes). Its HUD is one panel of eleven variables in HudElementsTutorial.con: the node's show flag, three texts with a show flag each (the task's description, its progress, "task complete"), the task's picture and three show flags for picture frames.
The writer is a block of the HUD manager's update (BFHeroes.exe@bfh126!0x008a52bb, the instructions 0x008a57d0 to 0x008a5ed0). It asks the local player two questions: whether the panel is to show, and the tutorial's state, a number. The texts come from three more answers of the player: the completed task's name, the current task's name and the task's picture.
| Variable | A task is complete (state 2) | A task is set (state 3) | Progress (state 4, panel off) | Any other state |
|---|---|---|---|---|
TutorialNodeShow | 1 | 1 | 0 | 0 |
TutorialTaskCompleteString | the text of TUTORIAL_TASK_COMPLETE_<name> | not written | not written | not written |
TutorialTaskCompleteShow | 1 | 0 | 0 | 0 |
TutorialTaskDescriptionString | not written | the text of TUTORIAL_TASK_DESCRIPTION_<name> | not written | not written |
TutorialTaskDescriptionShow | 0 | 1 | 0 | 0 |
TutorialTaskImageString | not written | Ingame/Tutorial/<picture> | not written | not written |
TutorialTaskImageShow1 | 0 | 1 | 0 | 0 |
TutorialTaskImageShow2 | 0 | 0 | 1 | 0 |
TutorialTaskImageShow3 | 1 | 0 | 0 | 0 |
TutorialTaskProgressString | not written | not written | the text of TUTORIAL_TASK_PROGRESS_<name> | not written |
TutorialTaskProgressShow | 0 | 0 | 1 | 0 |
So the panel has three faces: a new task with its picture, a small progress line while the player works on it, and the completed task's name when it is done. The sweep also read when each column's writes run: the completed face is written once, while the node is still off; the new task's face is written when the node is off or when a completed task is still showing.
State in the port: read, not ported. No source file of the port writes any of the eleven variables (a twelfth, TutorialRunningAwayShow, is the only tutorial variable the port writes). Basic training therefore runs without its task panel. It is a filed difference with the rules above as its specification.
The missions' lines#
A hero carries missions: tasks with one or more criteria ("in one round", "without dying"). When a criterion's count changes, the mission listener calls the HUD (BFHeroes.exe@bfh126!0x0089f89f).
As read, the function writes nothing unless all of these hold: there is a local player, the game status is 1 (a round is on), the round phase is not 2 (the start countdown), and the slot holds a mission. Then:
- the mission's name and its show flag are set;
- an active criterion gets a line: the line that already shows it, else the first line whose timer has run out, else the first; the line gets its text, its flag, three colours and 5.0 seconds;
- the mission gets 5.0 seconds too;
- a mission that must be done in one round or without dying gets a constraint line under its criteria;
- the missions stack upward from y 270, 15 units a line.
| Row | State in the port, as the HUD sweep has it |
|---|---|
| the lines, their timers and places | the same in bfh-client/src/missions.rs (ClientMissions::hud_line), read body against body |
| the gate (game status 1, not the start countdown) | mended (the port wrote the lines at any status, so a line could show for 5 seconds in the countdown or behind the round's end). Its test was red before; played on a page as state with a hero who holds a mission: the line is written in the round, and a progress sent behind the round's end writes none. The countdown's arm was not played |
The mission message#
A completed mission, a failed one and a completed criterion each queue a message. The step (BFHeroes.exe@bfh126!0x0089f57a) counts its timer down; when it is at zero and a message waits, it takes the first one only while a round is on (and, in team elimination, not while a heat's result shows: the question is answered by 0x00504d55). The message gets a heading by its kind (mission, failure, criterion) and is handed to the show (0x0089b630): while playing it stands at y 215; a daily mission's shows lower, at 380; otherwise nothing shows.
| Row | State in the port |
|---|---|
| the show (heading, text, places) | the same |
| when a queued message is taken | mended on its test (the port ran the form of an older version, 1.89, took the message at any status and could drop it, so a mission completed as the round ends was never announced). Not played on a page |
| the running-away warning of basic training | differs: the original counts the line's 5 s down and takes it off (0x0093148c); in the port it stays once it fired. Not mended |
the task's progress, "task complete" and next task's description lines (0x008a52bb) | not wired: no statement of the port writes them |
What a player sees of it#
- In basic training: no task panel in the port today (the tasks themselves are the game mode's script).
- In basic training too: the warning for running away stays on the screen once it fired.
- In a round: mission lines and messages show as in the original while play is on, and since the two mends the port holds a line back and keeps a message queued where the original does. By the sweep's play the pictures behind a round's end were alike before and after the mend: the end of round's screen draws no mission block.
How these rows will be closed#
The sweeps' rule is the same for every row: a test written from the address first (it must be red against the port's present code), then the port, then a played scenario on a page. The missions' gate went that way (bfh_client_mission_line_gate: a mission's progress sent behind the round's end; red on the page built before the mend, on the gate's row alone). The task panel has not: until its rows stand, this page keeps the word reading for them. See how a port is made.
How it is tested#
- The two mission mends each have a test program in a Heroes process, red before the mend and green behind it, with one mutation caught: the lines' gate (
heroes_mission_lines) and the message's step (heroes_mission_message). - Played on a page: the gate, with a hero who holds a mission (
bfh_client_mission_line_gate): it passes on the page of the mend and fails on the page built before it, on the gate's row alone. The message's step was not played. - The task panel: nothing. Its rules on this page are a reading of the original; the port has no code for it, so no test can exist yet.
Three of eight addresses stand in a test's text.
In the code#
| What | Where |
|---|---|
| missions on the client | crates/bfh-client/src/missions.rs |
| the HUD's variables | the Heroes HUD and its widgets |
| the tutorial panel's variables | HudElementsTutorial.con in the game's data (not shown here) |
Notes: notes/bfheroes/hud_sweep.md (the missions' rows, rounds 27 and 28), notes/bfheroes/screen_sweep.md (the task panel, round 37).
docs/dev/heroes/tutorial-missions.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.