Guide to modding


As promised, completed the blog for registered users. Hopefully this will rally the remaining fans of the game, and the light will be something worthwhile.

I'll start with reprints of articles on modifying the game from the site Absolute Games . The article is very useful, but references to it are outdated, since the game developer's site - is closed. I think that would be useful to refresh the page and links. Join us! I'll wait for your articles!

Documentation in English and examples of modifications


  1. Working with management games: *. ubn-archives
  2. Scripts
  3. Textures and other graphics - format *. DDS
  4. 3D models - Format *. gr2 and *. diff3d
  5. Designer Cards
  6. Global Map and other objects of the GUI

Working with management games: *. ubn-archives

UBN-file is a regular zip-archives and can be viewed, unzipped, zipped and edited WinZip or WinRAR. Each. UBN-file contains folders with files. We consider them in detail:

zones.ubn - contains all the locations available in the game.

  • It contains all the scripts on specific areas ( - skprit launch zone, - dialogues, - NPC, etc.).
  • [Map name]. Zip - zip-archive of the card.
  • zonetext - a directory with. PY-script text calls for a specific zone.
  • - map of surface topography in the format *. DDS (more on that below), the file [name card] - Minimap zone in the format *. DDS

terrain.ubn - surface textures in the format *. DDS. Also contains, along with some texture files of type *. grid_map. This is the XML-files that are edited with any text editor. They determine what location on the map is a particular object (the size is measured in the tile). If the file *. grid_map missing, then the object becomes completely passable for the character, ie does not take place on the map.

videos.ubn - the caption from the beginning and end of the game. Format - *. bik (for conversion into this wonderful and very popular gaming format, and from it to other formats using free software RAD Video Tools).

sounds.ubn - sounds and music in the appropriate directories, in an open format *. ogg (Vorbis). Most modern programs for working with audio converted from *. ogg in it without any problems.

textures.ubn - texture format *. DDS, divided into groups, like everything else (equipment, buildings, etc.).

objects.ubn - 3D-model formats *. gr (in particular - the animation character's head) and in the format *. diff3d (buildings, weapons, objects). About *. diff3d - below.

gui.ubn - graphical user interface. Contains images of the menus, the global map, character selection screen, etc. in the format *. dds.

scripts.ubn - all the scripts in the format *. py and *. pyc

data.ubn - archive contains files for control markup and GUI! Data Types: *. lay and *. gui, for them there are official programs from the developers, details about them below in the appropriate section.

These files should be unzipped into the root directory of the game (/ The Fall: Last Days of Gaia /). In this case, the game will take files directly from the catalogs of the same name (...Gaia / gui /...), and not from the archives *. ubn (.../ Gaia / gui.ubn). Changing something, you will immediately see the result. If you screwed up somewhere, we can again ubn unzip and replace the corrupted files source.

Then, when convinced that the MOU is ready and running, compiling directories with modified files back to the UBN-archive any archive ... Voila!

Note: Sometimes the game happen, "race", when instead the modified file from a directory, it takes the original file from the archive. So my advice: starting work on a patch or mod, unzip all the files, then create backups of all files and then open the original files, and erase all the data inside. DO NOT REMOVE own archive files (*. ubn), otherwise the game would be cursing and will not start. Now any modified files in the directories will be 100% reflected in the game.


All the scripts are written in Python. Scripts in the bulk are in *. ubn-archives "zones.ubn" and "scripts.ubn" as a *. py and *. pyc files. They can be edited with any text editor, specialized editors is for him to . To understand the language of the game, first it is desirable to get acquainted with Python, and then with the leaders of script.

Note: The game works only with compiled scripts (*. pyc), which are compiled from the edited *. py. If a directory with scripts unzipped, the game automatically compiles all the files *. py, in which measurements were made in the *. pyc, and works with them. If they are zipped, you have to manually compile a. PYC edited. PY-files and put them into the archive, because there is no automatic update.

Textures and other graphics - format *. DDS

*. DDS - a graphical format, which can be run in graphic editors such as Adobe Photoshop, with meets both the plugin. It can be downloaded from NVIDIA , among other tools to work with DDS (besides, there still is a plugin for 3DSMAX, allowing him to work with DDS-textures, which later may be very useful for mapping). Here are a specialized DDS converter .

In fact, part of the DDS-textures - this is A compressed PNG to DDS for convenience, but the game can work with PNG. For example, you converted the DDS-file in the PNG-file in Adobe Photoshop, editing a PNG-file. Now delete the original DDS and put in its place eponymous PNG - everything will work. When she finished, all the textures to compile *. DDS.

Note: Not all textures will work with PNG! For some very important mipmaps (decreasing sequence of images). With PNG without problems texture interface, but the texture of surfaces and objects (terrain and textures, respectively) are using conventional PNG fail!

When converting a PNG to DDS have several options. For each type of texture in the game should choose your options:

  • textures from / GUI (interface) - RGBA without mipmaps.
  • textures from / ZONES - without mipmaps, choose dxt1, if there is no alpha channel, dxt5 - if there is an alpha channel, RGBA - if Lightmap (map coverage).
  • textures from / TERRAIN - with mipmaps, dxt1 if no alpha channel, if there is - dxt3.
  • textures from / TERRAIN / SKIES - RGBA without mipmaps.
  • textures from / TEXTURES - mipmaps, dxt1 without alpha-Kala, dxt5 if there is an alpha channel.

Mini-tutorial on how to add new texture to the surface texture:

  • open in Adobe Photoshop arbitrary *. DDS-file from any subdirectory directory / terrain /, except *. DDS-file from the directory base. Load mipmaps do not need you later will generate them automatically when you save.
  • You will see the texture of the surface. Replace any quarter of the square of your new texture. "Glue" all the layers into one.
  • Save this file as *. DDS, with a new name (for example in one of the subdirectories / terrain /. In the options of saving it, select dxt1, generate mipmaps.
  • Now open terrain / details.txt. It contains all the textures. Copy the last line, change the serial number in it (put 822 instead of 821), Name (TRES_TERRAIN_TEXTUR_FLUSSBETT change in your name its texture), setting_green will not change, although if you want you can do this setting determines which of the catalogs of materials will be your new texture in the editor) and change the path (the path must be written terrain / odin_iz_podkatalogov /, and finally, change the mapping - where the four coordinates determining what portion of an image to use. If you have filled in for instance the upper left quarter of the image of its texture, then enter the coordinates of the type X; Y; 0, 0, where X = 1 / 2 width, Y = 1 / 2 height of image texture.
  • start the game and go to the map editor. Your new texture is available in this section (unless you changed the sub-editor for a new texture, it will be setting_green)

Adding a new base textures (texture the entire surface of card)

  • open in Adobe Photoshop arbitrary *. DDS-file from the / terrain / base /. Load mipmaps do not need you later will generate them automatically when you save.
  • you can see the texture of the surface. Replace it with its new structure. "Glue" all the layers into one.
  • Save this file as *. DDS, with a new name (for example in / terrain / base /. In the options of saving it, select dxt1, generate mipmaps.
  • Now open terrain / base.txt. It contains all the textures. Copy the last line, change the serial number in it (put 7 instead of 6), Name (Cave replace it with your name its texture), and change the path (the path must be written terrain / base /
  • start the game and go to the map editor. Your new texture is available in the basic textures BASE.

Mini-tutorial on the mapping of new models

  • Take your created models and open it in 3DSMAX.
  • Press M and call the material editor. Open the first material. As the diffuse-material use your image file a new texture for this model (it should be in PNG or DDS).
  • drag and drop stuff on your new model. Adjust the texture, if something is crooked sits.
  • Export your model in the format *. ASE, checking the Mesh Options - Mesh Normals and Mapping Coordinates.
  • use the program ( to convert the model into diff3d. The command line syntax is:
    ...путь_к_файлу-конвертеру/converttodiff3d.exe ...put_k_faylu_modeli / file.ase-map-man-mat
    -Map export of animated vertex,-man export animated normal vertex,-map export animated texture coordinates.
  • Now place the finished model in one of the subdirectories of the folder and mount objects in the corresponding *. py-file data on the new model (more on this mini-tutorial on models).
  • texture on the model put in the appropriate subdirectory of textures. If you used a texture 123.png in Max as a diffuse-material, then the game for texturing the object will look for 123.png in the relevant section textures (for example, if your model is in the objects / buildings / [subdirectory] / model.diff3d , then the texture will look at textures/buildings/123.png).

3D models - Format *. gr2 and *. diff3d *. GR2 - format Granny3d - editor of 3D-models Granny3d quite expensive, but there is a free viewer, so that in principle these model can be viewed ... alas, watch, and only *. diff3dS this format is more convenient because it can convert a special program from the developers. View diff3d by using a special browser, and convert the model into a format *. diff3d from *. ase, using tools

Note: For a texture model, you need to export ASE-files from 3DSMAX, texture in the PNG format should be used as a diffuse-material model. Distillation with MD3toASE (for those who are working models in MilkShape free, and exports from a Md3, and thence to the ASE) is not suitable for texture - mapping model goes astray.

Designer Cards

Card-game designer really is very simple. However, imports of "the collected cards in the game and ensuring their playability - a question that requires a detailed guide. Above these guides I am going to work soon, with designers hoping to get an explanation of the whole process is simple enough to modding can do is not too advanced in programming people.

Note: LIGHTMAP (relief map) exported almost always less than it actually is (1000x1000px = 993x993 feet / tile).

Note: The absolute vertical transitions in the relief is not allowed. If the map of the relief the contrast of black / white pixel between them on the map will be slanted tile, rather than vertical. For obvious reasons.

Note: 200 meters - fixed "boundary of the chamber" - the area from the edge of the map, in which the characters can neither move nor the movement of the camera! Border, as told by the developers, not modified, ie She spelled out not in PY-scripts. Therefore, the map size of 400x400 or less will not have AREAS FOR TRAFFIC! Remember this!

Global Map and other objects of a graphical user interface (menus, popup windows, mouse, etc.)

Images of the GUI are in the archive GUI.ubn. Manage - archive DATA.ubn

Available 2 of the program:

In *. gui prescribed texture (texture files), and what coordinates the pictures on these patterns. In particular, the image with a global map where indicated, from "taking" all the small pictures "zones."

In the *. lay on the contrary, these are the most pictures on the "layout"-e, which was then a player and see the game.

Guide to the room created a zone in the global map

To begin the development of this section, you need a working (playable) zone, which normally runs through system.set_app_state (state = global_defines.APP_GAME, map = "zones <zonename> <zonename>")

Note: All described here is a little rough and not 100% tested.

  1. To begin with the following extract the *. ubn-files in <install directory The Fall>: data.ubn, gui.ubn.
  2. Open the file with a global map of the directory <directory installation The Fall> gui gui_mission (for example, using the DDS-plugin for Adobe Photoshop).
  3. Find the free space below the map near the small icons with images of other bands out there and draw an icon of its new location.
  4. Write down the details of your icons: the coordinates of the upper left corner pixel icons and pixel coordinates of the lower-right icon.
  5. Save your file as a PNG in the same directory, delete the original in this directory AND (!) In the archive gui.ubn! (If you have a converter PNG>> DDS from the SSE, it will automatically create DDS-files from PNG during the next run, but nonetheless game for whatever reason, prefers to use an existing archive of gui.ubn , so you have this file from the archive delete it. Take a backup before you delete the original file from the archive!).
  6. Now run the utility GUIResourceData.exe and open the file: <install directory The Fall> data guidata map_icons.gui With this tool you can assign the id to specific areas png / dds files to later use these areas as elements of a graphical interface.
  7. Add a new resource, giving it a unique id (id look at all the other resources and give any other!) And handle (in the program bezeichner).
  8. Separating you created a new resource, click on "new area" ("neuer bereich ...") in the right window.
  9. Here you can enter the coordinates of pixels that you recorded in step 4. X1, Y1 - coord. top left, X2, Y2 - coord. lower right. Height and width are calculated automatically. The latest installation: "texture". Select "mappanel.png" (he's the only one) and click "OK."
  10. Now run the utility LayoutManager.exe and download the file <install directory The Fall> data guidata layout_mission mappanel.lay
  11. Here you set the position of icons for your new band on the global map: the mouse to draw a rectangle around the spot where you'd like to see the icon in your area. The exact location can be changed later.
  12. Scroll down the list on the left to find a new record: "unbenanntXX" (xx - serial number, I will explain. Stas). Select it. Now you must add the parameters in the boxes above the sheet. Parameter GUIResource ID: - that ID, which you gave your icon when using the utility GUIResourceData.exe.
    X1/Y1: the position of top left pixel on your pryamouglnika layout'e.
    Width / Height (Breite / Hohe): substitute the exact dimensions of your icons in pixels, you can find them using the same tools GUIResourceData.exe.
    Descriptor (Bezeichner): make it a type descriptor in any other object leyauta - IM_IMYAVASHEYZONY "
  13. In addition, you must create another rectangle inside your first rectangle, the parameter GUI Resource for him to be left blank, and give him the type descriptor "FD_IMYAVASHEYZONY"
  14. Now your new area should be added to the list of available zones in the file <install directory The Fall> scripts Simply add to the end of a new line of this kind: "IMYAZONY": ("zones imyazony imyazony" [ X coordinate on the map, the Y coordinate on the map])

    "Vidzone_1": ("zones vidzone_1 vidzone_1", [480.00, 450.00]),
    X and Y coordinates on the global map is given to the game could calculate the number of red dots pokayvayuschih your way up to the zone.
  15. Now your new area should be accessible to the global map, but first you must activate it via the console command global_defines.set_zone_enabled ("imyazony", True)

Now get on the global map in the game - there should appear the icon for your new area and it should be working (it will be accessible to go)

Script on the activation of your zone you will later be able to bind to some event or quest dialogue in the game.

The author of the article: Stas Bush


zsrg 06.06.2011 | Comments (74)

Development by Sergey A.Zhukov 2007-2012