VR-Lab PS-ERT Primer - Scenario

written by pilardi 11/01
last updated by pilardi 12/01

Back to overview

What is a scenario?

The scenario is the heart of a PS-ERT program.  It contains all the characters, character properties, objects, lights, cameras, and environmental properties loaded in from scenario files (*.pss).  In this lab, we are only interested in the first two.  All of the others should be controlled through Performer.

The scenario is controlled through a scenario pointer of type psScenario.  See psScenario class below for how to obtain and use this pointer.

What is a scenario file?

Scenario files are text based files created by PeopleShop software.  PeopleShop only runs on NT based machines.  The documentation for PeopleShop is located in $BDI_PEOPLESHOP/doc/PeopleShop_15_User_Manual.pdf or here.

In PS-ERT version 1.5, characters can only be loaded into the scenario through scenario files, though this may change in the future (see create_character in the scenario part).  It is fairly easy to create a simple scenario file by hand.  The following scenario file is a minimal file containing two characters:

scenario the_scenario
          version = 1.5.20
          appearance_filename = peopleshop/appearances.psi
  
  scenario_character bob
          character_type = male_pedestrian
  
  scenario_character alan
          character_type = suspect2
          appearance = alan_exface_no_gun
See the character part of the primer to understand what the parts of the character mean.

A scenario file can be much more elaborate that this, containing preset character paths and actions, camera angles, lights, objects, environments, etc.  For greater flexability, I suggest using a minimal scenario files and controlling everything through calls to PS-ERT and Performer.  Although if you would like an environment with a large number of characters doing non-interactive behaviours, using PeopleShop to create the scenario file might be the best idea.

psScenario class

Link to official doc.

psScenario is a C++ class containing general PS-ERT functions.  This pointer can be access using the PSERT::sp() in psert_util.  Otherwise, if you are not using that class the psScenario pointer is returned by the call to peopleshop_create_scenario().

All methods return 0 on success and -1 on failure, unless otherwise specified.

Important methods

(in the order they are likely to be called)

Unused methods and reasons why