PDA

View Full Version : Guide: Editing battlemap buildings



Duke John
03-21-2005, 12:31
Modding Resource Header

Title: Guide to editing battlemap buildings

Posted by: Duke John

Modding area: Buildings (battle map)
Required programmes:SceneMainTool (http://www.deep-shadows.com/hax/), 3DS Max, Vercingetorix's CAS extractor (http://dlx.gamespot.com/pc/rometotalwar/moreinfo_6112407.html), Vercingetorix's X-Pak (http://www.twcenter.net/downloads/db/?act=mod&id=43), an image editor capable of editing .DDS files (such as PS or PSP), Notepad (or other text editor)

Related links: xpak Tutorial (https://forums.totalwar.org/vb/showpost.php?p=643512&postcount=4), Modelling New 3D Units for RTW (https://forums.totalwar.org/vb/showthread.php?t=39733)-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:
http://upl.silentwhisper.net/uplfolders/upload8/sj_tenshu.jpg

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)

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 :wink:

Cheers,
Rob

eadingas
03-21-2005, 14:47
Does this enable to build all new buildings, or just edit the way old ones look?

Duke John
03-21-2005, 14:57
This guide is only about editing, that is why I wrote "Guide to editing battlemap buildings" :wink:

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.

Duke John
03-24-2005, 06:44
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.

eadingas
03-24-2005, 08:39
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)

Uesugi Kenshin
03-25-2005, 04:25
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.

PROMETHEUS
03-25-2005, 20:45
DIDN'T WORK , THERE IS SOMETHING ELSE THAN MAY BE IS MISSING ....


that is what I did....


Importing the building ABANDONED_HOUSE.item

I Removed all lower LOD levels,

I keep LOD1 and I Ungroup it


while deleting -renaming the pack files simply causes a ctd.....


Then I edited the model just so that it looks a bit

Then I used the SceneMainTool. and I renamed to Scene Root.
all meshes are linked to the Scene Root.

Then I export the building as CAS, using the exact same name as the item like ABANDONED_HOUSE.CAS and then Export it as

ABANDONED_HOUSE_HIGH.CAS
and
ABANDONED_HOUSE_low.CAS

since the original item had only 2 lods
I then Saved them all in RTW\Data\models_building.

Next I delete the ITEM in RTW\packs\Data\ITEMS

since there is no item folder in the data directory of the gaeme , even tring to adding it didn't change anything ....

Something went wrong? the game keeps loading always the same house....

Duke John
03-29-2005, 05:35
Prometheus
It seems to me that you do not understand how PAK files work. R:TW looks into those ZIP-like files for certain files. If the files are not present in the PAK then it will in the normal directories.

So if an item is normally located inside a PAK with the following path:
ITEMS\

Then if you delete the pack then R:TW will look for it in:
R:TW - INSTALLATION FOLDER\DATA\ITEMS\

So while you deleted the PAK you didn't place the files/folders into the data directory -> R:TW can't find the files -> CTD.

PROMETHEUS
03-30-2005, 09:55
Well Actually I unpacked, then I copied those files in the DATA|folders needed and then deleted the pack , if this is the only problem that could cause the ctd I willtry one more time , may be I have made an error somewhere....

Duke John
04-14-2005, 09:25
If you want to use textures with an alpha layer then add ## in front of the name. See buildings/textures (extract the pak) for some examples. All textures in that directory that start with ## have an alpha layer.

Vercingetorix
05-01-2005, 02:32
Nice tutorial! Only problem is the game is not creating a BPI file, if it would it would create it in data\models_building\info right?

edit Nevermind I figured it out, just use one of your .cas files where it says physical_info.

edit 2 We all live in a big teapot, big teapot...
http://img258.echo.cx/img258/9461/teapot3vt.th.jpg (http://img258.echo.cx/my.php?image=teapot3vt.jpg)

PROMETHEUS
05-01-2005, 08:44
Nice tutorial! Only problem is the game is not creating a BPI file, if it would it would create it in data\models_building\info right?

edit Nevermind I figured it out, just use one of your .cas files where it says physical_info.

edit 2 We all live in a big teapot, big teapot...
http://img258.echo.cx/img258/9461/teapot3vt.th.jpg (http://img258.echo.cx/my.php?image=teapot3vt.jpg)


W"hat do u mean , can u explain what is a bpi what about physical info?

SigniferOne
07-11-2005, 09:54
Ok this is strange, when I follow your steps and export an ITEM file into a CAS file (without even any modifications, just to test it out), and then import that CAS file, it shows up completely covered up by the very first texture in the material editor, as if it somehow replaced all other textures in the model and they are no longer used. Anyone else encounter this behavior?

Lord Adherbal
07-11-2005, 10:04
verci's CAS exporter doesnt support multiple texture files.

SigniferOne
07-11-2005, 10:07
Okay.. right... so how do you export a building ITEM into a CAS and still keep all of its textures?

EDIT: Or in other words, I haven't done this before and am now trying to figure out how to modify buildings for the first time, and all steps work properly except that all of the building's textures get lost, other than the very first one. I can see in your mod you were successfully able to edit buildings and still retain all of their textures, so perhaps you could help me out here.

SigniferOne
07-13-2005, 04:49
Well?

Lord Adherbal
07-20-2005, 15:08
I used only one 512x512 texture for each of my building models. I've asked Verci to consider adding multiple texture support for the CAS exporter, because that would be very usefull for larger buildings.

hoggy
08-20-2005, 10:14
Just delving into the world of battle map buildings. Excellent tutorial DJ! As usual leading the way. Got it working but a quick question on collision for Vercingetorix or anyone who can help.

- you mention to put your cas where it says physical_info. Where does it say physical_info? I open the bpi's and get nothing but garbled rubbish. Hope you can help

PROMETHEUS
09-23-2005, 05:54
Preparation
Unpak in this sequence: battle_open.pak -> models_buildings_textures.pak -> patch_0.pak. Then delete/rename these packs.

Ok I finally got paste this thanks to the help of Khelvan explaining me the bat file ....

The error I was making is to follow on the letter the instructions in the Verci tutorial but to make this work and get no CTD they have to be unpacked one by one in exactly the same sequence that DJ wrote ...

unfortunately not everyone is familiar with how or what a bat is or does so I had to get this explained me by Khelvan , then after having understood I remade the DJ step in exact sequence and it worked with finally no ctd ....

the exact procedure is to create a new bat file for each unpacking ..... that is the procedure...

1
open a text file

inside of it open the pack.bat

there will be some lines delete everything that is not a command and preserve the name of the pack u have told by DJ , then save it as a name u like but remember to save it like something.bat ...
then run this bat , repeate the procedure for all other packs and then you can continue the tutorial , but before deleting copy thoise new files that are in the newly created data folder to the upper direct RTW/DATA folder , now you can delete the pack files selected and keep continuing with the tutorial ......

This tutorial was good but lacked this aspect that I hope is now more clear not everyone is familiar with command dos and bat files , so here it is ..... ~:)


and so here a very very succesfull experiment....

https://img396.imageshack.us/img396/561/16ia1.jpg

PROMETHEUS
09-23-2005, 06:42
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.

Has this been solved ? is possible to make for example a curved shape for a bridge so that the soldiers rise over it instead of walking along it streight like they do normally?

Lovasìjász
10-04-2005, 03:30
Has this been solved ? is possible to make for example a curved shape for a bridge so that the soldiers rise over it instead of walking along it streight like they do normally?
There is no speculation about this.
It is true and tested for walls. Let's say you are editing a small stone wall and you are using a large stone wall's physical info. if you would place the spot_fx on it (the banners/flags on the wall), the spot_fx would stick out of the air, where the large stone wall's flags suppose to be, and also the soldiers standing above the gateway would be in the air as high as the large_stone wall.

Since this is no problem in RTW, because by default all walls are roman, but let's say you enable some walls which are disabled and different in a shape than a roman wall (hint: egyptian wall) , then it's still a problem because the egyptian small stone wall middle section isn't walk-able and also lower than the roman wall, so the soldiers again, would be standing in the air. Not to mention, many info.bpi files are not finished and not correct, since the greek gateway won't work with its own info file, only with the roman version.

so i'm still searching for answers for these bpi files, as it shows no coherent text. what would open these?

PROMETHEUS
10-05-2005, 00:39
To solve ur problem and add all the walls u just need to edit the walls u are adding to the same level of grounds for soldiers of the roman walls , I know this is not a perfect solution but a perfect trick to avoid the floatings ;p contact me on messenger and I will tell u better ....

killerxguy
12-12-2005, 16:34
Nice toturial! It would help mods make new settlement plans and new walls and stuff, very impressive. Nice teapot verci ;), nice far east building PROMETHEUS !

Hey do building have skeletons and vertex weihging and stuff or are they easier than making unit models?

Seth Krn3ll
04-06-2008, 19:08
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.

Thor the Bassist
04-06-2008, 20:22
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.

Seth Krn3ll
04-06-2008, 21:24
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.

Makanyane
04-06-2008, 21:31
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)

Seth Krn3ll
04-06-2008, 21:43
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.

:(

Makanyane
04-06-2008, 22:08
apologies - I wasn't sure how far you've got with any of this before... so might still be telling you things you already know :embarassed:

I thought .items were only in the buildings pak, but not 100% sure...

anyway to get game to make new item you need in the mod folder a
descr_items.txt but no descr_items.db
that causes the game to try and make the .items from any .cas it can find and also re-make the .db file - I think you need alpaca's vanilla descr_items.txt file to start with and add your additions, that method I think was found to be easiest one. https://forums.totalwar.org/vb/showthread.php?t=60818

to make the game look for your new .cas and not the old one you can path the descr_items.txt to another folder, to generate stuff for eod2 I used.


type roman_town_wall_joiner_diagonal
lod
max_distance 4000.0
model_rigid ../../bi/eod2/data/models_building/roman_town_wall_joiner_diagonal.cas
which will make it look in the mod folder even if a .cas with same name exists in the packs.

You start the game once with the items.txt file and you get a whole string of error messages while it tries to find the .cas files (which aren't actually included in packs anyway, CA only sent .item files for most things) it will make a new .db file and your new item. (you should probably make an /items folder in your mod-folder first) and a load of junk items for the vanilla .cas it can't find.

You then need to combine your new item, with all the old valid .items from the paks in a /items folder in your mod-folder. All the items have to be in same folder.

Seth Krn3ll
04-06-2008, 23:38
Done :)

I workarounded the damn patch_0 file, just modding an ITEM which was not included in patch_0.pak file :)

So now I have my orthanc tower in my settlement:
http://digilander.libero.it/krnell/lotrmod/in-game-orthanc2.jpg


But still there are some weird flaws:
1. at least two of the objects of the tower are just missing at all. How come?
2. at ground level meshes are flickering, I guess its because they are at very same level as ground, maybe I'll have to use boxes instead of planes.

http://digilander.libero.it/krnell/lotrmod/in-game-orthanc.jpg

http://digilander.libero.it/krnell/lotrmod/in-game-orthanc3.jpg

http://digilander.libero.it/krnell/lotrmod/in-game-orthanc4.jpg

Anyway, I go on with experimentation :)

Wundai
04-11-2008, 09:55
Hey All,

So here's my problem then :)
(I hope it belongs in this topic)

I have made a building and cassed it.
I also edited the descr_items.txt already for it to be put ingame, then when I try to export the building as .item file it gives me this error:

if $LOD_1!= undefined and isGroupHead $LOD_1 then

(for i=1 to $LOD_1.children.count do append lod1_group $LOD_1.children[i].namelodcount+=1)

Any idea's?

(If this has something to do with LOD levels it would be strange because I succesfully itemized quite some buildings already without this error.)

thanks for any help :beam:

Thor the Bassist
04-17-2008, 18:02
Export as a cas not an item. The game creates the item automatically.

Wundai
05-05-2008, 21:44
Sorry for the late reply Thor, thanks for your answer!

The building I was trying to make an item of though was an item file that was already ingame, a Roman House kind of building if I remember correctly.

Strangely enough though exporting it as item worked the next day when I started 3dsmax again, so it was solved :beam:

Well thanks for your help in any way :2thumbsup: