A4 Programmer’s Manual © Conitec 2000 3D GameStudio A4 Programmer's Manual © 1999, 2000 Johann Christian Lotter / Conitec GmbH 1
A4 Programmer’s Manual © Conitec 2000 2 This manual is protected under the copyright laws of Germany and the U.S. Any reproduction of the material and artwork printed herein without the written permission of Conitec is prohibited. We undertake no guarantee for the accuracy of the information given. Conitec reserves the right to make alterations or updates without further announcement.
A4 Programmer’s Manual © Conitec 2000 3 Contents The A5 DLL interface _________________________________________________________ 4 WDL object structures ____________________________________________________________ 4 The WMP map format ________________________________________________________ 6 Blocks __________________________________________________________________________ 8 Map Properties___________________________________________________________________ 9 The MDL model format _______________________
A4 Programmer’s Manual © Conitec 2000 4 The A5 DDL interface DLLs are customer-programmed extensions to the engine and to the WDL language. They can be used with the commercial and professional editions, but can only be created with the SDK (source development kit) that comes with the professional edition. This way, professional edition owners can create arbitrary DLLs for adding new effects, actor AI or WDL instructions, and distribute or sell them to other 3D GameStudio users.
A4 Programmer’s Manual fixed min[3],max[3]; fixed trigger_range; fixed push; fixed shadow_range; fixed floor_range; long client_id; // fixed skill[48]; // } A4_ENTITY; (to be continued) © Conitec 2000 // bounding box // collision behaviour // range within a shadow is projected onto to the floor // range within the entity reflects light from the floor client who has created this entity (when in multiplayer mode) entity skills 5
A4 Programmer’s Manual © Conitec 2000 6 The WMP map format WMP files are plain ASCII files that can be viewed with any text editor. They contain blocks, entities, and objects that are built of them or of further objects. This is a typical WMB file: // WMP2 // ACKWED V 4.39 // Created 11.09.
A4 Programmer’s Manual © Conitec 2000 7 object 763 52 863 166 } } block 0 { ( 0.0 0.0 32.0 ) ( 0.0 500.0 32.0 ) ( 32.0 0.0 0.0 ) ( 32.0 0.0 500.0 ) ( 0.0 -32.0 0.0 ) ( 0.0 -32.0 500.0 ( -32.0 0.0 0.0 ) ( -32.0 500.0 0.0 ( 0.0 32.0 0.0 ) ( 500.0 32.0 0.0 ) ( 0.0 0.0 -32.0 ) ( 500.0 0.0 -32.0 { 0000 ndef } } ( ( ) ) ( ) 500.0 0.0 32.0 ) wood 0 0 0 1.00 1.00 : 0000 0.0 50.0 ndef ndef 0.0 0000 32.0 500.0 0.0 ) wood 0 0 0 1.00 1.00 : 0000 0.0 50.0 ndef ndef 0.0 0000 ( 500.0 -32.0 0.0 ) wood 0 0 0 1.00 1.
A4 Programmer’s Manual © Conitec 2000 8 Blocks A4 uses a right-handed XYZ coordinate system with the Z-axis standing upright. If you're not familiar with the reference of "right-handed" to a coordinate system, it basically provides a tactile and visual discription of the mechanics of the system.
A4 Programmer’s Manual © Conitec 2000 9 Angle - texture rotation angle, in degree X_scale - size of a pixel in x-direction (pixels per quant) Y_scale - size of a pixel in y-direction (pixels per quant) flags - render mode flags for the texture. ambient - brightness value in percent albedo - albedo/fog value in percent Map Properties The following structure contains the global level or map properties: level 0 { 30 0.000 60.000 100 100 100 0 0 100 100 0 0 0 0 0 19.6 19.
A4 Programmer’s Manual © Conitec 2000 10 The MDL model format A wireframe mesh, made of triangles, gives the general shape of a model. 3D vertices define the position of triangles. For each triangle in the wireframe, there will be a corresponding triangle cut from the skin picture. Or, in other words, for each 3D vertex of a triangle that describes a XYZ position, there will be a corresponding 2D vertex positioned that describes a UV position on the skin picture.
A4 Programmer’s Manual © Conitec 2000 11 MDL skin format The model skins are flat pictures that represent the texture that should be applied on the model. There can be more than one skin. You will find the first skin just after the model header, at offset baseskin = 0x54. There are numskins skins to read. Each of these model skins is either in 8-bit palettized (type == 0) or in 16-bit 5-6-5 format (type == 2).
A4 Programmer’s Manual © Conitec 2000 12 At offset basetri = baseverts + numskinverts * sizeof(uvvert_t) in the .MDL file you will find the triangle list. MDL frames A model contains a set of animation frames, which can be used in relation with the behavior of the modeled entity, so as to display it in various postures (walking, attacking, spreading its guts all over the place, etc). Basically the frame contains of vertex positions and normals.
A4 Programmer’s Manual © Conitec 2000 13 {0.809017, 0.309017, 0.500000}, {0.681718, 0.147621, 0.716567}, {0.587785, 0.425325, 0.688191}, {0.955423, 0.295242, 0.000000}, {1.000000, 0.000000, 0.000000}, {0.951056, 0.162460, 0.262866}, {0.850651, -0.525731, 0.000000}, {0.955423, -0.295242, 0.000000}, {0.864188, -0.442863, 0.238856}, {0.951056, -0.162460, 0.262866}, {0.809017, -0.309017, 0.500000}, {0.681718, -0.147621, 0.716567}, {0.850651, 0.000000, 0.525731}, {0.864188, 0.442863, -0.238856}, {0.809017, 0.
A4 Programmer’s Manual © Conitec 2000 14 Bones are a linked list of 3D vertices that are used for animation in the MDL4 format. Each bone vertex can have a parent, and several childs. If a bone vertex is moved, the childs move with it. If on moving a bone vertex the connection line to his parent rotates, it's childs are rotated likewise about the parent position. If the distance of the bone vertex to its parent changes, the change is added onto the distance between childs and parent.