XSIGame

This example shows how to integrate a game render window and modtool into Softimage.

Features demonstrated in this example:

Example Files

Location
Files
XSIGameControlPanel2.js

XSIGameControlPanelUI.cpp
XSIGameControlPanelUI.h
XSIGameInterface.cpp
XSIGameInterface.h
XSIGameInterface.vcproj
XSIGameInterfaceUI.cpp
XSIGameInterfaceUI.h

CharacterOptimizer.cpp
CharacterOptimizer.h
CharacterOptimizer.vcproj

The Engine and Game folders contain the code for the actual game.

Running the Example

To run the example

  1. In viewport A, click the view name ("Top") to open the Views menu. In the Views menu, choose Custom Displays > XSIGameView.
  2. Click in viewport A to start the game.
  3. If you edit the track in viewport B, the changes are automatically applied in the game view.
  4. To orbit the camera in the game view, orbit the camera in the wireframe view of viewport B.

Building the Example

Softimage SDK includes a compiled version of XSIGame. If you modify the code, you can rebuild the game by following these instructions.

To build the example on Windows

  1. Download and install the required libraries:

  2. Open an Softimage command prompt.

    Opening an Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set.

  3. In the Softimage command prompt, set the XERCESC_INC_PATH, GLEXT_INC_PATH, GLEXT_LIB_PATH, and CG_INC_PATH environment variables .

    • For example, if you installed XERCES in the folder C:\xerces\bin, GLUT in the folder C:\Glut\gl, then set the GLEXT environment variables like this:

      set XERCESC_INC_PATH=C:\xerces\bin
      set GLEXT_INC_PATH=C:\Glut
      set GLEXT_LIB_PATH=C:\Glut\gl
      
    • The Cg installer may have already set CG_INC_PATH.
  4. Start devenv and load the project you want to build:

    • Engine\Engine.vcproj
    • Game\Game.vcproj
    • CDHInterface\XSIGameInterface.vcproj
    • CharacterOptimizer\CharacterOptimizer.vcproj
    • CGShaderHandler\CGShaderHandler.vcproj

    Tip To load a project from the command line, type the name of the project in the devenv command line. For example:

    devenv Engine\Engine.vcproj
  5. Compile a specific configuration (Release or Debug) of XSIGame using Visual Studio .NET.

Setting Up AlienBrain

To set up AlienBrain

  1. Install version 7.2 of the Alienbrain client and the Softimage integration.

  2. Use the subst drive H: for your local Alienbrain database.
  3. Add the XSIGame files to Alienbrain server.

    The idea is to put all the files (3D assets and code files) into alienbrain and base the asset management workflow on AlienBrain.

    • Create a Project called XSIGame on the Alienbrain server.
    • Add all files under XSISDK\examples\workgroup\Addons\XSIGame\ to the Alienbrain project.
  4. Set the XSIGame working path:
    • Start Softimage.
    • Open the control panel (XSIGame > Control Panel).
    • Set the Data Folder path to H:\XSIGame. Note that the data location is stored in a file called datalocation.txt located at the root folder of the example. The game engine is uses the content of this file to find the data files.
    • Now you can start manipulating the data using alienbrain within Softimage.

Keywords

This example uses the following keywords:

C++ example, ViewContext, PutUserData, GetUserData, Notify, CreateDialog, RegisterCustomDisplay, siEventID, GetNotificationData, AlienBrain, Custom Display Host