MM2 Reference

PSDL Viewer

Screenshot Screenshot Screenshot

What is PSDL Viewer
What is a PSDL file
Project status
Requirements
Download
Disclaimer
Instruction on usage
Development issues
The author


What is the PSDL Viewer

The PSDL Viewer is a Java application that reads PSDL files and displays their contents.

Top

What is a PSDL file

A PSDL file is the file that contains the terrain map of a city in the Microsoft game "Midtown Madness II" made by Angel Studios. A PSDL file contains a list of vertices and a number of polygons. The file also include references to texture files.

See PSDLFormat for detailed information about the PSDL file format.

Top

Project status

This software is highly experimental, it is by no means to be considered a "released" product, though it might be some day. The main reason for making this software is to figure out the PSDL file format. Figuring this format out would enable development of useful products along the lines of import/export filters for serious 3D modelling tools like Realsoft 3D, 3D Studio Max, ZModeler etc. This in turn would enable the construction of new cities for Midtown Madness II.

Check the project history page for a time line of events regarding my research on the PSDL file format and development of the PSDL Viewer.

Top

Requirements

The software is developed using Java (J2SE 1.4) and Java3D 1.2. The software requires a compatible Java run time environment. Also some PSDL files and texture files are useful.

Top

Download

This program is deployed as a zip file containing a .jar file and an options file.

Download here.

Top

Disclaimer

Since this software is still highly experimental the author can under no circumstances be held responsible for any damage caused by this software. Anyone using it does so on their own risc.

Top

Instructions on usage

Installing the software

Download the zip file above and extract all files to a suitable folder.

Starting the program

Simply double click on the file named "Viewer.jar".

Alternatively you can use a command shell and move to the folder where the files are extracted. Type "java -jar Viewer" and hit enter. Note that "java" - the Java virtual machine must be in the path of the command shell. Also "." must be in the classpath. Installing J2SE 1.4 or JRE 1.4 from SUN will set up both of these things automatically.

Using the program

For a tutorial on basic terrain creation, go here.

When the program starts, a window is opened. In addition to this window a lot of trace print outs are printed in the command shell window. These print outs are purely debugging information - pay no attention to them unless you really want to.

The main window is divided in several parts, these are a city block list, vertex list, texture list and finally a 3D terrain view.

City block list

This is a list of all city blocks building up a terrain in a PSDL file. Selecting a city block in this list will display the properties of that block.

City block properties

To the right of the block list a list, displaying the vertices making up a perimeter polygon. This list also displays where other blocks connects to this one. This list is labelled Block perimeter. A dash instead of a block index means that the vertex does not connect to any other city block at this vertex.

Selecting one or more vertices in this list causes the corresponding vertices to be selected in the vertex list. This in turn will add small red markers in the terrain view.

Below the perimeter definition there is a list of block attributes. These attributes define the actual geometry and appearance of the city block.

Vertex list

This is a list of all vertices used to construct the terrain.

Selecting one or more vertices in this list will add a small red marker in the terrain view indication the location of these vertices.

Texture list

This is a list of all textures that can be assigned to city blocks. Selecting one or more textures will make them show up in the texture view.

Texture view

Displays textures side by side. The textures are displayed at their true size, no scaling is performed. Instead the view is scrollable if the textures don't fit the window. Some textures contain multiple scales of the same image. All of these scales are shown on top of each other.

Terrain view

The terrain view displays a 3D view of all city blocks. Currently this is restricted to simply displaying the perimeter of the blocks. The camera can be operated using the buttons next to the 3D view. The function of these buttons as well as their graphic imagery is the same as the view control window in Realsoft 3D - my favourite 3D modelling software.

From top to bottom, the functions are:

  • Rotate - Keeping the left mouse button pressed on this button and moving the mouse causes the camera to rotate around it's yaw and pitch axis.

  • Scale - Keeping the left mouse button pressed on this button and moving the mouse up or down changes the depth of field parameter of the camera, effectively scaling the view.

  • Pan - Keeping the left mouse button pressed on this button and moving the mouse moves the camera in it's image plane.

  • Distance - Keeping the left mouse button pressed on this button and moving the mouse up or down moves the camera along it's forward axis.

  • Front - Rotates the camera to a front view.

  • Side - Rotates the camera to a side view.

  • Top - Rotates the camera to a top view.

  • Origo - Moves the camera to the world origin. (0, 0, 0)

File menu

In the file menu the user can open a PSDL file, set the texture folder, import vertices, open the option dialog or exit the program. The texture folder is used by the texture view when loading the textures defined in the texture list. Note that the selected texture folder is only used when loading a PSDL file or adding new textures, once each texture is added the complete path to the image file is stored in each texture map.

View menu

The view menu has some choices that no longer works - the functionality they offered in the past will be re-implemented. DON'T USE THESE!

Top

Development issues

Java3D and Swing

The current implementation have some defects:

  • Java3D is "heavy weight". This means that the components of Java 3D occupy a private drawing area that cannot be shared by other components. javax.swing is "light weight". This means that swing components can share a drawing area making it easy to mix components in a window.

    PSDL Viewer tries to place a heavy weight Java 3D display component inside a swing window. Placing swing lightweight components all around it. An attempt has been made to accomodate the more flexible scaling and positioning of the swing components. This is done by placing the heavy weight component inside a class that inherits a basic swing component and manually passing along the swing resize and re-position calls to the heavy weight component. In theory this would work as long as you don't need a light weight component on top of the heavy weight component - this is not possible. Unfortunately something is wrong in this code and the heavy weight component does not scale and re-position correctly.

  • I would like to know how to make the mouse pointer wrap to the other side of the screen when moved to the edge of the screen while a camera control function is activated. This would allow for long continous camera manipulations. And that would make a big difference.

Top

The author

That would be me, my name is Fredrik Bergholtz, my handle on "Midtown Madness 2 Central" is "fre_ber". Please contact me there if there is something you need from me or if you want to help me with this project.