.SM files
Results 1 to 11 of 11

Thread: .SM files

  1. #1

    .SM files

    These are .SM objects that I would perhaps like to edit or replace with my own, but there are a few unknowns for me.

    Can they be edited, I assume not.

    So,

    Can these .sm models be created in Gmax, I can't immediately see that they can be exported to in that format?

    If not, is there another free software that can (blender?).

    Thanks.

  2. #2
    Where are these files? I can't find them, nor know what they're for.
    Tom
    __________________________________________________ ___________________________________________
    Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding. Proverbs 4:7



  3. #3
    It's in WOTR, main town buildings and things. Don't worry then, I was just curious to see if I could sub in my own creation or not. Searches on .sm file types doesn't find much of use.

  4. #4
    SM is "scenery model". Used for auto-gen forests and cities.

    CFS3 Terrain SDK (available here in Patches and SDK sticky thread) has mksm.exe tool that converts .m3d into .sm (and you can export m3d in gmax). Its parameters are explained in SDK docs, but I haven't used it and have no idea how it works.

    One quirk of my shaders is that they don't support additional texture sheets for auto-gen scenery.
    Stock CFS3 and WOFF/WOTR use single texture sheet (called ScenerySheet01.dds in CFS3 and ScenerySheetWWI.dds in WOFF), but SDK hints that there can be more than one. I didn't know it and coded shaders to always use just one texture. Although it seems nobody really tried to add multiple sheets, so I'm not even sure the stock CFS3 renderer supports it.
    What it means is that even if you add new objects you can only reuse textures from the existing scenery sheet which seems a bit inconvenient for modding.

    Also keep in mind that CFS3 is VERY inefficient when rendering auto-gen objects.
    Instead of "instancing" these objects as modern engines do, it clones and transforms them entirely on the CPU and then sends large amounts of data to GPU every time a chunk of scenery goes in or out of view. So if you have a 1000 trees of 100 vertices each you'll get 100,000 vertices to be processed by the CPU. I suspect this is one of main reasons for stuttering (though I haven't thoroughly tested it).

  5. #5
    Quote Originally Posted by AnKor View Post
    SM is "scenery model". Used for auto-gen forests and cities.

    CFS3 Terrain SDK (available here in Patches and SDK sticky thread) has mksm.exe tool that converts .m3d into .sm (and you can export m3d in gmax). Its parameters are explained in SDK docs, but I haven't used it and have no idea how it works.

    One quirk of my shaders is that they don't support additional texture sheets for auto-gen scenery.
    Stock CFS3 and WOFF/WOTR use single texture sheet (called ScenerySheet01.dds in CFS3 and ScenerySheetWWI.dds in WOFF), but SDK hints that there can be more than one. I didn't know it and coded shaders to always use just one texture. Although it seems nobody really tried to add multiple sheets, so I'm not even sure the stock CFS3 renderer supports it.
    What it means is that even if you add new objects you can only reuse textures from the existing scenery sheet which seems a bit inconvenient for modding.

    Also keep in mind that CFS3 is VERY inefficient when rendering auto-gen objects.
    Instead of "instancing" these objects as modern engines do, it clones and transforms them entirely on the CPU and then sends large amounts of data to GPU every time a chunk of scenery goes in or out of view. So if you have a 1000 trees of 100 vertices each you'll get 100,000 vertices to be processed by the CPU. I suspect this is one of main reasons for stuttering (though I haven't thoroughly tested it).
    Ah I see. Thank you.

  6. #6
    How do I actually run the tool? I can see a 'usage' line and can understand I'd put the target fielname and things in, but how is this run, is it as a batch file somehow?

  7. #7
    Here's what I found out (maybe someone here actually used the tool and can tell better).

    First, for WOTR you can find "assets\ScenerySheet01.xml". It contains a list of texture names which are present on texture sheet. Your M3D must use only these texture names. I believe the contents of your textures doesn't matter at this point - only the name. But for modeling you probably should crop the required cell from texture sheet and save it as standalone texture with corresponding name.
    The game engine will use texture name from your model and XML file to find actual texture image in the existing texture sheet dds.

    Now, let's say you want to replace "Coniferous01.SM" tree model.
    What you need to do (for WOTR) is copy your m3d into the folder where mksm.exe resides and run:

    mksm.exe Coniferous01.sm YourTreeModel.m3d C:\FolderWithTextureUsedByYourModel\ ScenerySheet01.xml

    For convenience you can make a .bat file containing the above line and run it.
    This will create Confierous01.sm in the same folder as the tool.

    You MUST provide a path to your texture files used by your m3d, but of those files only the name matters.

    ScenerySheet01.xml describes to the game how to find a corresponding texture in the atlas. So if you use Coniferous1.dds texture in your model, it will be mapped to the first (upper-left) cell in the ScenerySheetWWII.dds because Coniferous01 is the first in the list inside the xml file.

    I've just successfully converted a stock CFS3 watertower.m3d into a tree replacement SM, but since its texture is not in the list it appears with a wrong one in game.

  8. #8
    Quote Originally Posted by AnKor View Post
    Here's what I found out (maybe someone here actually used the tool and can tell better).

    First, for WOTR you can find "assets\ScenerySheet01.xml". It contains a list of texture names which are present on texture sheet. Your M3D must use only these texture names. I believe the contents of your textures doesn't matter at this point - only the name. But for modeling you probably should crop the required cell from texture sheet and save it as standalone texture with corresponding name.
    The game engine will use texture name from your model and XML file to find actual texture image in the existing texture sheet dds.

    Now, let's say you want to replace "Coniferous01.SM" tree model.
    What you need to do (for WOTR) is copy your m3d into the folder where mksm.exe resides and run:

    mksm.exe Coniferous01.sm YourTreeModel.m3d C:\FolderWithTextureUsedByYourModel\ ScenerySheet01.xml

    For convenience you can make a .bat file containing the above line and run it.
    This will create Confierous01.sm in the same folder as the tool.

    You MUST provide a path to your texture files used by your m3d, but of those files only the name matters.

    ScenerySheet01.xml describes to the game how to find a corresponding texture in the atlas. So if you use Coniferous1.dds texture in your model, it will be mapped to the first (upper-left) cell in the ScenerySheetWWII.dds because Coniferous01 is the first in the list inside the xml file.

    I've just successfully converted a stock CFS3 watertower.m3d into a tree replacement SM, but since its texture is not in the list it appears with a wrong one in game.
    That's great thanks, very helpful. I'll have a play around. If I do actually make changes the plan is to simplify some buildings to try and reduce the drain on things.

    I had found all the texture/atlas parts already, but knowing where to place the batch file saves me a lot of hassle thanks.

  9. #9
    SOH-CM-2020
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    63
    Posts
    2,896

    .sm models

    Hi ChiefWH,

    Pat Pattle has made some houses and churches but he made .m3d models not .sm ones and they go in the buildings folder. Unfortunately he is taking a CFS3 break at the moment. One thing I'd like to know is whether any of the m3d models in the buildings folder (eg churches, houses etc) can be called in the lso/mos files to show up as autogen scenery? I suspect that is the case (eg. the bridges are all m3d models located in the buildings folder). No, I'd forgotten that bridges are actually called in the .lib file, not through the autogen process - boy, its a complicated process.

    I've been looking at the stock scenerysheet.xml and there are a couple of basic errors in it (to go with the typos in the sounds xml, the effects.xml, and the various vehicles and ships which I've uploaded corrections for). Can't remember all of them but IIRC the crops are treated wrong and I've edited the xml file in the hopes of getting some crops to appear in autogen. I get some weird linear shadows on the ground in places with Ankor's shadows so I don't know if that is the crop sm models showing up?

    I've also used a hex editor on some tree sm models to call different textures in the scenerysheet for some trees - with varying results. Most of the stock sm tree models call for a high res texture for close up, and a lo res texture for further out. I find the transition awkward and have tried to change all instances to the hi res texture - not sure how successful I've been because I tend to make a lot of changes at once, and some of the .sm models pull a sickie and I have to replace them with an original version before the game will run.

    So if you introduce some new sm models and the game won't start (with no message as to what is wrong) I find that removing the changed sm model fixes the problem.

    Adding textures to the scenerysheet is not too hard, as long as they are in exactly the same size/format. The scenerysheet.xml specifies the size up the top IIRC. WOTR uses a much higher quality than stock scenerysheets.

    @Ankor, thanks for the nice summary of using mksm.exe. I will file it away for a rainy day

  10. #10
    Thanks agian, I was to substitute in one of the pre-existing 3d models myself, that gives me plenty to play around with when I have the time.

  11. #11
    SOH-CM-2020
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    63
    Posts
    2,896
    Hi ChiefWH, I provide a link to a folder of guides and examples which will help a lot I hope. The file for .sm modelling is MKSM Test Folder.zip

    http://www.mediafire.com/folder/bzb1...u4zjzgs/shared
    Last edited by Daiwilletti; August 26th, 2019 at 23:08. Reason: added link

Members who have read this thread: 0

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •