Using Samplesmaker

A tutorial for using Samplesmaker to make .samples files to create objectlightmaps in bf1942 & BFV

A tutorial by cajunwolf

HomeTutorials


 

Samplesmaker is a program by Coincoin, the man who brought us Editor42. It is used for making *.samples files for custom static objects so that they can be lightmapped. When you installed Battlecraft you might or might not have installed these files or you down loaded them from the EA site. In either case these are the samples files for the stock bf1942 or BFV (which ever game you are working with) and you are going to have to have them in order to do object lightmaps for your static's in a map. This tool will allow you to make your own lightmap samples files for custom objects.  Its a fairly simple program to use but you have to run it from the command prompt or as a batch file. For those of you who get nervous at doing this never fear as I will show you step by step. First a little info for those of you new to this.

About samples files and Objectlightmaps

Ok like we said these files are used by the Battlecraft editors and the Battlefield engine to raytrace the object lightmaps for the structures in the map. Some you might even ask "what are objectlightmaps"? Well in Battlefield they are used to "light" the static objects in the map. Look at one in a map that has a ObjectLightMaps folder. They are in TGA format and should open in most image editors. I want you to notice how they are named, the one below for example is named afr_house2_ste_m1_1273-73-256.tga, the name is the coordinate of the object in x, y, z format. This means you cannot move the objects once the lightmaps have been made. Have a look at afr_house2_ste_m1_1273-73-256.

These files are apparently applied to the model\texture to create the light\dark of the shadowing effect. Next is a series of images so you can see the effects of the lightmaps applied to the objects in game. Click on each thumb nail in turn to view enlarged image.

 

.

Building lightmapped

 

Big difference in how they look with object lightmaps isn't it? Lets get started. 

 

Skill Level

Tools

Setting up Samplesmaker

First you need to make a folder. I am going to suggest the root drive like C:\ samples. This will make typing the paths from the command prompt much simpler unless you have the "open cmd here" tweak. Now extract Samplesmaker to this folder. You note that there is a readme that gives instructions. The purpose of this tutorial is to enhance these instructions. Here is how mine directory looks.

 Now you will need the standardMesh (.sm files) for the static objects you want to make samples files for.  All you need are the sm's, not the .rs files. Place these sm files in the samples directory like so.

 Lets work on these few files for this example. Once this is all done we are about ready to make some samples files. Now the syntax at the command line can be done in two ways. You can makes samples one at a time or in a batch using the samplesmakerall.bat file. I always use the samplesmakerall.bat file even for one samples file because it is a simpler command to type but I will go over both command strings and there syntax for those interested. For those of you who have read the readme and understand it please feel free to continue on your own.

To do samples one at a time you type this at the command prompt.

>  samplesmaker size inputname [outputname]

The size is the .samples size. small is 128, medium is 256, and large is 512. If you look at the bf1942\BFV stock samples files you can get a feel for the sizes of the different ones. You can tell by the files size.

The outputname is an option if you would like to change of the .sample file. If I wanted to make a large .sample for the DC_mktbldg2_m1.sm static I would type this.

You will see this window once it has run.

Now to do a batch of samples you would use the samplesmakerall.bat file. One important thing to remember is that this will do all the samples the same size. So if you wanted to do your _m1 objects a large and the _m2 objects as medium you need to run separate batches. Samplesmaker will over write files without prompting you so be careful. To run the batch you would do this.

 Once run you will see this.

If you look in your samplesmaker directory you will see your new .samples files.

Now we have made the samples files and all that's left to do is to move them to the >Program Files > Battlefield 1942 (or Battlefield Vietnam) > standardMesh folder. Now you are ready to run objectlightmaps for your map.

 

Back to top