Results 1 to 30 of 33

Thread: Guide: Editing battlemap buildings

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Lightbulb Guide: Editing battlemap buildings

    Modding Resource Header

    Title: Guide to editing battlemap buildings
    Posted by: Duke John
    Modding area: Buildings (battle map)
    Required programmes:SceneMainTool, 3DS Max, Vercingetorix's CAS extractor, Vercingetorix's X-Pak, an image editor capable of editing .DDS files (such as PS or PSP), Notepad (or other text editor)
    Related links: xpak Tutorial, Modelling New 3D Units for RTW-useful modelling guide
    Summary: This tutorial explains how to edit the buildings that appear in battle. It requires some knowledge of modding the game and modelling. Like all modelling in Rome it requires 3ds max.
    __________________________________________________


    One of the last few hindrances has been crossed as we are now able to edit battlemap buildings:


    This guide will start on a higher level, since I do not want to spend the time at the moment to make a thorough guide. However since the discovery is so important for other mods I will write some quick pointers so that experienced modellers/modders will know what to do. I spent 4 days trying to find out how it all works and I would really appreciate if someone would take the bother to explain things more detailed as they start to understand how it works.


    Preparation
    Unpak in this sequence: battle_open.pak -> models_buildings_textures.pak -> patch_0.pak. Then delete/rename these packs.

    Download the SceneMainTool from http://www.deep-shadows.com/hax/ follow instructions (use the right version!) to install.

    The files
    There are the following files you need to keep in mind when editing buildings:

    Data\items\building_name.item
    You can import this with Vercingetorix's tool. The export function does not work as it will make the file unreadable for R:TW.

    Data\models_building\building_name_LODlevel.cas
    Place here your edited buildings. Once converted they are no longer used.

    Data\models_building\textures\texture_name.tga.dds
    Just a texture for the building. R:TW buildings mostly use tiled textures, but I have experienced some loss of materials when exporting, so I use a single material/texture and use UV mapping.

    Data\settlement_plans\building_group.txt
    Open a txt file and notice that it contains a list of item names with coordinates (x,y,z) and rotation. Not important for editing buildings, but every building or building group you see in R:TW is written out in these txt files.

    There are some more folders in settlement_plans and they deal with pathfinding, texturing of the ground, etc.

    Data\descr_building_battle\dbb_.txt
    Only important (for me at this moment) if you want to make buildings passable by troops (they can walk through walls)
    Code:
    	generals_stake_fence
    	{
    		stat_cat indestructable
    		localised_name none
    		no_shadow
    		level
    		{
    			min_health 0
    			battle_stats
    			item		generals_stake_fence
    			physical_info	none
    		}
    	}
    By setting physical_info none there is no BPI file that the game checks. The BPI files contains physical data about the boundaries of the buildings and probably things such as where soldiers can enter towers, stand on walls, but that is just speculation since BPI files cannot be modded at the moment.


    Importing and exporting a building
    I do not go into how to model a building, so for starters I will just explain how to import and export the building. Import an item you wish to edit. Remove all lower LOD levels, LOD1 is the highest level and keep that. Ungroup LOD1.
    Then edit the model just so that it looks a bit different (move a single vertice), you will then know in R:TW that you are seeing your edited model.

    Then use the SceneMainTool. The result is a scene root that you need to rename to Scene Root. If you look at the Schematic View you will see that all meshes (name of the meshes is not important by the way) are linked to the Scene Root. If not then link them.

    Then export the building as CAS, use the exact same name as the item and then add the LOD levels. Some buildings only have 2 LOD levels others have 3 or 4. (If you want to know exactly which LOD levels the engine requires skip the saving of the CAS files and go on.) Commonly used LOD levels are: _HIGH, _MED, _LOW, _LOWEST, _VERY_LOW. For example ABANDONED_HOUSE needs the following CAS files:
    ABANDONED_HOUSE_HIGH.CAS
    ABANDONED_HOUSE_MED.CAS
    ABANDONED_HOUSE_LOW.CAS
    ABANDONED_HOUSE_LOWEST.CAS
    Save them all in Data\models_building.

    Next you need to delete the ITEM in Data\ITEMS as the engine will convert the CAS files to a single ITEM when loading the game/battle.

    That should be all. If there are questions that show that you have put thought into it but still cannot get it work then feel free to ask. If not then try harder

    Cheers,
    Rob
    Last edited by Myrddraal; 07-26-2005 at 11:06.

  2. #2
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Guide to editing battlemap buildings

    Does this enable to build all new buildings, or just edit the way old ones look?
    I'm still not here

  3. #3
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Guide to editing battlemap buildings

    This guide is only about editing, that is why I wrote "Guide to editing battlemap buildings"

    I think we are very close to making new buildings, but I haven't tried it out at all. The game also makes BPI files if there aren't any, but it does not contain boundary information so units can walk through the walls. To be able to add new buildings you probably need to add some text entries, edit the descr_items.db and an entry in descr_building_battle\dbb_.txt. But that is all guessing since I do not know what the errors are when adding new buildings.

  4. #4
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Guide to editing battlemap buildings

    Just to make sure: is my guide not readable or is there just no interest in this? With all the conversions around I would have expected a bit more reaction.

  5. #5
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Guide to editing battlemap buildings

    Everyone is just busy quickly editing their buildings :)
    (or maybe most mods are only at stage of editing units, and didn't yet get to that part? We at EB surely appreciate that. I just hope Verci can make adding new buildings possible based on that)
    I'm still not here

  6. #6
    Vermonter and Seperatist Member Uesugi Kenshin's Avatar
    Join Date
    Nov 2004
    Location
    The Mountains.
    Posts
    3,868

    Default Re: Guide to editing battlemap buildings

    This is great info to have Duke John, thanks for figuring it out. Over at CTW we are too busy editing units, making unit lists, making the map and doing all sorts of miscellanious planning to be4 able to do any building editing yet.
    "A man's dying is more his survivor's affair than his own."
    C.S. Lewis

    "So many people tiptoe through life, so carefully, to arrive, safely, at death."
    Jermaine Evans

  7. #7

    Default Re: Guide: Editing battlemap buildings

    Quote Originally Posted by Duke John
    Preparation
    Unpak in this sequence: battle_open.pak -> models_buildings_textures.pak -> patch_0.pak. Then delete/rename these packs.
    Hello there.
    Trying to export a modded building, I am having troubles from that very first step.

    I unpacked those .pak files then renamed then and put their content in DATA folder, then I made some tries to see if worked, but game crash when I start a new campaign.

    No modded building added yet: just their original packed contents.

    Making some tries I found out that the critical file is patch_0.pak. If I name it back game works.

    So my question is: why patch_0.pak can't be unpacked?
    anyone else having that problem?
    anyone having some hints about what I'm doing wrong?

    Thanks in advance.

  8. #8
    Bassist, God and Modder Member Thor the Bassist's Avatar
    Join Date
    Jan 2008
    Location
    Yorkshire, England
    Posts
    213

    Default Re: Guide: Editing battlemap buildings

    I believe that you can mod the unpacked folders without having to rename the pak files.

    Have you put on all the patches that have been released on the game because I think that opens up the game and stops it being limited to the pack?

    Also I think I would start putting your work in a mod folder as this removes the problem of paks.

    Building for the Future of METW

  9. #9

    Default Re: Guide: Editing battlemap buildings

    Quote Originally Posted by Thor the Bassist
    I believe that you can mod the unpacked folders without having to rename the pak files.

    Have you put on all the patches that have been released on the game because I think that opens up the game and stops it being limited to the pack?

    Also I think I would start putting your work in a mod folder as this removes the problem of paks.
    I am working on a 1.5 RTW with alexander expansion and LOTR-TW mod installed.

    The game I start is LOTR-TW campaign, with Alexander ex:
    RTW folder\ex-ALX.ex -mod:alexander/ex -show_err

    The folder three is:
    RTW folder/Alexander/ex/data (..)

    original Packs are in
    RTW folder/data/packs

    I put the unpacked files from packs in
    RTW folder/data

    In pack folder are:
    battle_open.pac
    models_building_textures.pac
    (already unpacked and renamed,game works)

    patch_0.pac.
    (damn one)

    patch_1.pac.
    (already unpacked and renamed, game works - so i repacked it)

    uh_0.pac
    uh_1.pac
    game_int.pac
    models_unit_textures.pac
    sprites_0.pak
    sprites_1.pak
    (untouched)

    If I unpack patch_0.pak and rename it, game CTD near half loading campaign map - no error message. If I name it back in pack folder, game works.

    BTW, before unpacking packs I kept a copy of all original folders in
    RTW folder/data/
    so if needed I can put them back as in initial state.

  10. #10
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: Guide: Editing battlemap buildings

    are you sure you're actually unpacking the patch_0.pak ?

    I don't think it was in verc's unpacker .bat file by default as it came with a patch that was later than the unpacker.

    If you're not sure, rename the .bat file to .txt and have a look to see what's being extracted.


    Anyway Thor is right, you shouldn't need to delete the packs.

    Safest method is unpack them to the default folder - data/packs/data and leave any contents you don't want to change there for reference.

    Then make any changes to copies of those files and put them in mod-folder. (in your case add changes to the alexander/lotr folder)
    Last edited by Makanyane; 04-06-2008 at 21:32.
    Not used mods before? Looking for something small and fun?!
    Download the:

  11. #11

    Default Re: Guide: Editing battlemap buildings

    Quote Originally Posted by Makanyane
    are you sure you're actually unpacking the patch_0.pak ?

    I don't think it was in verc's unpacker .bat file by default as it came with a patch that was later than the unpacker.

    If you're not sure, rename the .bat file to .txt and have a look to see what's being extracted.

    Anyway Thor is right, you shouldn't need to delete the packs.

    Safest method is unpack them to the default folder - data/packs/data and leave any contents you don't want to change there for reference.

    Then make any changes to copies of those files and put them in mod-folder. (in your case add changes to the alexander/lotr folder)
    Well of course first thing I did was to make my own .bat file to unpack the fiels I need to. So, yes, I am positive I unpacked patch_0.pak. Actually, I unpacked it about ten times during my tries.

    What I'm missing is why the game may crash if I rename the pack - once all its contents have been unpacked and are available in data folder.

    The reason why I was renaming that pack is that I read that to have the game creating your own building from my newly made .cas files it must not have original sources to find - or it will just ignore the .cas files.

    Given I have my new ROMAN_IMPERIAL_PALACE.cas files ready, the idea was to have them rebuilded by the game engine in a new ROMAN_IMPERIAL_PALACE.ITEM file.

    But if I try to make it, game CTD during campaign loading, and there is no ROMAN_IMPERIAL_PALACE.ITEM made.

    :(

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
  •  
Single Sign On provided by vBSSO