I still haven't managed to succesfully create a new building without causing problems in BI. I started by making a mod folder with the minimum amount of files needed to run the RTW campaign under the BI exe. Then I added the RTW buildings file. Everthing still works fine at this point.

Then I delete all buildings except core_buildings, defenses and port_buildings from export_descr_buildings.txt. I also remove all non-core buildings from descr_strat.txt and try to generate the map.rwm file. Still works fine.

But then I add a new building set. I edit the text\export_buildings.txt file accordingly and run the game (not deleting the rwm file). Campaign starts fine, my building shows up in building browser. I exit the game, delete the map.rwm file and restart a new campaign. The game tries to generate the rwm file, but fails and goes back to menu, a corrupted rwm file is all I get.

No matter what I do, it seems to be impossible to add new buildings to the techtree without causing a problem when generating the rwm file. If anyone would want to try this I'd greatly appreciate it.

the minimum export_descr_buildings.txt file can be found here:
Code:
hidden_resources rome sparta italy

building core_building
{
    levels governors_house governors_villa governors_palace proconsuls_palace imperial_palace 
    {
        governors_house requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {

            }
            construction  1 
            cost  400 
            settlement_min village
            upgrades
            {
                governors_villa
            }
        }
        governors_villa requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {

            }
            construction  2 
            cost  800 
            settlement_min town
            upgrades
            {
                governors_palace
            }
        }
        governors_palace requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {

            }
            construction  3 
            cost  1600 
            settlement_min large_town
            upgrades
            {
                proconsuls_palace
            }
        }
        proconsuls_palace requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {

            }
            construction  4 
            cost  3200 
            settlement_min city
            upgrades
            {
                imperial_palace
            }
        }
        imperial_palace requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {

            }
            construction  6 
            cost  6400 
            settlement_min large_city
            upgrades
            {
            }
        }
    }
    plugins 
    {
    }
}
building defenses
{
    levels wooden_pallisade wooden_wall stone_wall large_stone_wall epic_stone_wall 
    {
        wooden_pallisade requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {
                wall_level 0
                tower_level 1
                happiness_bonus bonus 1
            }
            construction  1 
            cost  400 
            settlement_min town
            upgrades
            {
                wooden_wall
            }
        }
        wooden_wall requires factions { barbarian, carthaginian, eastern, egyptian, greek, roman, } 
        {
            capability
            {
                wall_level 1
                gate_strength 1
                tower_level 1
                happiness_bonus bonus 1
            }
            construction  2 
            cost  800 
            settlement_min large_town
            upgrades
            {
                stone_wall
            }
        }
        stone_wall requires factions { barbarian, carthaginian, eastern, egyptian, roman, } 
        {
            capability
            {
                wall_level 2
                tower_level 1
                gate_defences 1
                gate_strength 1
                happiness_bonus bonus 1
                law_bonus bonus 1
            }
            construction  3 
            cost  1600 
            settlement_min city
            upgrades
            {
                large_stone_wall
            }
        }
        large_stone_wall requires factions { eastern, roman, } 
        {
            capability
            {
                wall_level 3
                tower_level 1
                gate_defences 2
                gate_strength 2
                happiness_bonus bonus 1
                law_bonus bonus 1
            }
            construction  5 
            cost  3200 
            settlement_min large_city
            upgrades
            {
                epic_stone_wall
            }
        }
        epic_stone_wall requires factions { eastern, roman, } 
        {
            capability
            {
                wall_level 4
                tower_level 2
                gate_defences 2
                gate_strength 2
                happiness_bonus bonus 1
                law_bonus bonus 2
            }
            construction  6 
            cost  6400 
            settlement_min huge_city
            upgrades
            {
            }
        }
    }
    plugins 
    {
    }
}
building port_buildings
{
    levels port shipwright dockyard 
    {
        port requires factions { barbarian, carthaginian, eastern, macedon, thrace, scythia, carthage, roman, } 
        {
            capability
            {

                trade_fleet 1 ;trade_base_income_bonus bonus 1
            }
            construction  2 
            cost  800 
            settlement_min large_town
            upgrades
            {
                shipwright
            }
        }
        shipwright requires factions { britons, eastern, carthage, roman, } 
        {
            capability
            {

                trade_fleet 2 ;trade_base_income_bonus bonus 2
            }
            construction  3 
            cost  1600 
            settlement_min city
            upgrades
            {
                dockyard
            }
        }
        dockyard requires factions { britons, eastern, roman, } 
        {
            capability
            {

                trade_fleet 3 ;trade_base_income_bonus bonus 2
            }
            construction  5 
            cost  3200 
            settlement_min large_city
            upgrades
            {
            }
        }
    }
    plugins 
    {
    }
}
PS: this all worked fine in RTW 1.2, never had any problem with my new techtree there.