SMD Tool Tutorial Tools by Son of Persia Tutorial by Mr.Curious 2018
SMD tool video tutorial by Mr.Curious is avialble here https://youtu.be/6x6P0!rl2" #$%&' D&SC$%PT%() (' T((* '+)CT%()S The function of the SMD tool is simple. It allows us to to edit, replace, create or remove models that we see in the game. Also, some of these models can be edited to rotate on an ais, li!e a windmill model for eample. "hile some modders may be simply interested in adding a few new models to eisting rooms, there are also those who may be ambitious enough to create entirely new rooms. All of this is now possible than!s to the good wor! of Son of #ersia when he developed this tool.
C$&T%), C+ST(M $((MS Choosin- a roo to o "hen we are interested in creating new custom room it is important to understand beforehand that we are dealing with a limited set of rooms to choose from. There $ stages and within these stages there are numerous rooms. %ere is a list of the stages in &'()%D the files of which are located in the main *I+( folder St0 - unused rooms St1 - illage St2 - Castle St - Island St - Mercenaries /Assigment Ada St 3 Separate "ays St6 - unused rooms
St4 - unused rooms
It is worth noting that some rooms will not load enemy data properly if we have them loading in strange order. +ther rooms have no corresponding enemy data file and will not load enemy data at all 0St1,St2,St34. Depending on what !ind of scenarios we are interested in creating we will have to choose which rooms to mod carefully. There are several things to consider before choosing a room 5 - are we simply adding/removing models from eisting rooms without affecting the loading order 6 7 - what !ind of enemy interactions do we wish to have in these newly modded rooms6 8 - what !ind of effects, events, weather do we wish to have in any custom rooms we create6
(ther thin-s to 5onsier hen 5hoosin- a roo Also it is important to understand understand that that there are are certain certain functions functions that are 9tied9 9tied9 to many of the eisting eisting rooms. "e may wish to consider which !ind of events eist in a room before we choose to use it for our new custom room. The reason for this because we may wish to use some of these events for our new room. :or eample, if we wanted to create a custom room with a collapsing ceiling trap we would need to use a room that already had this event present and build our new custom room inside this room. Another eample is if we wanted wanted lightning lightning to be present present in our our new room room we would would need to mod a room that already has lightning. To elaborate on this concept we need to understand that each room has a certain set of events that are particular to that one room. Sometimes we can replicate these events but most times we are not able to because these events are hardcoded into the rooms by scripts or call functions inside the game ee. An eample eample of a function function that that is tied tied to a room room is the Camp room room with the the *ella sisters. sisters. There There is an A' event event in this this room that that triggers triggers several several things 1 3 the spawning of the *ella sisters once the player enters a certain area 2 3 a live cutscene that shows the sisters emerging 0one ;umping down and the other brea!ing through the wall with the chainsaw4. 3 a bloc!ing event that prevents us from entering the hole in the wall where the sister with the chainsaw bro!e through.
If we wanted to, we could use and incorporate these pre-eisting events inside our new room. 0:or eample I used the wall brea!ing event in a modded version of this room to recreate an enemy brea!ing through a wall4. In this scenario we are able to use the A' trigger to down these enemies and a start a cutscene that is controlled by the CAM file. If we wanted to, we could also ma!e use of the door loc!ing event which re> companion but there are still many limitations4 we need to simply use pre-eisting events for some types of events. There are also other things that are 9tied9 to a room such as certain effects. An eample of this is the fountain effect that is present in r71b 0garden ma=e4. The tric!ling water that comes down from the fountain is uni
+ther effects 0li!e some lightning and some rain effects for eample4 are triggered by entries in the ':: file but can9t be ported from room to room. Again, these are events that are specific for certain rooms so sometimes we need to consider what !ind of weather we want our new room to have when we are choosing a room to mod. It all comes down to this this game was never meant to be modded, therefore the programmers did not write the code so that every room was created e
7o soe oels are tie to eents an/or other +DS files *efore we start removing/adding/replacing models we should !now something about model tetures. If we are to replace eisitng models with custom ones we must understand that there might be preeisting relationships to other files that these models might have had, and how they might affect how our new models behave/loo!. :or eample, if we are to simply empty out the pac! file for a room and fill it with all custom tetures, and repac! our SMD with all new models, some of the tetures may come out loo!ing odd despite that they are mapped correclty in the 8D application. The reason for this is that there often effects in the ':: file that call on tetures that are located in the room.pac! file, and these effects have their own TetureData file that controls how the teture is applied. If we have a custom model that uses a custom teture that has the same teture number that one of these effects is calling, the results can often be undesirable. To avoid this we have several options 1 3 remove the effect that is calling on the teture 0see ':: file tutorial for this4. 2 3 leave effect tetures in place in the room pac! file and place all models before and after them to avoid conflicts.
There are more eamples of how models can be tied to events and /or )DAS files, particualrly that of the SM? file. These relationships to other files are what ma!e may cool things happen, li!e being able to use moving models. #lease ma!e sure to read the 9Soe notes about SM;&ntry;%D alues9 section below for more information on th;is special realtionship with the SM? file.
'+)CT%()S (' T7& SMD T((*
0and associated files4
*efore we get started using the SMD tool let9s first observe the files we are dealing with This tool wor!s by unpac!ing the SMD file that is located inside the )DAS archive. This SMD file is not to be confused with the normal type of .s model file we are accustomed to dealing with in modding. This SMD is actually another archive that contains all the *I@ models for the room and one T#> file that serves as an inde for all the room materials/tetures. There are a few files that are generated when using the SMD tool MoelData.txt file that is generated by the SMD tool that governs how/where the *I@ models are
placed in the game. .t5s file that is generated that shows us if the teture mapping for the T#> has been done properly. .ix file which serves as an inde of all the *I@ files and the teture number count. .(#< files that are generated for us to edit the models and/or their positions if we wish. .MT* file that is generated which serves as an inde of tetures/materials used by the .ob; files.
'%*& &T$CT%() To unpac! the SMD simply place the SMD file along with the $&+7D;SMD;Tool.exe and .bat files. Double clic! the SMD;&xtra5t.bat file and the tool will automatically generate - a new folder with all the *I@ models and one T#> file. - MoelData.txt file. - (#< files for all etracted models that we can edit in 8D program along with a master oel.ob= file which contains all the room models placed in their proper position/scale/roation as seen in the game. 0"e use this for reference only4. - MT* files that list all of the materials tetures used by their corresponding +*B file. - an .ix file in the main directory +nce all the files have been etracted we can observe the file naming structure of the models with the first model starting at 0000.ob= then 0001.ob= , 0002.ob= and so on. The T#> should always be named 5 integer higher than the last model . So for eample if the last model number is 0048.ob= then the T#> will be numbered 004>.TP*. @ow that we have unpac!ed the SMD and have an understanding of how the files are numbered we can do several things - edit eisting ob; model file0s4 save, then repac! the SMD - remove certain models from the SMD and repac!. - add new models and then repac! the SMD "e can actually do all of the above if we wish but for beginners I suggest doing one thing at a time until you get the feel of how it wor!s. This process can get '& tric!y because if the T#> file which is
?($@%), ?%T7 T7& TP* '%*& As noted above the the T#> file file can be be very tric!y tric!y to wor! wor! with if we are not not careful. careful. "e must pay strict attention to detail when wor!ing with our teture numbers, and the .id file. To prepare you for this part of the process I will eplain how the T#> wor!s. "hen models are initially etracted a T#> is generated which contains all the tetures which are numbered in ascending se file 0you will not need to loo! at the T#> file in he if you do things right4. "hen we add new tetures it is very important to first ma!e a bac!up of our eisting T#> and to do so eery tie e a ne oels or ne textures . The reason for this is that if we do something incorrectly the changes to T#> file can not be undone. This is what ma!es the T#> so important in this process. "e must be very careful to write to it correctly or all of our tetures will will not load properly. I will epalin more below of two separate methods on how to ta!e good care of our T#> when addding new tetures.
&D%T%), M(D&*S
A few important important things things to !now about about editing editing models. models. There are are some polygon polygon restrictions restrictions to the the tools 0I9m not sure what this is but you can try for yourself4. In my eperience I have noticed that the tools wor! better 0and faster4 with models that are separated and less than 8111 polygons. I dont mean to say that if for eample we have a chair model that has 8 parts that each part needs to be eported as a saprate model, but in the case of an entire room it is best to separate the parts to relatively smaller parts so that the eported models aren9t huge file si=es that bog down the SMD tool. It is also worth mentioning that we have more fleibility with lighting when we have models separated into various parts via the SM? file 0more on this later4. Also worth worth noting is that the the tools wor! wor! with triangles and not quads so ma!e sure your 8D application is set to triangles. To edit a model simply import it into 8dsMa or another 8D application 0:or this tutorial I will be eplaining the wor! flow of 8DSMA? but the principles should be universal4.
&itin- Moels 3 ?orAin- ith textures B the MT* file As mentioned mentioned earlier earlier its very very important important that we we get all our our teture teture IDs sorted sorted out for the T#>. T#>. If we we are not adding any new tetures to the models that are being eported we really have nothing to worry about with the T#> but if we are to add any new tetures there are a few things we must do 1 3 the new tetures need to follow the same naming principles of all other pac! files 0numbers from 1111.dds - EEEE.dds4. 2 3 the new teture entries in the MT> file need to be placed in ascending sequential order . To do so we must edit the MT> file entries so that all the materials are placed in order by their texuture name li!e so order li!e
newmtl MaterialFF58E illum 7 Gd 1.$11111 1.$11111 1.$11111 Ga 1.711111 1.711111 1.711111 Gs 1.111111 1.111111 1.111111 Ge 1.111111 1.111111 1.111111 @s 1.111111 mapFGd 002.s newmtl MaterialFF55E illum 7 Gd 1.$11111 1.$11111 1.$11111 Ga 1.711111 1.711111 1.711111 Gs 1.111111 1.111111 1.111111 Ge 1.111111 1.111111 1.111111 @s 1.111111 mapFGd 002.s mapFD 0026.s newmtl MaterialFF515 illum 7 Gd 1.$11111 1.$11111 1.$11111 Ga 1.711111 1.711111 1.711111 Gs 1.111111 1.111111 1.111111 Ge 1.111111 1.111111 1.111111
@s 1.111111 mapFGd 0024.s newmtl MaterialFF55 illum 7 Gd 1.$11111 1.$11111 1.$11111 Ga 1.711111 1.711111 1.711111 Gs 1.111111 1.111111 1.111111 Ge 1.111111 1.111111 1.111111 @s 1.111111 mapFGd 0028.s you see above that the first material entry has 002.s, the second entry has 002.s then 0026.s the thrid entry has 0024.s and the last material entry has 0028.s This is an eample of material entries being ordred by their associated tetures in ascending sequential order
DD%), )&? M(D&*S If we are adding new models with new tetures we have several 7 ways of dealing with the T#>. "e can use 7 different methods
Method 1 This method is preferable if we are going to be simply adding or removing models from eisting rooms without ma!ing dramatic changes. If we are ma!ing entirely new rooms I stron-ly suggest using Method 7 below. Method 5 re file each time before repac!ing then SMD. "hat this method does is updates the same T#> file each time a new model is added and updates the .id 'irstCustoTexture%nex value to 5 integer above the last teture used by the last model. In contrast, Method 7 rewrites an entirely new T#> each time the SMD is repac!ed. &xaple of Metho 1 :or this eample in Method 5 we are simply going to be adding one new model to an SMD that originally had 3$ models 0with a T#> that was originally 004>.tpl4 +ur new model that we are adding is named 004>.ob= as the last etracted model was 113$.ob;
To ma!e this wor! we need to rename the 004>.tpl to 0080.tpl since our new model is named 004>.ob=. Any new tetures included in the new 004>.MT* file should be in ascending sequential order . This ensures that the T#> entries are in correct order. If we are dealing with adding numerous new models and tetures I strongly suggest using Metho2 0see below4, because renaming the T#> and editing MT> file each time is a pain and with any errors you could comprise the intergrity of the T#>. If we are to use this method we need to update the 'irstCustoTexture%nex value in the .id file each time a new model is added 0more on this below4. This value should reflect the number of the first new teture that is being added. 'or exaple:
"e etract an SMD that originally has 3$ models and it shows us in the .id file that there is a value of 'irstCustoTexture%nex 112. This means that the last model used had it9s last teture at 0111.s and that the SMD tool will write the net teture in the T#> as 112. If we do not wish the teture of our new 113E.ob; model to start at 1557.dds 0either because there are other tetures present in the pac! file that are being used, li!e being used for effects or 'TM models4, then we have the option of telling the tool where to start from using the 'irstCustoTexture%nex value. :or this eample we may wish to set the 'irstCustoTexture%nex value to 11 becuase the tetures from 1557 - 151 are being used by effects. Doing this allows us to s!ip over bloc!s of teture numbers. So a brief overview of Method 5 is this 1 3 Add new model to our etracted SMD folder named 5 integer higher than the last model. 2 3 Ma!e sure all the new materials in the .mtl file of the new model are arranged in numerated se to one value higher than the last model. 3 update the 'irstCustoTexture%nex value in the .ix file to the number of the first teture used by the new model. 6 3 &epac! the SMD, then import new SMD into wor!ing )DAS, repac! )DAS and replace.
Method 2 This method is preferable if we are going to be ma!ing entirely new rooms from scratch or adding lots of new tetures to an eisting room. This method re files before repac!ing. This method ma!es it a bree=e to repac! our SMD without worry of damaging the T#> file. Steps for usin- Metho 2 Import the 0000.ob= file 0provided with this distribution in the DM file with T'?T)&'S folder 4 folder 4 into 8Ds Ma. 0>ater on we will have to move our original 1111.ob; file to another number as this DM file will be eported as 1111 so that it will load first4. This DM model 1111.ob; consists of 72 s
"hat this does is creates a stable method of replacing, rearranging, and adding new models without worrying about the constant need for the T#> to be being updated becuase the first model contains ** the tetures we are going to need for the following models, and the tool does not create new T#> entries for the models that follow after 1111.ob; as the .mtl for this model contains all the tetures entries used by all models. %aving 5 model at the start that contains ALL the used tetures creates a T#> that is soli.
+S%), T7& DME '%*& The DM file that has been provided contains 72 plane models, each of which that is assigned a teture starting at 1111 up to 17. If you need more than 72 tetures for your SMD model then I suggest you follow the instrcutinons below on how to ma!e your own DM file. If you do not need more than 72, then all you need to do is the following 5 - Import DM file into 8dsMa. If 8DsMa as!s for the location of the tetures on import 0or says that there are mssing materials4, point it to the DME file ith T&T+$&S directory located in the Default DsMax scene folder included in this distrbution. In 8Ds Ma we can also go to 9Customi=e--
HConfigure )ser #aths--H'ternal :iles Tab and set the directory of the DME file ith T&T+$&S directory. +nce the models are imported they will all be assigned a teture. All we need to do at this point is to loo! at how many tetures our room has inthe .pac! file and eport the same amount of planes from the DM model. &xaple: +ur room pac! file has 5(3 tetures 0starting at 1111-15(24. This means that we only need to include planes 0003016 when we eport the model as 0000.ob=. This tells the SMD tool that there are 5(3 tetures being used. +nce we eport this model any model that follows can be assigned any of the tetures without us having to worry about the order of materials in the MT> files that are eported for each model. :or this process, each time we add new models repac! the room SMD file we will delete the T#> file, ma!ing sure that the .ix file is always set to 'irstCustoTexture%nex 0 0more on the .id file below in $epa5Ain- the SMD file 4. If we arent adding any new models but simply editing models that already pac!ed into the SMD there is no need to delete the T#>4.
DD%), )&? T&T+$&S If we want to add new tetures at any point we can simply include more planes to the DM model 0000.ob= and eport it with the new tetures applied. If we need more than 172 planes for more than 72 tetures 0this would rare4, we woudl have to clone the LAST PLANE first 0eample... we would clone plane 17 and it would be a new copy named 1724, then copy 172 to get 173 and so on.This would ensure that each plane is named properly and that the materials associated with it are in the correct order for the MT> file. "e would repeat this process as many times as we need until we get the amount of planes needed to match our .pac! file. &emember if we arent using more than 72 tetures for models,then we do not need to add more planes. "e simply assign new tetures to planes that already eist in the 1111.ob; model taht was imported.
M@%), E(+$ (?) DME '%*& 0s!ip down to $epa5Ain- the SMD file if you are using the DM file provided4 If for some reason we need more than 72 models and updating the DM file provided isnt wor!ing we can create our own DM model. "hile doing this we need to ma!e sure that the order of the tetures is in correct order. )sing the steps below will ensure that the teture order is in correct order 1 3 create a layer in 8dsMa and name it 1111 for your first model. 2 3 In this layer, create a plane 0use only ( vertices to reduce polycount by using *en-th Se-s and ?ith Se-s to 54 and ma!e sure it9s named plane000.
not instance4. 8dsma should automatically wish to 3 copy/paste this plane 0ma!e sure it9s a copy not name this new plane 9plane0019 if not, manually ma!e it so, and the net time it should do it automaticly.
3 do step 7 again, copying/pasting plane002 etc. Do this over and over until you have as many planes as you need for all your tetures. 0ou can copy/paste more than 7 at a time but ma!e sure you always copy from the last bunch and not the first as the order of the tetuers will get screwed up.
3 Drag and drop all the tetures one by one from the etracted folder of your pac! file in windows eplorer to each plane in the viewport 0yes this is tedious.. that9s why I made a DM for you4J This will automatically assign the tetures the plane and create a material for it. &emember to drag and drop 1111.dds to plane111 and 1115.dds to plane115 and so on.
6 3 +nce all the tetures have been dropped to the planes in ascending se
If the teture number order in the MT> isn9t in ascending se so that the tetures appear in ascending se files edited in any way.
$epa5Ain- the SMD file *efore we go ahead and repac! the file we need to edit another 7 files The MoelData.txt file and the .ix file. first lets have a loo! at the MoelData.txt file 0this may seem li!e a long read but this is a very important part of the process4 K4
?orAin- ith the MoelData.txt file As mentioned mentioned above above the MoelData.txt file is responsible for the placement and scale of the models in the game. There are also other parameters that we can edit to change the behaviour of the model with arrangements that coincide with other files in the +DS ar5hie , in particular the SM file. :irst let9s loo! at at an eample of the ModelData.tt file output MoelDataCount 210
F Moel Data &ntry 0 F Moel )uber Translation; 31168.2002 Goel positionH Translation;E 0>4.1084> Translation;I 0.000000 $otation; 0.000000 Goel rotationH $otation;E 30.000000 $otation;I 22.4286 S5ale; 11.>4482> Goel s5alin-H S5ale;E >.64 S5ale;I 10.000000 #%);)uber 0x Goel nuber in 7& alueH (ffsetJ8K 0x'' SM;&ntry;%D 0xD Gthis is the 5orresponin- SM %D in the SM fileH (ffsetJ0..K 0x0 (ffsetJ..4K 0x0 (ffsetJ8..1K 0x0 (ffsetJ2..K 0x0 (ffsetJ6..>K 0x0 (ffsetJ60..6K 0x0 (ffsetJ6..64K 0x0 (ffsetJ68..41K 0x8 Goel typeH F Moel Data &ntry 1 F Moel )uber 6 Translation; 0.000000 Translation;E 30.000000 Translation;I 0.000000 $otation; 0.000000 $otation;E 30.000000 $otation;I 0.000000 S5ale; 10.000000 S5ale;E 10.000000 S5ale;I 10.000000 #%);)uber 0x6 (ffsetJ8K 0x'' SM;&ntry;%D 0x& (ffsetJ0..K 0x0 (ffsetJ..4K 0x0 (ffsetJ8..1K 0x0 (ffsetJ2..K 0x0 (ffsetJ6..>K 0x0 (ffsetJ60..6K 0x0 (ffsetJ6..64K 0x0 (ffsetJ68..41K 0x>
Above we we see the main MoelDataCount and then 7 entries that follow. In the eample above the MoelDataCount 210 indicates that there are 751 entries 0I only showed you the first 7 for this eample4. The first entry is 1, the second is 5, the third is 7 and so on. Simpy put the MoelDataCount
is an inde of how many entries there are in the file. "ith the MoelDataCount we can often remove 0not always.. see %MP($T)T below4 models from the game wihtout actually removing the *I@ model files from the SMD. "e can do this by simply redcuing the value in the MoelDataCount . Imagine that the MoelData.txt is the 9cue file9 for the *I@ files in the SMD. *I@ files can be present in our SMD file but without the 9cue9 to appear in the game from the MoelData.txt our model will not be loaded in the game. Imagine the *I@ files in your SMD file as your >ibrary of music, and the MoelData.txt is your playlist. @ormally we would thin! that there would be 5 entry for each model but there are often times that we see the same *I@ model being used repeatedly 0li!e your favorite song repeated ( times in a row in a playlist ?D4. This would eplain why there are often many more MoelDataCount entries than there are *I@ models in the etracted SMD folder. At the top of the MoelData.txt config we have the MoelDataCount value which shows us the number of entries in the config 0 )(T T7& )+M#&$ (' M(D&*S in the etracted SMD folder4. Allow me to elaborate "ith the MoelData.txt file we can repeat the same model more than once by ma!ing another entry and using the same model number. "e can then place the model in a different location using the Translation; offsets... The reason for this feature was so that if we have numerous instances of the same model we conserve file/dis! space by using the MoelData.txt config to place duplicate models rather than ma!ing duplicate *I@ files. ou will see this often in cases where there are many repeating models such as handrail posts, fence posts and trees, bushes etc. @ow that computers are much faster and have much more memory storage this feature is not as imperative to use as it once was. @ow lets loo! at some of the offsets we see in the MoelData.txt config
MoelData.txt DT L*+&S Translation; data data If the all the Translation; coordinates coordinates of our model are set to 0.000000 the model9s location will be determined by the model coordinates as they appear in 8dsMa. This is the easiest way to place models 0and the most commonly used method4, but there are other instances when we need to use the coordinate entries in the Moelata.txt file to position a model instead of the 8dsMa position. An eample eample of this is when we have have a moving model 0li!e 0li!e a rotating rotating fan for eample4. eample4. In this this case we we would place the fan model in 8ds ma at 1,1,1 and the use the Translation; coordinates offest to position the fan model where we desire. The reason for this is because the rotation ais of moving models are always centred at 1,1,1,. Another reason to use the Translation; coordinates to postion a model as mentioned above is when we want to have a repeating model without duplicating the *I@ file over and over in the SMD.
$otation; data data The same principles from the previous offset apply to this. I have never rotated a model using this offest as I always simply rotate the ob;ect in 8DSMa.
S5ale; data data The &'( game developers devised several ways to scale models in the game which gives us a bit of fleibility. The first way is the absolute scale of the physical model that we can manipulate in 8dsMa. The second is by the S5ale; factor factor in the MoelData.txt file. :or reasons un!nown to me we sometimes see models scaled differently in the ModelData.tt file 051 for eample4. :or the most part
though models will usually be scaled 5 in the ModelData.tt file. "hen wor!ing with multiple models at once it is easiest to simply set the scale of all models to 5 in the ModelData.tt file and ad;ust their si=es accordingly in 8dsMa. It should be noted that some rooms use different scales in &'()%D. Most rooms use 5 , but ta!e note of all the S5ale; entries entries before editing yor models as sometimes all the models 0or most4 models in a room can be scaled 51, or even 511. This is worth paying attention to in the case where we are ta!ing models from one room and placing them in another. Dont be surpised when your model comes out loo!ing LIA@T, or that it appears to not be there at all becuase it is so small. #aying attention to scale can often save you lots of headacheJ
#%);)uber This is simply the ob; file number translated into %'? values.
SM;&ntry This offest is sometimes not very important while other times it is the most important part of the MoelData.txt file. "hat is SM? you as!6 "ell if you have ever paid attention to all the files that are in your )DAS archive you will note there is one file with the etension . SM. This file is repsonible for several things - governing how lights affect models in the game 0how a wall is not lit from a light on the other side of the wall4 - governing scorlling tetures on models 0li!e when the clouds appear to move acorss the s!y4 - governing the movement of moving models 0how fast a model rotates, li!e a rotating windmill4 So why is this part of MoelData.txt file6 "ell, as stated above we might want our model to move a bit, or we might want the teture that is applied to it to scroll slowly 0or maybe really fast4J "e might also want to ad;ust the lighting on this one particular model in a certain way, perhaps by ad;uting which colors are allowed to be lit. The SM? file is very handy for ad;usting lighting, but it needs to !now which models are being used, and this is where the MoelData.txt file comes in. The MoelData.txt file tells the SM? file which models are assigned to which SM? entries. So if we loo! at our eample above we see that the first Moel Data &ntry 0 uses SM;&ntry;%D 0xD. This means that when we edit the %D 0xD in the SM.txt config Gusin- the SM toolH that the values there will affect the model in MoelData.txt entry 1. @ow you see that these tools wor! together and often have vlaues that point to each each other.
%MP($T)T Soe notes about SM;&ntry;%D alues Most often there is one SM? entry in the SM file for each model entry in the SMD file but this is not always the case. Sometimes models share SM? entries while other times they simply use the default value of SM;&ntry;%D 0x'&. )sing this deafult value is a safe way to assign a value when we aren9t sure what to do, or have no intention of using the SM? tools in con;unction with the SMD tool. In any case if we are adding new models we should be aware of which SM? entry they are assigned to becuase it can drastically affect how the model appears/behaves in the game. :or eample, if we reaplaced the s!y model in a room with a new wall model and didnt change the SM? entry data, the teture on the new wall model might be scolling because the SM? entry for the s!y was configured to have a scrolling teture.
Another more advanced advanced issue issue with SM? SM? entries entries in the MoelData.txt is that of models that animated by sciprts. As descirbed above in 9 Other things to consider when choosing a room', each room has scripts that are hardcoded in the game .ee that perform certain fucntions, often in con;ucntion with the models in a room. In particular these sciprts often determine the movement of some animated models 0not to be confused with rotating models that we can do ourselves with the SM?4. An eample eample of this are trap doors that that come crashing crashing down when when we trigger trigger an event. This This movement movement is governed by a script in the game .ee, not the data in the SM? file itself, although the game does assign an SM? entry to the model for this purpose. This may seem confusing but essentially what happens is that there are certain aniate oels in some rooms that are assigned special SM;&ntry;%Ds that are lin!ed to scripts in the .ee. These special models can be changed to whatever model we wish but their SM;&ntry;%Ds can not be removed from the MoelData.txt file or the game will crash. crash . As mentioned above the MoelData.txt acts as a cue for the *I@ model files and when the game scirpts call on one of these special SM;&ntry;%Ds that is missing the game crashes. So how do we ma!e sure we dont remove one of these special SM;&ntry;%Ds that are so important6 The answer is easy.. ta!e a loo! at the last offset in any MoelData.txt file (ffsetJ68..41K 0x> "hen the value is 0x> 0or 0xD4 this means that the model we are dealing with is an animated model that is goverened by a script in the game. ee. ou will see these !ind of entries in many MoelData.txt files. An eample of a model that uses this feature is a cabinet that opens with a prompt. The se Gor 0xDH through the entire file before staritng any wor! on a custom room. I would then cut any entries that had this value and place them at the top of the MoelData.txt file. I would then delete all other entries and then update the MoelDataCount to the number of entries that reminaed. This way I could still load the room without the game crashing. If we want to remove these moving models completely we can simply ma!e DM planes for them and hide them where they will not be seen, or as I mentioned, we can ge creative and ma!e different model for them and place them wherever we li!e.
?($@%), ?%T7 T7& .%D '%*& The final thing we need to ta!e into account when repac!ing the SMD file is the .ix file which serves as an inde for all the models and pointer to the correct room pac! file. *elow is an eample of the .ix file opened in a tt editor
MoelCount 82 CustoTexturePa5A)uber 000101 'irstCustoTexture%nex 112 Type 0 7eaer(ffsetJ16..1>K 0xC>211 7eaer(ffsetJ20..2K 0x0 7eaer(ffsetJ2..24K 0xC1>26 7eaer(ffsetJ28..1K 0x0 7eaer(ffsetJ2..K 0x&C#0'# 7eaer(ffsetJ6..>K 0x0
The only offesets we wor! with are those highlighed in color in the eample above. The 1st offset is used as an inde. "hen we add or remove models from the etracted SMD folder they must also be reflected in the .id file MoelCount parameter. So if our etracted folder has $5 models, the value seen in the id will be MoelCount 82 0rememebring that 1111.ob; counts as the first model, 1115.ob; as the 7nd model etc..4 Ageneral rule that wor!s is that the MoelCount value should be the same value as the T#> file. The 2n offset is used to tell the tool which pac! file will be used. This value should never really be changed, as we usually only deal with etracted SMDs and then edit them from there. The r offset is of significant importance becuase it tells the tool where to start writing to the T#> file. If we are using method 5 as outlined in the 9ADDI@L @'" M+D'>S9 seciton above, this value will always need be updated to the first new custom teture that is being added. See Method 5 above for more details. If we are using Method 7 this value shoudl always be set to 1 as the tools will rewrite the T#> from scratch.
;$ B ;,# ob= files &xpaline &xpaline As you may may have noticed noticed after after etracting etracting your your SMD file file there are are sometimes sometimes etracted etracted models models that have the same name, but with different suffies. 'ample 0021.ob= 0021;$.ob= 0021;,#.ob=
To ma!e give some fleibility for certainmodels the developpers of &esident 'vile ( gave some bin files a hardcoded custom brightness/colour/transparency values for eery ertex. Sounds cra=y right6 To eplain things a bit more we should !now that in *I@ models eery ertex has bytes of info $$ $$ ,, ,, ## ## 0alpha, red, green, blue4 T%P: If you want to !now IT/SM? files. They also used this method to generate transparencies without using alpha channels, and finally, they also used this to change some
models colour 0or part of the model4 without the need of using different tetures.
%) ,M& &MP*&S Some eamples of this can be seen in-game where we see the yellow tiles where >eon Ashley need to press at the same time in room 71$ 0water room4 which use a grayish teture you can see all over the room but these hardcoded values ma!e them yellow. The same method is used in the church lights pu==le round dials. They have red, blue and green small arrows which all use the same teture but each model having a different custom colour hardcoded in the vertices. Another eample are the computer screens in the Island >aboratory. The computer screens are separated bin files with custom lighting bytes.This is what ma!es them so bright. An eample eample of this same method method but using using transparenc transparency y hardcoded hardcoded values values is in a lot of shadows shadows in some areas. They are usually ;ust a blac! mesh model with some of their vertices opacity values set N1N. This generates gradients from visible to transparent without the need of an alpha channel. A neat tric! indeed.
So hat are these $ / ,# files e see -enerate by the tools The hardcoded custom brightness/colour/transparency values that some bin files have got lost during the bin--Hob; conversion. And there9s no way of implementing these values in 8Dsma and eporting them again into the newly generated ob; file. So, this new 715$ SMD tool generates 2 extra files when those hardcoded values are used in the bin file ;$.ob= The ) mapping values of this file are the Alpha values of the bin file 1.0 '' 0511O visible4 0.0 00 0totally transparent4 The mapping values of this file are the &ed values of the bin file 0inverted values4 1.0 00 0no red at all4 0.0 '' 0511O red4 ;,#.ob= The ) mapping values of this file are the Lreen values of the bin file 1.0 '' 0511O green4 0.0 00 0 no green at all 4 The mapping values of this file are the *lue values of the bin file 0inverted values4 1.0 00 0no blue at all4 0.0 '' 0511O blue4
Steps to use this feature %n Dsax: - Ma!e sure your ???? model is 511O finished. - Clone it 0copy, no instance4 - Apply )nwrap )" modifier and edit the ) values according to the lpha/$e want . lpha/$e values you want. 0See value charts in the photos below4. - 'port as ;$.ob= - Clone again. - Apply )nwrap )" modifier and edit the ) values according to the ,reen /#lue /#lue values you want - 'port as ;,#.ob= This would be useful to ma!e some walls 0or part of them4 dar!er. They9d need really low &L* values or they9d loo! too bright in game. To understand this further, lets loo! at an eample with a photo
So to edit the values of each A& L* file we must edit the ) mapping of our model in 8dsMa
%ere is an infographic that illustrates some various combinations of values to achieve the results below
'asy, isn9t it6 ?D
note about &'' texture files It should be noted that if we are going to be replacing models and adding custom tetures that in every pac! file there are certain tetures that are assigned to effects. This could be for candles, or flies, or water etc. If we are going to use these teture slots for our own custom tetures this is o! but as mentioned at teh start of this tutorial, the tetures on our new models may loo! strange. *asically, some effects use tetures in the room .pac! file each with their own config to scale the tetures. T%is means that any teture IDs previsouly used by effects will be affected by teh effect. If we wish to correct this we have to edit or remove the effect that is calling on the tetures that are affected. So it is important during this process that we !eep a copy of the original .pac! file etracted so we can loo! at which tetures are used by effects, and if we need to repalce one of these tetures, that we are aware that an effect is calling on them. This concludes the SMD Tool tutorial. *e sure to chec! out the video tutorial here
https://youtu.be/6x6P0!rl2" %appy ModdingJ Mr.Curious 12 3 2018 https://.youtube.5o/user/AalaalAaAi/ http://resienteiloin-.boars.net/user/>2