Return

LAV_Coyote25 İRevised: April 08, 2006



 

System Requirements:

PIE Slicer DX loads, edits, and renders 3-D object data in Warzone 2100's native "PIE" format.
Programmed by Strata Drake stratadrake@hotmail.com

 

PIE Slicer   -   Original read me file for pie slicer ( before DX )

See also:  pie slicer guide # 1 by Dancing Moogle     

 Pie slicer guide # 2 by Dancing Moogle

DancingMoogle Mod Guide - how to compile a mod including your new pie files:

see also  - Advanced Utility Section here:  Assembling .WDG files - NEW ITEM

 


 

PIE Slicer was developed in a Windows 98 SE environment with Visual Basic 6 SP5.  It should operate fine under Windows 2000 or Windows ME, as long as Service Pack 1 is installed.  However, Pie Slicer may experience some problems in a Windows XP environment, and there are some known problems with running Warzone 2100 itself on Windows XP.

If there are any OS-related problems with PIE Slicer, contact the gurus at pumpkin-2 - forums .

You need the Visual Basic 6.0 Runtime DLL.  This may be found at various websites like www.completelyfreesoftware.com .

You also need to have DirectX 7.0 or higher installed on your system.

old instructions may not be relevant: [And furthermore, will need to install the "Required System OCX Files" can be found here under downloads area - utilities - grab everything under "P" "R" "V" section letters found here :  (unavailable at this time) www.pumpkin-2.co.uk/download.htm]

Go here instead :      http://www.angelfire.com/falcon/stratadrake/utils/     - for the latest versions 

and for the  programmers sake READ!  the damn  "readme" or whatever documentation there is !

 

*Note:  WZCK2.0 users may skip this step.

Obviously, you will need Warzone 2100 installed on your system for Pie Slicer to be of any real use.  You do not "need" to have WZCK and/or WDG Explorer installed, but they are highly recommended as well--you'll want WDG Explorer to extract PIE graphics from Warzone 2100's game data, and WZCK to easily compile your own graphics into your Warzone mods.

NOTE: Finally, you will want a desktop size of 800x600 or larger operating at 16-bit color or higher.

PIE Slicer *will* run in 640x480 and even 256-color desktops, but doing so is strongly NOT recommended!

 

How to Install PIE Slicer:

 

I highly recommended that you create a new directory exclusively for PIE Slicer.  Simply un-pack the Zip file's contents into that directory,  ensuring that your unpacker's "Use path names" (or equivalent) option is enabled.

 

The following additional files are included in the ZIP:

 

PIE Slicer DX. exe - Required.  The main application.  You can place this anywhere you want, but bear in mind that PIE Slicer can only load bare PIE files; it cannot extract them from WDG's.  Thus, installing WDG Explorer and extracting the PIE files from Warzone.wdg yourself is a good idea!

Master.dtb - Required.  This file is required.

page(##).bmp - These files contain the default WZ textures.

Readme-PIE Slicer DX. rtf - You are reading this file right now, aren't you?  Good.

Config.dtb - This file is created and managed automatically by PIE Slicer.



 

Getting Started:

 

To start PIE Slicer, double-click its file icon its directory in the Windows Explorer.  You can also create a shortcut link to PIE Slicer by right-clicking on the EXE and choosing the "Create Shortcut" option from the pop-up menu.  Creating a shortcut to PIE Slicer will save you a lot of trouble should you later forget where you installed it, and you can place Shortcuts anywhere on your computer except the main portion of the Windows Taskbar--common locations include the Start Menu (or its associated folders), your Desktop, and the leftmost pane of the Taskbar.  PIE Slicer takes but a moment to fully load, and then you can begin working on your polymodel.

 

What is a Polymodel?:

 

Warzone graphics are stored in a "PIE" format.  Each and every PIE file contains a "polygon model"--polymodel for short--that describes the shape, size, colors, etc. of the Warzone 3D graphic.  (Warzone 2D graphics, such as menu icons, are stored in a different format)  Polymodels come in six parts:

 

 

 

 

 

 

Reference - Menu Commands:

 

File Menu:

New Model                            *  Erases the current workspace, allowing you to begin a new model from scratch.

Load Model…                       *  Loads a Warzone graphic (PIE file) or PIE Slicer graphic (CAK file) from disk for editing.  There are currently two different PIE filters available.  The primary filter is quicker, while the alternate filter is slower and more stable.  Should a PIE file refuse to load properly, try both filters before seeking technical assistance.

Save Model                            *  Ctrl+Q.  Saves the current polymodel to disk as a Warzone PIE file or a PIE Slicer "CAK" file.  The main difference between PIE and CAK files is the preservation of precise coordinate data; point coordinates are rounded to the nearest 0.1 PIE Slicer unit when saving into a PIE, but not when saving CAK.

Save Model As…                 *  Similar to the above command; however, this command prompts you for a file-name before it actually saves any data.

------------

(Recent Files)                       *  This is a list of all the Pie files that you have recently saved to disk or loaded from disk, and you may select one to quickly load it for editing.  This list may be anywhere from one to nine entries long, and you may specify the maximum size in the Options/Configuration menu.

------------

Exit                                         *  Return to Windows.

 

Edit Menu:

Copy Selection                           *  Ctrl+C.  Copies all of your model's selected points and polygons into PIE Slicer's clipboard.

Paste > Points                            *  Inserts the point content of Pie Slicer's clipboard into your model.

Paste > Polygons                       *  Inserts polygons from Pie Slicer's clipboard into your model.

Delete > Points                          *  Ctrl+Delete.  Erases all of the selected points which are not used by any polygons.

Delete > Polygons                     *  Shift+Ctrl+Del.  Erases all selected polygons in your model.  Use with utmost care--this operation cannot be undone!

 

 

View Menu:

Front View                            *  F5.  Displays your model as it would appear if viewed from behind.

Top View                               *  F6.  Displays your model from the top, with "up" representing forward.

Side View                              *  F7.  Displays your model from the right-hand side, with "right" representing forward.

3D View                                 *  F8.  Displays your model from any viewing angle you want.  Use the arrow keys to rotate the viewing angle.

Rendered View                     *  Shift+F8.  Renders your PIE file the way it will appear in Warzone 2100.

------------

Points > Show All                *  Displays all points and connectors in the current submodel and makes them available for selection.

Points > Hide Selected       *  Hides all currently-selected points from the display (connectors cannot be hidden).  If you are making a complex model, this function can un-clutter the display and speed up PIE Slicer.  However, hidden points cannot be edited unless they are made visible again, either by double-clicking their entry in the Points data box, right-clicking on their entry and selecting the "Show this point" option, or by using the "Show All" menu command, above.


 

Polygons > Show All           *  Displays all polygons in the current submodel and makes them available for selection.

Polygons > Hide Selected  *  Hides all currently-selected polygons, uncluttering the display.  However, as with points, hidden polygons must be made visible again before they can be edited.  To make a hidden polygon visible again, either double-click it from the Polygons data box, right-click its entry and select "Show this polygon", or use the "Show All" menu command.

Polygons > Cull Face          *  F9.  Hides all polygons on the "other side" of your model, un-cluttering the display and giving you a better impression of your model's shape.  This function is also useful for debugging normal vectors and making polygons face in their proper directions.

------------

Editing Grid                          *  F3.  Toggles the editing grid on and off.

WZ Grid                                *  F4.  Toggles the Warzone scale grid on and off.  The distance between solid line and dotted line corresponds to 1/2 of a WZ map square; the distance between two solid lines (or two dotted lines) represents one full map square.

 

                                                    This peculiar setup of the Warzone grid is needed because of the way WZ places structures on a map.  For "even-dimensioned" structures (i.e. 2x2 buildings, like the power generator), the solid lines represent intersections between map squares; for "odd-dimensioned" structures (i.e., 1x1 or 3x3 buildings, like tank/VTOL factories and defenses), the dotted lines represent intersections between map squares.

 

Submodels > Hide Other    *  Displays the current submodel in your polymodel and hides any/all others.  Since most Warzone polymodels will have just one submodel, this command is automatically enabled when you start PIE Slicer.  Some animated Warzone PIE files, such as "cybd_run.pie" (animated cyborg legs) display correctly only when viewed one submodel at a time.

Submodels > Show All        *  Displays all submodels in the polymodel.  Because only one submodel can be edited at any time, all "other" submodels will display in a darkened color.  Some animated Warzone PIE files such as "blderik.pie" (Oil Derrick structure) display best with this option enabled.

 

Points Menu:

Add Point > Origin                   *  Ins.  Adds a new point to the model (centered at the origin).

Add Point > Offset…                *  Alt+Ins.  Adds a new point to the model, offset from the Current Point / Connector.

Add Point > Center…               *  Shift+Alt+Ins.  Adds a new point to the model, placed at the center of all selected points.

Remove Current Point             *  Del.  Erases the Current Point (the point highlighted by a pink circle) if it is not attached to any polygons.

------------

Add Connector > Origin          *  Adds a connector point to the model, centered at the origin.

Add Connector > Offset…       *  Adds a connector point to the model, offset from the Current Point / Connector.

Add Connector > Center…      *  Adds a connector point to the model, placed at the center of all selected points.

 

Remove Connector                    *  Del.  Erases a connector-point from your model.

------------

Select > Current Point             *  V.  Selects or de-selects whichever point or connector you most recently clicked on.  When selected, points will highlight blue and they can be moved, scaled, or rotated.

Select > Current Poly's…       *  Ctrl+V.  Selects / de-selects all points that belong to the Current Polygon in your model, even if they are hidden from view.  This function is very useful if you wish to move, scale, or rotate individual polygons.

Select > Selected Poly's…      *  Shift+Ctrl+V.  Selects / de-selects all points that belong to any selected polygons, including those that may be hidden from view.

Select > All Points                    *  Shift+V.  Selects / de-selects all points and connectors in your model, except those that may be hidden from view.


 

------------

Attach Nearby Points               *  Searches your model to see if any extra points exist at the same coordinates as the Current Point.  If so, those points will be merged, un-cluttering your model and making that point easier to click on.  This will also attach any polygons that had used the duplicate points.

Polygons Menu:

Create Simple Polygon          *  Adds a standard triangle, square, etc., to your model, which will be centered about the Current Point and made the Current Polygon.

Create Simple > 2-Sided        *  Determines whether polygons created with the above function will be 2-sided or one-sided.

Create Simple > Orientation    *      Determines the orientation of polygons created with the above function.  You can orient such polygons along the front, top, or side planes, or orient them to face the current viewing angle (even in the 3D View).

Create Simple > Show Pts     *  When activated, PIE Slicer will display the model coordinates of the polygons you create with this command.

 

Create New Polygon               *  Shift+Ins.  Creates a new polygon using the selected points, and makes it the Current Polygon.  The Current Polygon is identifiable by its blue/green highlight, a red normal vector, and point index numbers displayed at each vertex.

Draw Polygon From Pts.        *  Ctrl+Ins.  Allows the user to draw a polygon via an interactive, "connect-the-dots" interface.  Highly recommended, as this avoids Pie Slicer's inability to properly sort a 5- (or more) sided polygon.

 

Delete Current Polygon         *  Shift+Del.  Erases the Current Polygon.

------------

Re-Order 4 sided…                *  Ctrl+R.  Re-arranges the point order (shape) of the Current Polygon, but only if it is a quadrilateral.  If it has five or more points, you will need to adjust their order using the Point Order mode.

Flip Normal                              *  Ctrl+F.  Flips a polygon's normal vector, making it face the other direction.

------------

Select > Current Poly            *  N.  Selects or de-selects the Current Polygon (whichever polygon you most recently right-clicked on) so that its data can be edited or copied.

Select > Current Point's…   *  Ctrl+N.  Selects / de-selects all polygons that use the Current Point, including any polygons hidden from view.

Select > Selected Points'…   *  Shift+Ctrl+N.  Selects / de-selects all polygons that use any selected points, including any polygons hidden from view.

Select > All Polygons             *  Shift+N.  Selects / de-selects all visible polygons in your model.

------------

Export Shape…                        *  Not Yet Implemented.

Import Shape…                        *  Not Yet Implemented.

------------

 

Vertices Menu:

 

Move Vertex…                         *  Arbitrarily moves one of the Current Polygon's vertices to any desired point in your model.

Detach Vertex…                      *  Detaches one of the Current Polygon's vertices from all other points (and polygons) in your model, by assigning it to a newly-created point.  You can then move that vertex without affecting other polygons.


 

------------

Add Vertex To Poly                 *  Inserts a point in the Current Polygon, along one of its sides.  You can then move the new point to "bend" that edge.  If you hold Shift during this operation, you can add two points at once, dividing that polygon's side into thirds rather than halves.

Remove Vertex From Poly     *  Removes any point from the Current Polygon, simplifying it.  You will however lose a little bit of texture information in the process.

------------

Fracture Current Polygon    *  Creates a center-point for the Current Polygon and "fractures" it into a collection of smaller triangles encircling that point.  Refer back to Step Two for an example (i.e., square >> pyramid) of this function.

Slice Current Polygon           *  Splits the Current Polygon along a line defined between two of its corners.  The Current Point will be used as the starting point for this line.  Triangles, however, cannot be split.

Join Polygons                          *  Fuses two adjacent polygons together along one common edge.  However, some texture data may be lost in this fusion.  If two polygons do share a common edge but cannot be fused, you may need to adjust their normal vectors so that both normal vectors face the same (or similar) directions.

 

 

 

 

Non-Menu Keyboard Shortcuts / Commands:

 

There are several more keyboard shortcut keys available that are not included in the menus.  Here they are:

 

 

Viewing Commands

 

Move View (2D)        - Arrow keys.  Each 2D view can be shifted individually of the others.

                                    - Click on the Move View toolbar buttons immediately left of the display.

 

Center View (2D)    - End.  This will center the graph-paper view about the origin (0,0,0).  Very helpful should you get lost somewhere in your model.

                                    - Click on the Center View toolbar button immediately left of the display.

 

Rotate View (3D)     - Arrow keys

                                    - Click on the Rotate View toolbar buttons immediately left of the display

 

Zoom In/Out             - Plus / Minus keys on keyboard.

                                    - Page Up and Page Down will also work.

                                    - Click on the Zoom In/Out toolbar buttons immediately left of the display

 

 

Non-Menu Editing Commands

 

Pick Point                 - Left-click on any visible point.  If several points exist at identical coordinates, you can flip through them by clicking again.

                                    - Left-click a point's entry in the Points data box (even if it is hidden from view)

 

Pick Connector       - Left-click on any connector

                                    - Left-click a connector's entry in the Points data box. Connectors have a "C" designation next to their index number.

 


 

Pick Polygon            - Right-click in the center of any visible polygon

                                    - Left-click a polygon's entry in the Polygons data box (even if it is hidden)

 

Flip Polygon             - Pick a polygon, then press CTRL+F

 

 

Note:  Please ensure that NumLock is enabled when using the following  functions.

Adjust Move Rate  -   Numeric Asterisk / Slash.  This will automatically increment or decrement the Point Move Rate by one step, affecting how far points are moved in a single press.

 

Move Points (2D)   -   Numeric keypad arrows.  Right/Left/Up/Down will move the points horizontally or vertically along the graph paper.  Plus / Minus keys on the numeric keypad will move points "in" or "out" of the graph paper.

 

Move Points (3D)   -   With New Key Orientation enabled, orient the viewing angle (somewhat) orthagonally, and points will move relative to their on-screen direction.

                                  -   Without New Key Orientation, keys will function as they do in Top View.

 

Move Polygons       -   Ctrl + Numeric keypad arrows.  This will move all the selected polygons in your model (without requiring you to select their points first).  It follows the same conventions as moving points.

 

Move Texture Pt    -   In the Texture Alignment View, Left-click on a vertex and drag it to a new location.

 

Move Texture Poly    -         In the Texture Alignment View, Shift + Left-click on any vertex and drag it to a new location.

 

Scroll Texture       -   In the Texture Alignment View, Right-click and drag the mouse to a new location.

 

Auto Tex Map         -   In the Texture Alignment Toolbox, click on the Automap This Polygon button. to skin the polygon based on the current camera angle.

 

Reset Tex Align     -   In the Texture Alignment Toolbox (manual mode), click on the Reset Texture Alignment button.

 

 

Other Selection Commands

 

Quick Select All Points   - C.  Similar to Shift+V, this will select or de-select all visible points and connectors.

 

Quick Select All Polys    - B.  Similar to Shift+N, this will select or de-select all visible polygons.

 

Select Points (area)  - Left-click and drag along the grid.  All visible points contained within that area will become selected.

 

Select Polys (area)    - Right-click and drag along the grid.  All visible polygons centered within that area will become selected.

 

 


 

 

Development History:

 

This section contains the development history for Pie Slicer DX.  Previous development information is available in the readme file for previous Pie Slicer versions.

 

Version 1.06.074 DX, 7-2-2002

New           

Revised              Worked almost exclusively on Direct3D issues.  Removed a piece of old code that was causing edge-blending to malfunction on some 3D cards (namely, mine).

Bug Alert          Don't rest yet, there are still many bugs left out there!

 

Version 1.06.072 DX, 6-27-2002

New                    Team-colors may now be iterated manually in addition to automatic cycling.  There is an occasional bug in the team-colors algorithm (see tailfin of WZ tank transport for an example) but most PIE files will animate properly.

                            Filtered textures may be toggled on and off as well.

                            The WZ grid now shows in the wireframe 3D view.

Revised              Fixed a few more Direct3D issues such as the color black and clipping (some large PIE models were being clipped around the edges).

                            Cleaned up a few textbox error messages, and took a stab in the dark for fixing the Imagelist error.

Bug Alert          Pie Slicer's framerate when rendering seems to have dropped.  Not a big issue, it just doesn't feel as smooth anymore.

 

Version 1.06.071 DX, 6-25-2002

New           

Revised              Fixed a Direct3D error which was preventing Pie Slicer DX from properly texturing a model on most systems (including mine).

Bug Alert          "Imagelist must be initialized..." error message occuring mostly on XP systems.

 

Version 1.06.070 DX, 6-24-2002

New                    Time to go Public Beta and show the community the full power of Pie Slicer!

                            There are two grid options now -- one can be scaled to any size interval, the other one shows things in WZ scale.

                            Pie Slicer's movement rate can now be configured for binary adjustments.

Revised              Working on some more speed improvements.

                            Fixed an internal error happening on the Options/Configuration screen.

Bug Alert          Still puzzling over some alpha-blending and texture filtering issues.  Until a resolution is found, Pie Slicer textures will not be filtered the way Warzone textures are.

 

Version 1.06.066 DX, 5-20-2002

New                    Finished splitting up the Pie Slicer windows, now to organize the menu system....

Revised              Fixed the copy/paste functions.

                            Finally figured out how to set up an orthogonal view for the DX rendering, the wireframe and rendered views match now.

Bug Alert          The "Save Changes?" question box appears more often than it should be, I'll fix this later.


 

Version 1.06.065 DX, 4-23-2002

New                    Split Pie Slicer's window into several smaller windows, this eliminates a number of old-code hassles but will take awhile to get working properly.

Revised              Found and trapped another (but rarer) DirectX error.

                            Removed a number of old functions to further improve Pie Slicer's operating speed and efficiency.

                            When viewing the rendered PIE file, you may change the texture page and the rendered view will update accordingly.

                            Placed the rendering camera at a better location to alleviate z-buffer and zoom issues on my end.

Bug Alert          The current vertex still does not display properly on the Textures grid.

 

 

Version 1.06.060 DX (initial):

Revised              Cleaned up the DirectX routines to implement two-sided polygons, team colors, and the transparency color (green).

                            Pie Slicer runs much more efficiently now, thanks being to a large number of small revisions in the code.

                            Added a keywords system to help Pie Slicer locate the correct default texturepage when you type it in.  I.e., if you specify "page-6-urban features" for your model, Pie Slicer will automatically load the default texture for page #6, urban version.

                            Fixed the keymappings, and various other crashes and bugs when editing points and polygons.

 

PIE File Specifications

 

This document is provided to give the user a better understanding of Warzone2100 graphics models ("PIE" files) .  If PIE Slicer fails to properly load a particular PIE file, this "better understanding" of the PIE format may allow the user to fix the PIE file themselves.

 

 

 

File Header

  Because files can be given any extension the user desires, Windows cannot rely on those extensions to determine what type of file you are looking at.  Therefore, all important files have a "header" at their beginning that designates what data they really contain.  A PIE file is designated by the following two-line header:

    PIE 2

    TYPE 200

All Warzone2100 PIE files have this header at their beginning.

 

 

Texture Definition

 

The third line in a PIE file describes what texture page the model will use.  The data line looks like this:

    TEXTURE 0 page-##.pcx 256 256

 

page-##.pcx      *  This is the filename of the model's texture page.  Although most default PIE files use long filenames like "page-9-player hard buildings bases.pcx", the only detail that Warzone looks for is the "page-##" prefix in the filename.  The specified page ## must have been loaded in "VidMem.wrf" (all three) and/or "Frontend.wrf", or Warzone will crash with the message "texture not in resources: page-##".  Therefore, the following examples all have the same effect in Warzone:

page-23-fx`s-hard.pcx

page-23-fx`s-soft.pcx

page-23.pcx


 

The two numbers, "256 256" have no effect.  It is hard-wired that WZ2100 textures be of 256x256 size.  If you supply a larger texture (i.e., 512x512), WZ2100 will internally shrink the texture into a 256x256 size.  The reverse, however, is not true.  I.e., If you supply a 128x128 sized texture, it will NOT be scaled up to a 256x256 size; it will merely take up a 128x128 portion of a 256x256 texture page.

 

 

The exact texture PCX that Warzone2100 uses depends on which corresponding page ## was specified in the particular video-memory WRF, and whether Warzone is running in hardware-accelerated or software-rendering modes:

- The texpage specified by "Frontend.wrf" will be used when viewing your model in the Structure Limits / Force Editor Screens.

- The texpage specified by "VidMem.wrf" will be used for all Arizona Desert maps.

- The texpage specified by "VidMem2.wrf" will be used for all Urban Sector maps.

- The texpage specified by "VidMem2.wrf" will be used for all Mountain Sector maps.

- If you examine the video-memory WRF's, you'll notice that some texture PCX's have soft or hard included in their name.  Soft indicates a texpage usable only with software rendering, while hard indicates a texpage usable only with hardware acceleration.  If neither flag is supplied, then the specified texture PCX will be available for either.  This is the only occasion where two different texture PCX's can have the same page number.  Otherwise, only the first PCX (of each page number) loaded by the particular WRF will be used to texture your model.  And finally, Warzone can reserve only enough video memory for 21 pages of textures.

 

Submodel Definition

 

PIE files are divided into submodels, or levels.  Submodels are used for animation purposes.  However, this animation

is hard-coded into Warzone--some PIE files can be animated, others simply can not.  Therefore, most Warzone models contain only one submodel.  A PIE file's submodel-definition lines look like this:

    LEVELS n-models

    LEVEL 1

      .

      . data for submodel 1:  points, polygons, connectors, BSP data...

      .

    LEVEL 2

      .

      . data for submodel 2: its points/polygons/connectors/BSP data...

      .

    LEVEL 3

      .

      .  and etc. until each submodel has been specified.

      .

 

n-models    *  This is the number of submodels contained in the PIE model; it also indicates how many "Level ##" lines you'll need to include.  If your Warzone model contains only one submodel (which it generally should), then the only lines you'll need to worry about are the first two--"Levels 1" to indicate one submodel and "Level 1" to specify the model data.

 

 

Submodel Data -- Points

 

Points are the basic building blocks of a PIE model.  A submodel's point structure looks like this:

    POINTS n-points

      x y z

      x y z

      x y z

       . . . and etc. until all points have been specified.


 

n-points     *  This indicates how many points are contained in the PIE's submodel and determines how many point coordinates need to be supplied.  Each individual point is assigned an index number (starting at zero) that will be used to reference it in the polygon definition.  The first set of x-y-z coordinates indicates point #0, the second set indicates point #1, the fifth indicates point #4, and so on.

x                  *  The X coordinate indicates horizontal position.  Positive x values correspond to the left-hand side of your model, and negative values correspond to the right-hand side of your model.

y                  *  The Y coordinate is indicates vertical position.  Positive means up, negative means down.

z                  *  The Z coordinate indicates front-back position.  Positive z values point backwards, negative values point forwards.

 

Example -- Points Data Block

This is the point structure of the large HQ sensor dish model in MiSensor.Pie , with 36 points and 36 sets of coordinates:

POINTS 36

    0    31  -3

    -23 59  -14

    0    69  -11

    -33 36  -20

    -23 13  -26

    0    3    -29

    0    31  -3

    23  59  -14

    33  36  -20

    0    69  -11

    23  13  -26

    0    3    -29

    -23 59  -14

    0    32  -6

    0    69  -11

    -33 36  -20

    -23 13  -26

    0    3    -29

    3    59  -14

    0    32  -6

    33  36  -20

    0    69  -11

    23  13  -26

    0    3    -29

    -15 0    18

    -15 0    -17

    -9   33  0

    15  0    18

    9    33  0

    15  0    -17

    -15 0    18

    -9   33  0

    9    33  0

    15  0    18

    -15 0    -17

    15  0    -17

Do you see the points I highlighted in blue?  An interesting anomaly regarding many Warzone2100 PIE models is that they often have duplicate points--points with different index numbers but with identical coordinates.  This happens partly because Pumpkin Studios used 3D Studio Max to create Warzone2100's models; 3D Studio Max handles polygon data somewhat differently than Warzone2100 and PIE Slicer.


 

 

 

Submodel Data -- Polygons

Polygons are the visible portions of a PIE model; they are the squares, triangles, and other flat sides that are strung together to make an object visible in Warzone gameplay.  A polygon data block is complex, so I'll describe it one step at a time.  The overall polygon data block looks like this:

    POLYGONS n-polys

      (type) (pt-data) (anim-data) (tex-data)

      (type) (pt-data) (anim-data) (tex-data)

      (type) (pt-data) (anim-data) (tex-data)

       . . . and etc. until all polygons have been specified.

 

type            *  This is a 3-, 4-, or 5- digit hexadecimal number that indicates the polygon's properties.  This number is the sum of the following flags.  Remember that this is a hexadecimal system, so A=10, B=11, C=12, D=13, E=14, and F=15 .  Required flags are shown in red; known supported flags are shown in blue:

                            +100      Flat.  Unfortunately, this flag is not supported by Warzone and, if specified, may cause it to crash.

                            +200      Textured.  Every polygon needs a type 200 component.

                            +400      Wire Frame (PSX only?).  This flag is not supported by Warzone either, and if supplied, may cause Warzone to crash.

                            +800      No Filter.  Polygons with this flag will not use "bilinear filtering" (blurring), and as such their textures may pixelate if magnified.

                            +1000    Gouraud Shading.  This is the effect that Warzone uses to highlight and darken the hillsides on the world map.  I don't know if this is supported in WZ2100, but if so, polygons will be eligible for this lighting effect as well.

                            +2000    Two Sided.  Most polygons are visible only from one side.  However, if this flag is specified, the polygon will be visible from both sides.  Two-sided polygons are less troublesome, but slightly more time-consuming in Warzone.

                            +4000    Animated / Team-Colors.  Polygons with this flag will have different textures/colors for each player, or if you are making an explosion GFX model, the polygon will animate.  Animated polygons have 4 additional parameters in their texdata block.

                            +8000    Fixed View.  Use unknown--I have no idea whether Warzone's engine supports it or not.

                            +10000  BSP data.  If specified, then the polygon will use the data supplied in the BSP data block (explained later).  PIE Slicer does not support this flag, nor does the PC version of WZ2100 use the BSP data.

 

pt-data       *  This identifies which points are used to construct the polygon.  The pt-data segment looks like this:

             n-pts  pt-1  pt-2  pt-3 (etc.)

                        N-pts indicates how many points are used to construct the polygon, and each successive parameter indicates a point index value.  Remember that a point index of zero corresponds to the first x-y-z coordinate specified in the POINTS data; point-index 1 indicates the second point, point-index 3 indicates the fourth, etc... 

anim-data   *  Type 4000 polygons only (otherwise, skip to the tex-data segment).  Animated / team-colored polygons have four additional parameters between the pt-data segment and the tex-data segment.  This indicates animation data, and has the following structure:

             num-frames  1  size-x  size-y

 

                                    num-frames   *  This indicates the ## of animation frames.  For team-colored (non-explosion) polygons, specify 8.

                                    size-x              *  This indicates the horizontal dimension of each frame.  The polygon's texture alignment data will be shifted right by this amount for each frame.

                                    size-y              *  This indicates the vertical dimension of each frame.  Each time the texture alignment data "wraps" around the edge of the texture PCX, that alignment data will be shifted downwards by this amount.


 

 

tex-data      *  This identifies the texture alignment data for the polygon.  There are twice as many parameters as was specified by "n-pts" in the pt-data segment.  I.e., a triangle has 6 tex-data parameters, a square has 8, & a pentagon has 10.

             tex1-x  tex1-y  tex2-x  tex2-y  tex3-x  tex3-y (etc.)

                        Each pair of coordinates indicates a coordinate in the texture PCX.  Interestingly, although a texture PCX may be of any dimensions (as long as each dimension is a power of 2) , the texture coordinates are always in the range 0 thru 256 !  For example, texture point (10,10) , if projected onto a 512x512 texture, actually points to pixel (20,20) !

 

Example -- Polygons Data Block:

 

Here is the polygon structure of MiSensor.Pie, the large HQ sensor dish.  For the sake of clarity, I have color-coded each polygon's segments into type number, point data, animation data, and texture data:

 

POLYGONS 20

     4a00 3 2 1 0 8 1 8 16 175 224 170 222 175 216

     4a00 3 1 3 0 8 1 8 16 170 222 168 216 175 216

     4a00 3 3 4 0 8 1 8 16 168 216 170 210 175 216

     4a00 3 4 5 0 8 1 8 16 170 210 175 208 175 216

     4a00 3 8 7 6 8 1 8 16 168 216 170 222 175 216

     4a00 3 7 9 6 8 1 8 16 170 222 175 224 175 216

     4a00 3 11 10 6 8 1 8 16 175 208 170 210 175 216

     4a00 3 10 8 6 8 1 8 16 170 210 168 216 175 216

     a00 3 14 13 12 111 208 111 216 106 210

     a00 3 12 13 15 106 210 111 216 104 216

     a00 3 15 13 16 104 216 111 216 106 222

     a00 3 16 13 17 106 222 111 216 111 224

     a00 3 20 19 18 104 216 111 216 106 210

     a00 3 18 19 21 106 210 111 216 111 208

     a00 3 23 19 22 111 224 111 216 106 222

     a00 3 22 19 20 106 222 111 216 104 216

     6a00 3 26 25 24 8 1 11 10 110 224 115 234 104 234

     6a00 3 29 28 27 8 1 11 10 115 234 110 224 104 234

      4200 4 33 32 31 30 8 1 11 11 36 114 34 103 29 103 27 114

     4200 4 32 35 34 31 8 1 11 11 34 103 36 114 27 114 29 103

 

If you're not a computer geek, the type numbers are probably all Hex to you--so here's what they mean:

  a00 = 200 (textured) + 800 (no filter)

  4200 = 200 (textured) + 4000 (team-colors)

  4a00 = 200 (textured) + 800 (no filter) + 4000 (team-colors)

  6a00 = 200 (textured) + 800 (no filter) + 2000 (two-sided) + 4000 (team-colors)

 

Submodel Data -- Connectors

 

Connectors are a "special" type of point, indicating where one model "connects" with another.  A common example is that wherever a weapon turret is placed on a chassis or hardpoint, there you will find a connector.  Likewise, there will be a connector located at the business end of a weapon turret, and the weapon's "muzzle flash" GFX will appear at precisely that location.

 

    CONNECTORS n-conn's

      x z y

      x z y

      x z y

       . . . and etc. until all connectors have been listed.


n-conn's

*This indicates how many connectors the model has.  Not every PIE model needs connectors, so       here's a general rule of thumb to follow:

                                *  Map features like trees and boulders need no connectors.  Propulsion segments also need no connectors.

                                *  Structures should have one connector, indicating where a weapon/sensor/etc. could be mounted on them.

                                *  Tank chassis need two connectors.  The first connector represents where a tank weapon is placed, and the second connector indicates where a VTOL weapon is placed.

                                *  Weapon-turret models need one connector placed on the business end of them.  A weapon's "muzzle flash" graphic will appear at precisely that location.

x  z  y          *  The X, Y, and Z coordinates point the same direction with connector data as they do with points data.  However, the z and y coordinates have switched places!!  I have no explanation as to why this happens, but it's probably to keep you guessing.

Example -- Connectors Data Block

MiSensor.Pie contains no connectors, so I can't use that as an example.  Instead, here's the connector data from the Mantis chassis, DrHBod12.Pie:

CONNECTORS  2

     0   -2   34

     0   -32   9

Submodel Data -- The BSP Block

BSP is an acronym meaning "binary space partitioning", or in layman's terms, "binary sorting plane".  Both mean the same thing--BSP data instructs Warzone to draw a model's polygons in a specific order (depending on the camera angle).  Unlike "z-buffering", which automatically sorts polygons in real-time (based on their distance from the camera), a BSP tree is calculated beforehand.  BSP data is primarily used for older software-rending hardware such as the Sony PSX (PlayStation) console. However, the BSP data block is complex, I have not yet determined its format, and it is not used by the PC version of Warzone2100.  Therefore, PIE Slicer does not support BSP data.

Here is the BSP tree used to draw the Cyborg Factory:


 

BSP 24

     -1 -1 -1 1

     2 25 26 -1 -1 -1

     3 24 -1 -1 -1

     4 6 7 -1 -1 9

     5 4 5 -1 -1 -1

     6 1 -1 -1 7

     -1 0 -1 -1 -1

     8 3 -1 -1 -1

     -1 2 -1 -1 -1

     10 23 -1 -1 -1

     11 22 -1 -1 -1

     12 20 -1 -1 23

     13 18 -1 -1 22

     14 15 16 -1 -1 21

     15 9 -1 -1 16

     -1 8 -1 -1 -1

     17 13 -1 -1 20

     18 11 -1 -1 19

     -1 10 -1 -1 -1

     -1 12 -1 -1 -1

     -1 14 -1 -1 -1

     -1 17 -1 -1 -1

     -1 19 -1 -1 -1

     -1 21 -1 -1 -1

There is no easy pattern to this--some lines have 4 parameters, some have 5, and some others even have 6 parameters!  The only patterns I notice are that other than the '-1' terms, the first number of every line is in numerical order, and so are the parameters in each line.  The numbers may be polygon indexes (because they don't exceed the maximum # of polygons), but other than that, I have no clue what they do.  Also of note is that no index number (except '-1') is mentioned more than once in any line.