PDA

View Full Version : Creating or Modding Building Models



Seth Krn3ll
04-02-2008, 14:53
I am working to improve the wonderful LOTR-TW mod by Wlesmana (http://lotrtw.com)

I made some minor addings and moddings, but now I would love to go for something more significant, that is creating custom building models to be present in battle mode inside the cities.

Adding new buildings to txt files its fine and it works perfectly, both if you use names of vanilla games buildings or if you just add new ones.The lotr-tw mod already uses some new buildings and I added a few by myself.

So the txt phase is ok, I can totally manage it. What I’m looking for is just the 3d models for the battlemap.
First thing let me admit I’m a TOTAL newby for modding models, so, here are my questions:

1. There is any tutorial for real beginners to create 3d building models? If so please give me the links, I’ve found some but they suppose the reader to be already experienced and I lost myself there.
2. Is it possible to use already modded buildings and add them to my mod? Are there any building bd available for download around?
3. Another way – maybe easuer – would be to just change the textures of existing models: are there tutorials to help me finding the right textures to modify?
4. If it all will be too hard for me, maybe some experienced modders is interested in helping me to create some new building for the specific cultures of lotr-tw mod? I was thinking to start with some orc-specific buildings, with orchish textures and appearance. I’m good at graphics, so I can create nice textures, but have no exp on 3d modeling.

Thanks in advance for your help.

Thor the Bassist
04-03-2008, 17:34
Hi. I'm doing buildings for METW currently and one thing I'd say is that it takes a long time when you get immersed in things like accurate helms deep sets (very long story lol).

What I'd advise is getting some 3d modelling software (3dsmax gmax etc) and find a .cas exporter/importer plugin for it (I would advise Vercingetorix script for 3ds max). Then you can begin modelling and there is no possible way you can make any buildings before you have made a model to work with.

This is basically how the game works things out:

descr_building_battle.txt (or battle_building i forget which) has a full list of all buildings which appear on the battlemap. From here it specifies two basic files which describe the building in detail aswell as specifying things such as health and flamability. You will notice that most mods use an "include dbb_x.txt" entry in the actual file and then make a new folder in the descr_battle_building folder.

The item entry in here is the .item file. This is created directly from the .cas file you have created and is the aesthetics of the game (basically what you see). All the items are listed in the desrc_items.txt and creating this file is rather complicated but is documented in the scriptorium by Alpaca.

The physical info entry is the .bpi file. This is also created from a .cas file but is slightly different and has specific geometries related to collision with soldiers, platforms for soldiers to stand on and tunnels for soldiers to walk through. If you search collision in this forum you will find a thread made by Duke John called Research:... This has a full list of allowed geometries (that is known about).

If you can create just the item file you can have a model in the game but you will require a bpi file to make it solid and make it so soldiers cannot run through it.

I hope this makes things more clear. I know there is a lot to take in but it becomes clearer if you jump in and try.

I also may make a tutorial (similar to this but bulked out) and put it in the scriptorium on getting started with building models.

Flying Pig
04-03-2008, 18:04
Please do! Can you do that to port a BI building to RTW; ie to give Parthia (or in my case the Persian Empire) barracks to found warrior guilds and Immortals? Also, barbarian stone walls, how does one go about that (I'm thinking stratmap as well)

Thor the Bassist
04-03-2008, 22:09
Well I'll have to think out the tutorial more that was a bit off the cuff. I think you can port any building you want, that is the physical side of it and the looks of it. I'm not sure about recruiting and how it works in strategy map terms I have simply been doing it for Middle Earth Total War so there has to be accurate environments for battles so we dont need the upgrading buidings.

I suppose you need to say what you mean by port. If its giving the stats and recruiting options then I dont know about that but I do know about the battlemap models and the physical collision info. This is, however, really useful for fantasy mods as it allow the normal battlemap models to be changed for more appropriate models - such as accurate Rivendell and Helms Deep sets for metw.

EDIT: I'm sure you can port the building stats but I dont know anything about it. All I know about is making battlemap models and the physical info that is required for them to operate in battles.

Flying Pig
04-04-2008, 20:16
For stats just ctrl-c the relevant tree from EDB

Thor the Bassist
04-04-2008, 20:32
Actually the porting of models is easier than making new ones as you can just transfer the .item files and .bpi files as there is no difference between the game versions. You just need to add the new references in the text files and add references in the settlement plan you want the building in.

Seth Krn3ll
04-05-2008, 08:37
Ok i'm making experiments with 3dmax.
I learned how to create objects and paint them, but I can't understand what is needed to work for RTW buildings models.

For instance, how "lods" work?

Anyone soooo kind to post a quick step-by-step tutorial to mod buildings with 3dmax? I found many tutorials around but they are all on modding units.

Thor the Bassist
04-05-2008, 14:34
First for 3dsmax you need the import/export script (http://www.twcenter.net/forums/downloads.php?do=file&id=141) written by Vercingetorix. This will allow you to export from max into the .cas file format used by everything you need in RTW buildings.

Basically you need to make the model for the building first in max and apply the textures. RTW was the first game I used max for aswell and I took ages trying to find the maxscript menu. If you look at the right hand panel of instruments and take the right most selection at the very top of this panel one of the buttons that drop down should say "maxscript". If you click on this and then on "run script" you will then get the open dialogue so you can open and run vercingetorix's script. You then have to select the "cas import/export" from the drop down menu that originally says convert lighting or something like that. You will then get a selection of commands. Clicking on "Export cas" will export the current scene to a cas file of your choice.

One thing I'd advise is not to import items with the script and then use them in the export because all the lighting and textures goes wrong and you end up with totally black buildings instead of textures. You can import items and then re-make the geometry but for some reason if you use the imported item geometries it doesn't work - you can use imported cas files. Also the export item button doesn't work with the game.

LOD's are saved as separate cas models although I have to admit I seldom use LOD's as I prefer moving on to new buildings though I suppose I must go back and change this at some point.

As I said previously the game reads .item files for buildings and one .item file stores all the LOD info in itself for one building model so there is no need for separate ones. The full database of all items in the game is in descr_items.db and this isn't editable but by deleting it and editing the decompiled version descr_items.txt the game will create a new descr_items.db with your new entries in. Check out this (https://forums.totalwar.org/vb/showthread.php?t=60818). One thing I will say about point 8 is that you should kill the game or it will overwrite all your item files so make sure you have show_err on and when the error arrives press ctl-alt-delete and end task on RTW.

The entries in descr_items.txt go in this format:

type your_building_name
lod
max_distance max distance lod will be seen
model_rigid your building cas file for this lod
for example:

type roman_tenamentA
lod
max_distance 200.0
model_rigid roman_tenamentA_high.CAS
lod
max_distance 400.0
model_rigid roman_tenamentA_med.CAS
lod
max_distance 800.0
model_rigid roman_tenamentA_low.CAS
lod
max_distance 4000.0
model_rigid roman_tenamentA_lowest.CAS

I hope this helps. If you need any more info post and I'll help out.

Seth Krn3ll
04-05-2008, 16:42
Thanks a lot Thor.

I tried and created a Tower (Orthanc, actually), but if I try to export it as .cas with Verci's script it says a root scene is needed.

I found around in forums that the root scene can be made with SceneTool plugin but the only version of SeneTool I Found does not work with 3Dmax9.

How can I create the Scene Root?

http://digilander.libero.it/krnell/lotrmod/orthanc.jpg

Nelduin
04-05-2008, 16:53
Great work !!!
You and Thor will make a really great work ! :2thumbsup: :smitten:

Seth Krn3ll
04-05-2008, 18:02
Guess I'm stuck at that missing scene root :(

I tried importing the original roman_imperial_palace.item and then trying to export it as a .cas and it keep saying

"cannot export without the scene root bone. Verify it exist."

I just imported it as it was on a clear project, no touching at all, so I guess I'm missing something somewhere.

Anyone may help?

Thor the Bassist
04-05-2008, 18:28
I meant import a cas file like roman_archer.cas not an item and it will give you a scene root among other geometries.

Unless someone knows the proper way which I'd be interested in aswell.

Seth Krn3ll
04-05-2008, 22:34
Thanks to the patient help by Thor, another step is done :)

Now I do have that damn scene root thing in my tower, but when I try to esport it says "Mesh 12 must have a bone as its parent"

My question then is: How to make bone as parents?

http://digilander.libero.it/krnell/lotrmod/orthanc2.jpg

Seth Krn3ll
04-07-2008, 08:40
Finally!

Orthanc has a tower :)

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

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

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

Myrddraal
04-07-2008, 11:57
Very nice texturing right there. It looks fantastic! I'd love to see some close in shots.

Seth Krn3ll
04-12-2008, 06:48
Some views on my working-on Isengard city :)

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

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

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

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

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

Aradan
04-12-2008, 11:40
These look very beatiful. Orthanc's texture and half-standing the orcish pits are great!

Myrddraal
04-12-2008, 15:28
Aren't the pits a little big relative to the tower? Looking good :thumbsup:

Thor the Bassist
04-12-2008, 16:21
Aren't the pits a little big relative to the tower? Looking good :thumbsup:

I think the tower could be a little taller not the orc pits smaller. Then again I proberably will always want a bigger tower :laugh4:

Lookin good.

Seth Krn3ll
04-19-2008, 11:00
Ok my orc buildings are going on nicely, excepted for the texturing problems (someone skilled should REALLY add a tutorial with steps, tips and tricks to effectively skin buildings).

The LOTR-TW mod uses original game building models, calling them differently and giving them in-game adequate capabilities (e.g., roman academic buildings are used as warg dens) so as a start I am just creating my models and saving them with the name of the original game items.

But I was wondering, why not creating completely new structures?
So i worked on the process and found out that there are many files implied in structure listing and ingame use of them. Here is a list of what I guessed by experience:

data\export_descr_buildings.txt
gives the game building three with all capabilities and specifics for each building in the campaign. Vastly explained in many tutorials around.

data\export_buildings.txt
here all buildings are given a text description which will appears in game.

data\descr_settlement_plan
very uiseful and important file: this one defines the single elements to be used in every city shown ingame. There are set association with every culture settlement single plans, groups of various building models to be shown in settlements and culture variations. I found no tutorials around to mod it, and even if its pretty easy to understand it I think that file deserves much more attention.

data\settlement_plans\city_type.txt
where "city_type" stands for each type of settlement in the game, forts and camps included. Those files are fantastic. There you define all building models to be shown in each kind of settlement. You can specify coords and type for all kinda objects, including walls. It can list only models already listed in descr_settlement_plan, so if you want to customize settlements a lot you will have to work on descr_settlement_plan too.

Data\descr_building_battle\bdd.*.txt
Those files are still partially obscure to me. Actually, I guess they enlist all 3d building models fo the game, being sort of reference for all other quoted files. Sounds weird to me that they are not organized for cultures or building type, like lets say "dbb_roman_buildings" but they are assorted with names (maybe the one of of guys who made the buildings models?) like:
"dbb_nicks_roman_buildings".
Anyway their function is pretty clear, but listing models they refers to some things I missed to find out. For example, by listing the shrine object:



shrine_round
{
stat_cat small_stone
localised_name shrine
level
{
min_health 1
battle_stats
item shrine_round
physical_info info _shrine_round.cas
}
transition default_large_stone
level
{
min_health 0
battle_stats
item roman_rubble_7_radius
physical_info info _roman_rubble_7_radius.cas
}
}

"stat_cat" obviously stay for statistic category , and small_stone will probably be the referenced material. I guess its about how the object reacts to lights or maybe to other factors like earthquakes.

"localised_name" puzzles me. Which list of names is referenced here? Anyone knows? In my tries to add new buildings, this point seem a trouble. I tried setting "none" but not sure if it works.

"level" opens a bracket and inside are defined the different states for the buildings, I guess when its up and when its destroyed.

Not sure what "min_health" defines, nor "battle_stats", maybe they refers to reaction to siege attacks.

"item" its clear, it refers to the item .cas file to search in the item directory, so it tells the program what item model to use for that building in game.

I guess "physical_info" refers to a hidden .cas file setting the collisions infos of the model, unfortunately I was not able to open the .BPI files in INFO folder but it may be workarounded by using info of some existing buildings with same dimensions of the custom one.

**

As far as now I have not been able to add a brand new 3d building to the game. All I can do is to modify an existing one and use its references inside all files.

I think an exhaustive tutorial on creating new buildings would be important and if anyone is able to add totally new buildings and want to write down a step by step on the topic I hope those infos may help.

Makanyane
04-19-2008, 11:44
Seth you seem to be talking yourself into doing the tutorial you requested yourself - well done :thumbsup:


"localised_name" puzzles me. Which list of names is referenced here? Anyone knows? In my tries to add new buildings, this point seem a trouble. I tried setting "none" but not sure if it works.
You can add a new name for something but it needs a look up added in data/text/building_battle.txt
(version of that file can be included in mod-folder.)

eg in the dbb file:
localised_name sacred_blood

you need
{sacred_blood} Sacred Blood
in the text file and you get a nice little hover message - instead of 'building' which is what 'ambient' used there gives you. If you use new 'localised_name' and don't put it in the text file you get straight CTD.

It doesn't matter which dbb file you add buildings to - but they must be in a dbb file or in
descr_building_battle.txt
itself - if you open that file you'll see if gives the list of all the dbb files which the game should read - its just a way of splitting up the files so you don't get one super long file with everything in.


You should be able to get totally new buildings in - other mods have and I did for eod2 (they are statues and odd totems etc, but game doesn't know they're not 'buildings') - what problem / error messages are you getting when you try new ones?

Seth Krn3ll
04-21-2008, 15:42
Seth you seem to be talking yourself into doing the tutorial you requested yourself - well done :thumbsup:

LOL would love to be so skilled to write down a tutorial, my ones are just ideas and weird tentatives :)



You can add a new name for something but it needs a look up added in data/text/building_battle.txt
(version of that file can be included in mod-folder.)

Wait: in my version of the game the data/text/building_battle.txt seems to be greatly outdated. Maybe export_buildings.txt works for that too? I see if I msis adding name, descr and descr short there game crashes.


It doesn't matter which dbb file you add buildings to - but they must be in a dbb file or in
descr_building_battle.txt
itself - if you open that file you'll see if gives the list of all the dbb files which the game should read - its just a way of splitting up the files so you don't get one super long file with everything in.
Perfect! That sounds great, so I will just include my own dbb files and not tounch the original ones.


You should be able to get totally new buildings in - other mods have and I did for eod2 (they are statues and odd totems etc, but game doesn't know they're not 'buildings') - what problem / error messages are you getting when you try new ones?
Ok, I made a try and followed those steps:

1. added a building "orthanc" in export_descr_buildings.txt with a single level and its features:

building orthanc
{
levels orthanc
{
orthanc requires factions { romans_brutii, } and hidden_resource orthanc
{
capability
{
happiness_bonus bonus 1
recruits_exp_bonus bonus 1
}
construction 1
cost 400
settlement_min town
upgrades
{
}
}
}
plugins
{
}
}
(of course I added a "orthanc" hidden resource and added it to the region where the tower is settled).

2. added "orthanc" to the list of primary buildings in descr_settlement_plan.txt , and also added a slot named "slot_orthanc", no variants:


slot slot_orthanc
{
default
{
orthanc, 0, 0, 0, 0
}
}

3. Added names to export_buildings.txt


¬--------------
¬-------------- Unique buildings made by Krn3ll for LOTR-TW
¬--------------
{orthanc} Torre di Orthanc
{orthanc_desc} Torre di Orthanc
{orthanc_desc_short} Torre di Orthanc
¬--------------

and to be sure also to building_battle.txt


{orthanc} Torre di Orthanc

4. Included a personal file to includes in descr-building_battle.txt:

;krn3ll adding
include dbb_krnell_orc_buildings.txt

5. in that new dbb_krnell_orc_buildings.txt added the new building:

orthanc
{
stat_cat large_stone
localised_name orthanc
level
{
min_health 1
battle_stats
item orthanc
physical_info none
}
transition default_large_stone
level
{
min_health 0
battle_stats
item roman_rubble_48x32
physical_info info_roman_rubble_48x32.cas
}
}
I temporary let "none" for collisions becasue I had not a suitable game model: the idea was to find one suitable later on.

6. added my orthanc thing to the orc_large_city.txt (settlement plan)
slot_orthanc, 0, 0, -90, 0.5

7. added to ITEM folder the orthanc.ITEM (just a copy and rename of the actual roman_proconsul_palace.ITEM, which is the orthanc tower I remodelled and already works ingame)

8. Not just because I'm lazy but because the tower is already there at the time the campaign starts, added orthanc to a settlement in descr_strat.txt:

building
{
type orthanc orthanc
}

Then I run the game, it loads. I enter war of the ring campaign, it loads. I enter Isengard city, I see a "orthanc" building there with his own features.
I click on see settlement in battlemap, it starts loading... and half bar loaded or so it CTDs. No error messages.

My guess is that game does not like my slot_orthanc because it has no overlay - underlay, even if I read some buildings does not need overlay and / or underlay...

Anyone can tell me if thats the reason or what else am I doing wrong?

Squid
04-21-2008, 16:24
I can't help with everything, but you are missing a line from export_buildings.txt, you're missing a {orthanc_name} line (used in the building browser). Every building tree has the have a {building_tree_name_name} line.

Seth Krn3ll
04-21-2008, 17:14
I can't help with everything, but you are missing a line from export_buildings.txt, you're missing a {orthanc_name} line (used in the building browser). Every building tree has the have a {building_tree_name_name} line.
well yes, I did it on purpose, because Orthanc tower is a unique building in the game, there is just one Black Tower of Isengard and its already built at the time the game starts, so there is no need to have it in the building tree browser.

BTW, I am deepening about overlays and underlays thing, but I see there are other buildings without any overlay-underlay floor defined in descr_settlement_plan.txt so I'm afraid its not that causing the CTD...

I just can't see what is wrong :(

Dol Guldur
04-21-2008, 17:24
Failure to include the _name def., as pointed out, will cause a CTD iirc.

Squid
04-21-2008, 17:24
I hate to say it but that doesn't matter to the game, the desc_short line is only needed if you can build a building (it appears when multiple buildings are completed in a single turn), but the game will crash without it.

EDIT: Just a little too slow :)

Makanyane
04-21-2008, 17:38
hmmm, the lack of descriptions in export_descr_buildings.txt should cause a crash when you try and view the settlement at campaign map level not battlemap level so not quite sure what's happening there...

Looking at the list of things you've done. I know you already have the .item made as you said it was working before as palace and you re-named it - I wonder though if you still might need to add it with new name in desc_items.txt and remake the items.db file again?? not sure on that but its a possible

maybe check your renamed orthanc .item is turning up ok without the link to the EDB building by putting it in in place of an ambient type item, say in place of one of the tenements in the cities settlement plans, that will confirm if its working that far and definitely doesn't need an underlay or overlay to do that.

If it works that far try it in slot again.....

Seth Krn3ll
04-21-2008, 20:26
hmmm, the lack of descriptions in export_descr_buildings.txt should cause a crash when you try and view the settlement at campaign map level not battlemap level so not quite sure what's happening there...
That's it, you are right: no crashes either way though.


Looking at the list of things you've done. I know you already have the .item made as you said it was working before as palace and you re-named it - I wonder though if you still might need to add it with new name in desc_items.txt and remake the items.db file again?? not sure on that but its a possible

yes yes YES! That was the point!
Had to work a little but once rebuilded the items.db its all working!
Wonderful, now I can add all the new buildings and free all the original ones for other use.

Only thing now I have to find an original building of the game to "steal" for the BPI. As far as now I found nothing suitable. O well, at worst I'll modify a bit my model to cover a suitable area.

Thanks a lot to anyone for your help, I'll be here soon for sure asking for some other troubles :)

Seth Krn3ll
04-22-2008, 21:47
http://digilander.libero.it/krnell/lotrmod/Barad-dur.jpg

:)