Goal Documentation

This is the documentation for the new goal structure on the Planet Oit. It is very open to change and modification. If you have any comments or suggestions on how to make it work even better, or need some clarification on how it works, send me an e-mail

Table of Contents

Overview
Important Object Numbers
$g.goals
$g.id_goal
$g.secondary_ID_goals
#1459 (Interpretive Module)
$g.first_interp_goal
$g.dike_id_interp_goal
#1458 (Hydrology Module)
$g.first_hydro_goal
Scenarios
How to build new modules

Score Documentation

Overview:

A player is assigned a goal immediately after they log on to the game for the first game. The purpose of these goals is to further a research aim, where students take small steps in order to learn the subject at hand.

The goal structure is divided into separate modules. Presently there are 5 different modules. The identification module, the interpretive module, the hydrology module, the survey module, and the endgame. The identification module is the only module tested, working, and used in experiments.

Return to Table of Contents

Important Object Numbers

$g.goals = New Generic Goal (#1454)
$g.id_goal = Rock/Mineral ID Goals (#1455)
$g.secondary_ID_goal = Secondary ID Goal Scoring Module (#1463)
Hydrology Module (#1458)
Interpretive Module (#1459)

Return to Table of Contents

New Generic Goal (#1454)

Overview - This is the object that controls which goal should be chosen next in the student's progression. Which module is picked is based on the property module_search_order. Goals are chosen based on the results of each particular module's select_goal function.

Return to Table of Contents

Important Properties

module_search_order - This is a list of object numbers. The order of the object numbers in this list is the order that the modules will be assigned in. The initial list given to a player is stored in a their particular player class object. You can change the modules that players need to complete by changing the module_search_order on either that particular player's object or on a class object (normally the direct parent of the player object)

goal_points - The number of points this particular goal is worth. For example, $g.secondary_ID_goal is worth 25, all of the $g.id_goal goals are 100, etc.

goal_msg - A property set up to store the show_goal message of this particular goal, it is not necessarily used by all goals, but is set up for the purpose of storing goal messages.

Return to Table of Contents

Important Verbs

assign_goal

Format: assign_goal ( explorer )
Return Value: none
Arguments - explorer = player to assign the goal to
Purpose - Control function, if a goal is assigned to a player already, show that, otherwise assign them a new goal and call start_goal if it is defined.
Called by - complete_goal and $g.game_player:confunc

goal_name_string

Format: goal_name_string ( goal )
Return Value: string saying what the name of this goal is
Arguments - goal = The goal that you want the name of (could even be #-1!)
Purpose - Used by the exploration tutor (and the GUI) to determine the name of this goal
Called by - $g.old_exploration_tutor:leave_room, $g.exploration_tutor:inform_tutor, and $directive:gui_status

is_completed

Format: is_completed ( explorer )
Return Value: 1 if module is completed, 0 if not
Arguments - explorer = player who could have completed the module
Purpose - Determine if a module/goal has been completed by a player or not
Called by - Generic Goal:select_goal

random_goal

Format: random_goal ( )
Return Value: random goal in the children of this object
Arguments - none
Purpose - return a random goal from the children of this object
Called by - $g.id_goal:select_goal

select_goal

Format: select_goal ( explorer, module_search_order )
Return Value: Object number of new goal
Arguments - explorer = player to choose the module of
module_search_order = ordering that the next module should be selected in. Use this function to change the ordering of modules for different players
Purpose - Return the next goal in this players progression.
Called by - assign_goal
Default select_goal behavior. Searches through the module_search_order recursively. If a module's select_goal function returns something, that will be the next goal

show_goal

Format: show_goal ( explorer, goal )
Return Value: none
Arguments - explorer = player to assign the goal to, goal = goal to display
Purpose - Will display the goal message however it is supposed to be displayed
Called by - assign_goal and $g.game_player:showgoal

show_goal_points

Format: show_goal_points ( history_entry )
Return Value: number of points achieved in this history_entry
Arguments - history_entry = the history entry you want to print out
Purpose - Used by all scoring routines to determine how many points you have and how to print out something in showscore
Called by - show_goal and $directive:gui_status
This is the default behavior, there is no score capability in the object that was called, so we print a message saying so, and return 0 points.
Another potential change. $directive:gui_status should simply check a property on player for the number of points. complete_goal should add points to this property

Return to Table of Contents

Rock/Mineral ID Goals (#1455)

Overview - This is the object that controls the primary goals in the rock/mineral identification game. It is presently assigned as the first module in a player's progression. You are given 100 points on completion of this goal.

Return to Table of Contents

Important Verbs:

complete_goal

Format: complete_goal ( explorer )
Return Value: none
Arguments - explorer = player who has completed the goal
Purpose - Function that is called by external functions to say a goal has been completed
Called by - $g.thing:report identify

get_test_set

Format: get_test_set ( goal )
Return Value: the test set for the rock or mineral represented by goal (or an empty list)
Arguments - goal = the goal we want to know the test set of
Purpose - Called by the equipment tutor to determine what instruments are needed
Called by - $g.old_equipment_tutor:equip_needs and $g.equipment_tutor:equip_needs

is_completed

See $g.goals:is_completed. This module returns 1 if 500 points have been scored by the player. Otherwise, it returns 0.

record_goal_points

Format: record_goal_points ( explorer, {goal_info} )
Return Value: none
Arguments - explorer = player who scored some points, goal_info = information about how this goal was completed, in the form {"correct" or "incorrect", outcrop object number, guess object number"}
Purpose - change the value in the player's goal record in their history to give them points for achieving a goal
Called by - complete_goal
This replaces an old behavior. You need to search backwards through the history entries looking for the history entry {date, "goal", goal object number, 0} and replace it with the new {date, goal object number, points, "goal assigned"} syntax. Then you can add the fact that the player has completed the goal

select_goal

Overrides $g.goals:select_goal behavior
For the first goal, a player is given a random mineral that requires an instrument to positively identify it (an instrument must be listed in that mineral's test set)
For the second goal, a player is given a random mineral
For all subsequent goals, a player is given a random goal
No given goal will be in goal_stoplist

show_goal

See $g.goals:show_goal. Prints a goal message for the player
Might want to redo this function for code readability...

show_goal_points

See $g.goals:show_goal_points. This prints out showscore information on "goal assigned" and "correct" goal information and returns goal_points points for correct answers

start_goal

Format: start_goal ( explorer )
Return Value: none
Arguments - explorer = player who has started the goal
Purpose - Used to put in goal assigned message into the player's history when we started this goal
Called by - $g.goals:assign_goal

Return to Table of Contents

Secondary ID Goal Scoring Module (#1463)

Overview - This is the object that controls the secondary goal scoring in the rock/mineral identification game. This object only deals with scoring (show_goal_points and record_goal_points) because it will never be assigned as a primary goal. Any correctly identified outcrop is given 25 points for the first time it is identified.

Return to Table of Contents

Important Verbs:

record_goal_points

Format: record_goal_points ( explorer, sample_object_number, museum_object_number, points, "correct" or "incorrect" )
Return Value: none
Arguments - explorer - Person who needs goal points written, sample_object_number - the object number of the sample they got correct, museum_object_number - the object in the museum that this sample represents, points - number of points they received, "correct", "incorrect", or "correct again" - Whether they got the guess right or not.
Purpose - change the value in the player's goal record in their history to give them points for achieving a goal
Called by - $g.thing:report identify
There are three cases when this function is called. Either they got it correct and scored points, the got it correct but didn't score any points, or they didn't get it right
Could add checks to see if they are in the identification game before giving them points here

show_goal_points

Overrides $g.goals:show_goal_points behavior. Prints out information if a player correctly or incorrectly identified an outcrop

Return to Table of Contents

Interpretive Module (#1459)

Overview - This is the object that controls the interpretive module. Most of the work is done by the children of this object.

Return to Table of Contents

Important Verbs:

show_goal

See $g.goals:show_goal. Prints a goal message by simply printing out the goal_msg. This function is called calling child(this):show_goal, so that their particular goal_msg is printedr

Return to Table of Contents

Visit Interpretive Module Goal (#10984)

Overview - This is the first step in the Interpretive Module. Your goal is simply to go to the Interpretive Module Entry and have the Interpretive Module explained to you. You get a big fat 0 points on completion of this goal.

Return to Table of Contents

Important Verbs:

complete_goal

See $g.goals:complete_goal for a complete description. This function also sets the interpretive module in motion with the in_quiz_rooms variable on players.
Called by - $g.quiz_tutor:q_level_0

is_completed

See $g.goals:is_completed. This module returns 1 if there is a "Welcome" entry in explorer's history.tutor list. Otherwise, it returns 0.

record_goal_points

Format: record_goal_points ( explorer )
Return Value: none
Arguments - explorer = player who scored some points
Purpose - change the value in the player's goal record in their history to give them points for achieving this goal
Called by - complete_goal

show_goal_points

See $g.goals:show_goal_points. This prints out showscore information on the fact that they got an introduction to the interpretive module

Return to Table of Contents

Identify Outcrops Goal (#10996)

Overview - This is the second step in the Interpretive Module. Your goal is to go to the Interpretive Module and identify a set of outcrops, listed in $g.dike_im:first_goal_list. You are given 0 points on completion of this goal (but you still get 25 points for the secondary ID goal if you haven't identified the outcrops that are in the module.

Return to Table of Contents

Important Verbs:

complete_goal

See $g.goals:complete_goal for a complete description. This function doesn't necessarily complete the goal every time it is called It checks to see if you are all completed and runs show_goal if you are not.
Called by - $g.thing:report identify

is_completed

See $g.goals:is_completed. This module returns 1 if all the types of outcrops in $g.dike_im:first_goal_list have been identified (as outcrops in the Interpretive Module) Otherwise, it returns 0.
Called by: $g.dike_id_interp_goal:complete_goal (as well as those listed in $g.goals:is_completed)

show_goal

See $g.goals:show_goal. Prints a goal message for the player. This function adds the functionality of printing the outcrops that are left to identify in this goal

record_goal_points

Format: record_goal_points ( explorer )
Return Value: none
Arguments - explorer = player who scored some points
Purpose - change the value in the player's goal record in their history to give them points for achieving this goal
Called by - complete_goal

show_goal_points

See $g.goals:show_goal_points. This prints out showscore information on the fact that they found all necessary outcrops in the interpretive module

Return to Table of Contents

Hydrology Module (#1458)

Overview - This is the object that controls the hydrology module. Most of the work is done by the children of this object.

Return to Table of Contents

Important Verbs:

show_goal

See $g.goals:show_goal. Prints a goal message by simply printing out the goal_msg. This function is called calling child(this):show_goal, so that their particular goal_msg is printedr

Return to Table of Contents

Visit Hydrology Module Goal (#1448)

Overview - This is the first step in the Hydrology Module. Your goal is simply to go to the Earthquake Zone and have the Hydrology explained to you. You get a big fat 0 points on completion of this goal.

Return to Table of Contents

Important Verbs:

complete_goal

See $g.goals:complete_goal for a complete description.
Called by - $g.hydro_tutor:q_level_0

is_completed

See $g.goals:is_completed. This module returns 1 if there is any reference to this goal in the player's .history.goal list. Otherwise, it returns 0.

record_goal_points

Format: record_goal_points ( explorer )
Return Value: none
Arguments - explorer = player who scored some points
Purpose - change the value in the player's goal record in their history to give them points for achieving this goal
Called by - complete_goal

show_goal_points

See $g.goals:show_goal_points. This prints out showscore information on the fact that they got an introduction to the hydrology module

Return to Table of Contents

Scenarios

There are a number of different scenarios which occur in order to activate the goal structure. Here is the present list and the function calls necessary to achieve each scenario.

When a player creates a new character

  • $g.game_player:confunc ->
  • $g.goals:assign_goal
    • $g.goals:select_goal (Recursive)
      • child($g.goals):is_completed
      • child($g.goals):select_goal (May or may not be same code as $g.goals)
    • player.geology_goal:show_goal

When a player connects to the game

  • $g.game_player:confunc ->
  • $g.goals:assign_goal
    • player.geology_goal:show_goal

When a player completes a goal

  • player.geology_goal:complete_goal
    • player:geology_goal:record_goal_points
    • $g.goals:assign_goal
      • $g.goals:select_goal (Recursive)
        • child($g.goals):is_completed
        • child($g.goals):select_goal
      • player.geology_goal:show_goal

When a player wishes to print her goal message

  • player:showgoal
    • player.geology_goal:show_goal

When a player wishes to print their score (text version only, graphics is displayed in the status panel)

  • player:showscore
    • goal:show_goal_points
    • (OR) $g.old_goals:score_goals
    • (OR) $g.old_goals:score_endgame
    • (OR) $g.old_goals:score_guess
    • (OR) $g.old_goals:score_quiz

Note: show_goal calls $directive_gui_status in order to print the current goal and score to the graphical client in all cases where show_goal is shown above

Return to Table of Contents

How to build new modules:

Now to the really important stuff. How do I build a new module into the present goal structure? It's semi-complicated process, but not nearly as difficult as it once was. Here are the steps.
  1. Create a child of $g.goals which corresponds to the module
  2. Create children of (1) which correspond to each particular goal in the module
    • Make sure that goal.goal_object == goal
    • If this is the case, the name of the goal (to the GUI and the exploration tutor) will be the name of the goal
  3. Override select_goal behavior of $g.goals in (1) if desired
    • The default behavior of select_goal is to select goals in order of module_search_order
    • Put the children of (1) in module_search_order in the order that you want them completed
    • Set module_search_order in the children to {}
    • If you do want to override this functionality, return the object number of the goal that should be next in that module
  4. Override is_completed behavior of $g.goals
    • Return 1 if the module is completed, 0 if it is not
  5. Override show_goal behavior of $g.goals
    • Print the message you want the player to see.
    • The property goal_msg is provided for the purpose of storing a static goal message
  6. Override complete_goal behavior of $g.goals
    • This function is provided to be the function that is called when an event causes the end of a goal scenario
  7. Override record_goal_points behavior of $g.goals
    • Must include a call to $g.game_player:update_history as $g.game_player:update_history(explorer, "module", points {goal_info})
    • goal_info may be in any format you wish, but must contain at least one item, explorer, "module", and points are required.
    • goal_points is provided as a property to store the number of points this goal is worth, make sure the number is > 0 or the goal will not be stored
  8. Override show_goal_points behavior of $g.goals
    • In order to maintain format in showscore, call $g.old_goals:print_score_line to display the output of your goal
    • Make sure you return the number of points this history entry has
    • goal_info from record_goal_points == entry[4..$]
Return to Table of Contents
To do in this documentation:
  • Add subgoals and survey goals to Important Object Numbers section
  • Add most recent interpretive module goals and make sure the ones that are present are correct
Updated: January 17, 2003