WildTangent Game Library

Home
Introduction
Tips and Techniques
Projects
Libraries
Links

Library

Tested with Functional Developer 2.0.

wild-tangent-libraries.zip (approx. 23KB).
wild-tangent-example1.zip (approx 983KB).
wild-tangent-example2.zip (approx 10KB).
Screenshot of Example 1 (approx. 46KB)
Screenshot of Example 2 (approx. 5KB)

Requirements

The following must be installed on your machine to use the Dylan libraries above. More details are in the overview section below.

Overview

WildTangent is a set of libraries that allow easy development of 3D games. They provide a number of features, including web-based 3D games. More information is available at the WildTangent web site.

The Dylan interface to WildTangent that I provide here is specifically for their Game Driver SDK Beta. This can be downloaded from their download page, and is approximately 19MB. You must install this SDK to be able to use these Dylan libraries. It is possible to have a Dylan interface to their non-beta SDK (WebDriver) but the Game SDK beta has some very nice features I wanted to try. It should be trivial to modify this library if you want to use the non-beta version.

To use these Dylan libraries you'll need the latest version of the ATL runtime library (113KB) available at the microsoft site. Unzip the file and run the self installing executable to install it.

The <wild-tangent-gadget> uses the same technique as the simple web browser example to host the WildTangent ActiveX control.

WildTangent provides a couple of ways of using their library. One is an ActiveX control. The other is a set of C and C++ libraries for low level control. This project uses the ActiveX control. I'll be exploring using the more low level C and C++ libraries in the future. Unfortunately I could not find any documentation for these so I haven't looked at it yet.

Usage

There are two Dylan libraries contained within the wild-tangent-libraries.zip file.

wild-tangent-webdriver was generated from the WildTangent type library automatically by the Dylan type library support. It contains the COM interfaces for all the WildTangent classes and routines.

wild-tangent-gadget provides a <wild-tangent-gadget> class which can be used in DUIM for displaying WildTangent objects. The gadget has a single method for obtaining the root COM object for using WildTangent. To be able to use the gadget, your program must first call the wild-tangent-initialize method. When you are finished with the library you should call wild-tangent-unintialize. See the example programs for how to do this.

wild-tangent-example1.zip demonstrates how to use wild-tangent-gadget with files generated using WTStudio. WTStudio is a tool supplied by WildTangent for creating the 3D world. The example is so large because I include one of the example generated worlds. This example is the same as the 'camfly' example provided with the WildTangent SDK. It displays a world and flys around it.

wild-tangent-example2.zip demonstrates how to programatically create a 3D scene. It is functionally equivalent to the initial example given in the WildTangent online help. It displays a spinning coloured cube.

To create a gadget in a frame you can use code like:

define frame <example-frame> (<simple-frame>) 
  pane wild-tangent-pane (frame) 
    make(<wild-tangent-gadget>); 

  pane go-button (frame) 
    make(<push-button>, 
      label: "Go", 
      activate-callback: on-go-button); 

  layout (frame) 
    vertically() 
      frame.go-button; 
      frame.wild-tangent-pane; 
    end; 

  keyword title: = "Wild Tangent Example"; 
end frame <example-frame> 

To do something with the gadget you need to get a pointer to the root COM interace, <IWT>:

define method on-go-button(g) 
  let frame = g.sheet-frame;
  let wt-gadget = frame.wild-tangent-pane;

  let-com-interface scene :: <IWT> = wt-gadget.wild-tangent-interface;
  // Call other WildTangent COM routines here...
  IWT/start(scene);
end method on-go-buton; 

See the example programs for more details. Note that all the COM methods are prefixed with the name of the class (eg. IWT/start). This is the standard for the code generated by the Functional Developer type library support. Keep this in mind when using the WildTangent SDK help.

By default the Functional Developer IDE will enter the debugger when a program generates a floating point underflow or overflow exception. For some reason the WildTangent control generates these exceptions occasionally. The wild-tangent-example2.zip I provide does this. To run this in the IDE you'll need to set the debugger to ignore these exceptions.

This can be done by choosing Application/Debug from the project menu. In the debugger, choose View/Debugger Options. In the exceptions tab of the resulting dialog, change 'Float overflow' and 'Float underflow' to be 'Report' or 'Ignore'. The program can then be run from the IDE as normal.

More work needs to be done to make the libraries easier to use from Dylan but in its current state it's fun to play with making games using Dylan.


Copyright © 2000, Chris ^M Double. All Rights Reserved.
^M All products and brand names are the registered trademarks or trademarks ^M of their respective owners.

^M