1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you are going to register on XLNation, please make sure you do not use a proxy server.
    If you use a proxy server your registration will most likely get blocked due to spammers and hackers using proxy servers to hide their real IP address.

    If your using your home or work IP address and have not received your registration email, check your spam folder.
    PLEASE DO NOT ASK TO HAVE YOUR ACCOUNT DELETED IF YOU HAVE POSTED IN THE FORUM! If so we do not delete accounts due to the mess it can make on the forum.
    Dismiss Notice

Tutorial How to create a simple 10M bridge in CitiesXL 2014-08-24

An 18 step guide to creating a simple 10M repeating arch bridge

  1. PaulJChris
    I have written an 18 step guide to creating a simple bridge.

    It covers how to create the bridge model in 3dsmax, how to create the interface icon, and how to edit the fullset of .class and layout files to createa working .patch file for your custom bridge.

    A zip file is provided which includes:

    an annoted step by step guide with screenshots in word format
    a sample 10M bridge 3dsmax file with textures,
    a sample .patch file with 5 custom bridges included to use as a template
    an ammended tags file to enable the .patch file to work

    I hope this helps more people to make more bridges

    PJC

    Download ZIP file Updated Bridge Tutorial ZIP

    The 5 template bridges in the .patch file included in the Zip file cover all the standard road widths in the game and are shown below:

    [​IMG]

    I recommend you download and use the annotated Word document in the ZIP file as it is easier to read. For those wishing to browse, the contents are re reposted below.



    How to create a simple bridge in Cities XL
    An 18 step guide by PaulJChris

    AUGUST 2013

    Required Resources:

    Autodesk 3dsmax 2012
    Artist Tool Suite
    Paint.net (Required to read/write .dds files)
    PakUnPak V1.3

    Zip File Contents : example .patch file, 3dsmax file for the 10M bridge with textures, amended tags file.

    Unpack Zip file and save contents to your local machine before you start.

    Skill Level : Intermediate
    Time Required: Approx 30mins to edit the game files in Notepad
    A further several hours to create your bridge model in
    3dsmax depending upon your skill/experience level.

    It is assumed that you have a reasonable working knowledge of 3dsmax to create your own bridge model.


    PART 1
    Creating the bridge model in 3dsmax.

    The good news is that to create a simple repeating arched bridge in the game we only need to create 1 model in 3dsmax and export 1 .sgbin file for use in the game.

    STEP 1
    Open 3dsMax and make sure your units are set correctly. Units should be either 1unit=1cm or 1unit=0.01M if you prefer.
    [​IMG]

    STEP 2
    Create your bridge file in 3dsmax or find an existing 3dsmax model of a bridge you like and create a symmetrical arched piece exactly 40m long from it. Pay strict attention to the positioning of the object in the 3dsmax scene. See my example 10M bridge loaded into max below (this 3dsmax file with textures is included in the ZIP file provided with this tutorial).
    [​IMG]

    STEP 3
    Create textures for your model and apply UV mapping. For bridge files, the minimum requirement is a diffuse and bump map. A lightmap and Illumination maps can also be added. I used 1024 x 1024 for my diffuse and 512 x 512 for the bump map. Set the shader from the Cities XL parameters drop down to “Road” which is the correct one used for bridge files.
    [​IMG]

    Important note: Due to the characteristics of the Road shader used for bridges , if you do not add a bump map then your model will appear in the Viewer with weird shadows on it. Applying a bump map will make your model appear as it should in the Viewer.

    STEP 4
    For the purpose of this tutorial , rename your materials:
    r_pileXXX_gd_10x40_dif.png
    r_pileXXX_gd_10x40_bp.png

    Rename your max object:
    r_pileXXX_gd_10x40

    Change XXX to something unique , I used my initials , use whatever you like but we will the same 3 initials throughout this tutorial to create a set of unique filenames for your bridge mod.

    Step 5
    Check the Hierarchy tab and make sure the pivot is positioned at 0,0,0 in the max scene (same for all CXL mods but just a timely reminder as I sometimes forget this step)
    [​IMG]

    STEP 6
    Export your file using the Viewer. Check scale and alignment by turning on the grid (1 square in the viewer grid is always 1m) and make sure it is positioned as you would expect in the 3dsmax scene.
    [​IMG]

    Save the exported .sgbin with the filename:

    r_pileXXX_gd_10x40 changing XXX to the same as you chose in step 4 above.

    Create a folder on your desktop or other convenient location called “data” . Create a subfolder called “gfx” . Then create another subfolder called “road”. Save your .sgbin file to this newly created “road” subfolder. Local Path should therefore be:

    desktop/data/gfx/road.

    PART 2
    Creating the menu interface icon.

    STEP7
    Open Paint.net or any image software of your choice and create a new blank image with exact dimensions of 128 x 128 pixels. Use your creativity to create a suitable icon for your mod.

    Name this file XXX_NewbridgeGD_10M changing XXX to the same as steps 4 & 6 above

    Locate the data folder you created in step 6 above. Create another subfolder called “interface” and inside that another subfolder called “ddstexture” then another subfolder called “buildings”. Save your icon file XXX.NewbridgeGD_10M here. Make sure the file is saved in the format DirectDraw Surface(.dds). Local path should therefore be:

    Desktop/data/interface/ddstexture/buildings
    [​IMG]

    PART 3
    Editing the .Class , .layout and localization files.

    STEP8
    Open PakUnPak and in the bottom box point the Source File at the local location of the file XLN_PJC_European Bridge Pack V1.4.patch which is included in the ZIP file provided with this tutorial.

    Set the Destination box to the location of your desktop. Press the button marked “uncompress”
    EDIT: PLEASE NOTE THE DESTINATION PATH SHOULD BE Desktop NOT Desktop/data AS SHOWN IN THE SCREEN SHOT BELOW - good spot by Breizher thank you.
    [​IMG]

    This will unpack my .patch file to your newly created data folder and will allow you to inspect the .class and .layout files. We now need to go through each file and edit them in notepad replacing all instances of PJC found in the filenames and any text within them with XXX (where XXX is exactly the same as you used in all the previous steps).

    STEP 9
    Open your data folder on the desktop. You should now see the unpack process has added 2 more subfolders, one called “design” and the other called “localization”.

    Open the subfolder “design” then “buildings” then “construction” then “road” and you should see the following:
    [​IMG]

    STEP10
    Rename the highlighted 10M file to r_XXXGD_new10m where XXX is the same as you have chosen in all of the previous steps. Save it then open it in NotePad and edit it as follows:
    [​IMG]

    Tip: For speed you can make all these changes more quickly by using the Replace function of Notepad. I recommend you make the changes manually for the first few files to get familiar with their layouts.

    STEP 11
    Open each of the 4 country road subfolders (USA,UK,GER,FR) in turn, locate the 10M file and repeat all the changes made in step 10 for each 10M file for each country. Don’t forget to save the renamed and edited files.
    [​IMG]

    STEP12
    Next open the Foundation subfolder. Rename the 10x40 file changing PJC to XXX as you have done before. Open the file in notepad:
    [​IMG]

    Edit this file as per the instructions below:
    [​IMG]

    That concludes the editing of the .class files.

    STEP 13
    Now for the .layout files. Navigate back to the subfolder called “layout” and open out its path until you reach the foundation subdirectory. Data/design/layout/road/foundation is the correct local path .

    Rename all the 40x10 files replacing PJC with XXX as you have done before:
    [​IMG]

    These files define which .sgbin files are used to display the bridge in the game. The game engine expects to find a 4 layout files for our bridge as we defined in step 12 above. These are called begin, deck, pier, and end . For more complex bridges you would provide more .sgbin files, for our simple bridge we are going to tell the game to get the same .sgbin file for every section of the bridge.

    STEP 14
    Open the Begin file in Notepad and edit it as follows:
    [​IMG]


    Step 15
    Open deck, pier and end 40x10 files and repeat Step 14 on every file.

    Step 16
    Navigate back to the Localization subfolder. Open the subfolder “en” and open the file called PJC_Newbridge.
    [​IMG]

    I am sure you know the drill by now, rename this file XXX_Newbridge and open it in Notepad making a very simple edit as follows:
    [​IMG]

    For more information about how to add the localization files for each language please see the excellent tutorial provided by Nick02u Found here

    That’s it . All the game files associated with your custom bridge have been renamed and edited and you are almost ready to put it in the game.

    STEP 17
    This last step is actually the most important. Remember back in step10 I asked you to create a custom tag called StyleXXXXX. We need to edit the main config tag file on your local installation of the game to add our custom tag. This is normally done by Altiris every time someone creates a mod that requires a custom tag, he adds it to the master config tag file so that provided you have the latest UIM installed , your mod will work on every players machine that has it installed. Tread very carefully here, do not delete anything from this file , only add entries.

    Locate the main game installation on your machine. It can be found under CitiesXL2012/Data/Config on my machine.
    [​IMG]

    Open the file Tags in Notepad and scroll down a huge list of tags until you come to a section headed "style" Edit the file to include your custom tag as shown:
    [​IMG]

    A copy of this amended tags file is included in the ZIP file. Use this version if you want to actually be able to use my sample bridge pack in the game until the UIM can be updated to include my custom tag "StyleEU/"

    IMPORTANT NOTICE
    NB If you intend to release your bridge mod for external release on the exchange, you MUST contact Altiris by PM and respectfully request he include your custom tag in the next update of the UIM. If you release your mod without your custom tag included in the UIM, it will crash instantly for every player who tries to use it who has not amended their local copy of their tags config file to include your custom tag. Furthermore Altiris needs to be able to coordinate tags so there are no duplicates , this has not been a major problem so far as relatively few mods require custom tags. However if lots of people decide to create their own bridge pack using this template , there will be chaos so please respect this procedure.

    STEP 18
    Open PakunPak again and this time at the top of the screen point the source directory at your “data” folder on the desktop and name and set the destination file for where you want your .patch field will be created. I personally use my mods folder for the destination path but it can be any path on your local machine. Provide a suitable name for the .patch file (XLN_XXX_MybridgeMod_V1.0) Hit Compress and your .patch file is created and ready to test in the game.
    [​IMG]

    STEP 19 (optional if you are feeling brave)
    Repeat the whole tutorial for the 15m, 25m ,30m and 40M files to complete your pack. Just remember to edit your model in 3dsmax and pull it wider to the correct width then resave using the 15m , 25m , 30m and 40M filenames. You will end up overwriting every single one of my files with ones of your own and your final .patch will consist of a pack of 5 bridges. Happy modding!

    I hope this will be of some use to those of you wishing to create their own bridge files.

Recent Reviews

  1. Lokentaz
    Lokentaz
    5/5,
    Version: 2014-08-24
    Usefull tutorial!
  2. Drazicdesign
    Drazicdesign
    5/5,
    Version: 2014-08-24
    This tutorial deserves 5 stars !

    Thank you,