It is expected that the reader of this tutorial has read and understood the concepts in 3D modelling which were introduced in my map making tutorials. The first of which can be found here http://www.matrixgames.com/forums/tm.asp?m=1788093 Specifically some familiarity with the Milkshape 3D (MS3D) editor will be assumed.
As there has been some interest in making new buildings for PCK, I thought I would put together a little tutorial on how to do this.
Map placeable objects for PCK come in two different types. Objects which can't be mounted by infantry (eg trees, fences, bridges, wood piles, farm yard animals, etc) and those that can be mounted (eg houses, churches, foxholes, trenches, etc). The main difference between the two you need to know when modelling them in MS3D is that mountable structures require the definition of "mount" points within the model. Previously this could only be done with expensive professional grade modelling and export software. However a recent development has enabled users of MS3D to achieve the same end result. This tutorial will explain in some detail how to attach these mount points to your building model so they can be used by infantry within the game.
Before we get to that, let's consider how PCK sees buildings. In PCK any mesh can be a building. The map.bmp pixels underlying this mesh are normally painted pure red RGB(255,0,0). This signifies a map obstruction so buildings can obstruct LOS. In the scenedit program (see addendum pdf manual documentation which is nominally installed to C:\Matrix Games\Panzer Command Kharkov\Manuals\Map Editing Addendum.pdf) a mesh can be defined as a building via the buildingtype attribute. There are several different "types" of buildings available, so please take your time to examine the different types in the editor. The maximum number of squads which can deploy in a building is 2 and the minimum is 1. When you design your building in MS3D you will need to think about how many squads would be able to fit inside it appropriately. Remember that the average squad size ~ 10 men, but this will be abstracted to just 3 men / squad for modelling purposes.
What this means is that if you wanted to place two squads in your building you will need to define 6 mount points (3 / squad * 2 = 6), one squad only 3 points. Mount points can be placed anywhere you like including on different stories, so it is a good idea to also model some floors for upper story structures if you want to place squads up there, lest they will float in mid air when they come to mount the building in the game. Another point I should make at this stage is that squads mount in the order in which the mount points are defined. This is worth noteing. Consider a church with a bell tower from which excellent battlefield visibility can be achieved. If you want the player to mount his men from the bell tower down, then remember to order the mount points as such, otherwise you are setting the scene for some major player frustration! Also it is a good idea to place your mount points at logical places in the mesh (eg looking out windows, rather than hiding in attics) so that all appears sensible to the player. The game engine doesn't distinguish between a squad hidden away in the bowels of a building which would have no hope of firing outside said building, from one which is looking out the window. The player however, will.
Ok we will start with a small building. This is a little number I knocked up in Google Sketchup (SU) in just a few minutes and then imported into MS3D. The building itself is not too important however, it is just being used as a prop for further exposition. Notice how the little house is appropriately scaled for the game (recall 1 MS3D unit = 2.54 meters in game), its base sits flat on the Y plane and is pretty well centered on the origin.
< Message edited by Stridor -- 5/9/2008 4:42:03 PM >