BIS FO2 mapper .txt output => IanOut project needs your h

Discussion in 'Fallout General Modding' started by mvBarracuda, Feb 6, 2005.

  1. mvBarracuda

    mvBarracuda Vault Dweller

    754
    Apr 11, 2004
    ATM we seriously consider to port the Fallout 2 campaign to IanOut to give the modders with the next beta the chance to use this Fallout 2 campaign as a starting point for their mods.

    The most important thing to release this campaign is a working map converter for IanOut, that converts the Fallout 2 maps in to IanOut format. I just realized that the BIS mapper supports text output, and I think this is great starting point for the converter, because parsing the .txt files is much easier than fighting them the binary way. So I got some basic questions about the Fallout 2 map format and the .txt output feature. You can help IanOut to release faster so hopefully there's someone out there with knowlegde of these things.

    1. What are the ".gam" files used for? Is it correct that they store the map vars?
    2. When I create the .txt files of the maps, some files got an additional ".cfg" file; whats the purpose of this file? Maybe storing the map vars?
    3. Are there any known bugs when working with .txt output or is the feature "stable" so that working with .txt maps should deliver the same results as working with binary .map maps?

    4. These are just samples of a .txt file; hopefully someone could explain what each lines defines:

    Samples:
    Code:
    >>>>>>>>>>: MAP_DATA <<<<<<<<<<
    
    map_ver: 20
    map_name: ARTEMPLE.MAP
    map_ent_tile: 18492
    map_ent_elev: 0
    map_ent_rot: 0
    map_num_loc_vars: 0
    map_script_idx: 745
    map_flags: 12
    map_darkness: 1
    map_num_glob_vars: 0
    map_number: 126
    Hmm that seems to be the map vars, filename, etc; easy

    Code:
    >>>>>>>>>>: MAP_SQUARES <<<<<<<<<<
    
    
    square_elev: 0
    
    sq: 65537 grid000 grid000
    [...]
    sq: 65537 grid000 grid000
    sq: 65537 grid000 grid000
    sq: 65537 grid000 grid000
    sq: 65731 edg5004 grid000
    sq: 65727 edg5000 grid000
    sq: 65730 edg5003 grid000
    [...]
    Seems to be the tiles; but whats roof and whats floor? And whats sq??

    Code:
    >>>>>>>>>>: SCRIPTS <<<<<<<<<<
    
    
    SCRS:
    scr_num: 0
    scr_num: 0
    scr_num: 0
    scr_num: 2
    
    [[SCRIPT]]
    
    scr_id: 50331648
    scr_next: 4294967295
    scr_flags: 0
    scr_script_idx: 511
    scr_oid: 14
    scr_local_var_offset: 4294967295
    scr_num_local_vars: 0
    
    scr_id: 50331649
    scr_next: 4294967295
    scr_flags: 0
    scr_script_idx: 511
    scr_oid: 18
    scr_local_var_offset: 4294967295
    scr_num_local_vars: 0
    
    scr_num: 1
    
    [[SCRIPT]]
    
    scr_id: 67108865
    scr_next: 4294967295
    scr_flags: 0
    scr_script_idx: 750
    scr_oid: 24
    scr_local_var_offset: 4294967295
    scr_num_local_vars: 0
    Hmm seems to be the scripts; easy. Maybe we could include a feature in the converter so that all scripts are generated; just the files not any scriptcode, but this way you could know what critters left to script

    Code:
    [OBJECT BEGIN]
    obj_id: 16
    obj_tile_num: 11684
    obj_x: 0
    obj_y: 0
    obj_sx: 448
    obj_sy: -2
    obj_cur_frm: 0
    obj_cur_rot: 0
    obj_pid: 33554776 00000345
    obj_fid: 33554453 block
    obj_flags: 2684354568
    obj_elev: 0
    obj_cid: 4294967295
    obj_light_distance: 0
    obj_light_intensity: 0
    obj_outline: 0
    obj_sid: 4294967295
    obj_pud.inv_size: 0
    obj_pud.inv_max: 0
    obj_pudg.updated_flags: 0
    [OBJECT END]
    
    [OBJECT BEGIN]
    obj_id: 252
    obj_tile_num: 11685
    obj_x: 0
    obj_y: 0
    obj_sx: 416
    obj_sy: -2
    obj_cur_frm: 0
    obj_cur_rot: 0
    obj_pid: 33554776 00000345
    obj_fid: 33554453 block
    obj_flags: 2684354568
    obj_elev: 0
    obj_cid: 4294967295
    obj_light_distance: 0
    obj_light_intensity: 0
    obj_outline: 0
    obj_sid: 4294967295
    obj_pud.inv_size: 0
    obj_pud.inv_max: 0
    obj_pudg.updated_flags: 0
    [OBJECT END]
    
    [...]
    
    [OBJECT BEGIN]
    obj_id: 1626
    obj_tile_num: 25498
    obj_x: 0
    obj_y: 0
    obj_sx: 704
    obj_sy: 389
    obj_cur_frm: 0
    obj_cur_rot: 0
    obj_pid: 33555379 00000948
    obj_fid: 33555390 TREE9
    obj_flags: 2147516416
    obj_elev: 0
    obj_cid: 4294967295
    obj_light_distance: 0
    obj_light_intensity: 0
    obj_outline: 0
    obj_sid: 4294967295
    obj_pud.inv_size: 0
    obj_pud.inv_max: 0
    obj_pudg.updated_flags: 0
    [OBJECT END]
    
    [[OBJECTS END]]
    EOF
    Hmm thats seems to be the code of some objects; but where is the scenery? Or is scenery already included in the tiles section?

    Hopefully you can help us. You can download the whole file here: http://ianout.nma-fallout.com/dante.zip
     
  2. jargo

    jargo Where'd That 6th Toe Come From?

    492
    May 25, 2003
    Well i remember working on FO2 map format in ancient times when we have not have BIS mapper :).
    First get map format description from TeamX site (Docs section).


    From TeamX:
    Each level of the map consists of tile data for both the roof and floor. These tiles are on an isometric grid, which is independent of the hexagonal grid used for critters, scenery, objects etc. The grid size is 100 by 100, which gives a total of 20000 tiles for each level (including both floor and roof).

    Well for me in txt it look like:

    sq: 65537 grid000 grid000
    sq: 65537 grid000 grid000

    sq: Mapcoord floor roof

    the same number for mapcoor repeated many times sugest thes are the blank tiles.

    The grid000 is the filename of the FRM file containing the tile image data. The filename can be found in the LST file art/tiles/tiles.lst using this id. An id of 1 means no tile(in binary file).


    Scenery in Fallout 2 is normal (dynamic) object as item,critter etc.

    Code:
    [OBJECT BEGIN]
    obj_id: 342
    obj_tile_num: 17878
    obj_x: 0
    obj_y: 0
    obj_sx: 608
    obj_sy: 70
    obj_cur_frm: 0
    obj_cur_rot: 0
    obj_pid: 33554776 00000345
    obj_fid: 33554453 block
    obj_flags: 2684354568
    obj_elev: 0
    obj_cid: 4294967295
    obj_light_distance: 0
    obj_light_intensity: 0
    obj_outline: 0
    obj_sid: 4294967295
    obj_pud.inv_size: 0
    obj_pud.inv_max: 0
    obj_pudg.updated_flags: 0
    [OBJECT END]
    
    obj_id - holds pointer to this object when created it does not matter, this walue is created when first reading this map.

    obj_tile_num: 17878 - just a position on the map

    obj_x: 0, obj_y: 0 Graphic (FRM) position don't know for what is this

    obj_sx: 608,obj_sy: 70 This is handle coord from the center of the map (not sure)

    obj_cur_frm: 0 - This indicates what frame from FRM (not sure)

    obj_cur_rot: 0 - Rotation of object(from 0 = NE to 5 = NW)

    obj_pid: - PID Prototype number

    obj_fid: - FID FRM file number(with graphic for this object)

    obj_flags: - Flags like shot thru, no block, multi hex, flat etc

    obj_elev: 0 - Object elevation (0 - 2)

    obj_cid Newer know this one ???

    obj_light_distance: 0, obj_light_intensity: 0 - light of this object settings

    obj_pud.inv_size: 0,obj_pud.inv_max: 0 - inventory object count and inventory max
     
  3. mvBarracuda

    mvBarracuda Vault Dweller

    754
    Apr 11, 2004
    Thank you very much for your help :) That's really what we needed :) However I still got some questions:

    I'm quite sure, that the last two vars are the roof and floor tiles but I still don't get the part with "sq: 65537" :( This can't be any coordinate because there can't be 100 of the same coordinates!

    The infos about the objects are very useful thx :) I think we can build a mapconverter on this basis.

    And a last question: I've replaced the "65537" from the tiles section with another number; this way I wanted to find out how the layout of the map changes when I load the modified version. The problem is that the map editor got an option "Open from text", but if I select it, it says: "Map Text Code Disabled. Can't Load Text" :(

    Is there any way to reenable text input? Maybe by changing some vars in the mapper2.cfg? I've already tried the most of them so it seems that I need to insert one line to get it working :( Does anyknow know the correct command?
     
  4. dude_obj

    dude_obj Vault Senior Citizen
    Moderator

    Oct 19, 2004
    Right, its more of a coordinate within the set of tile art images. Convert the decimal number 65537 to hex and you have 10001. The tiles are internally represented as numbers 10001 and upwards. If you look at \art\tiles\tiles.lst you see that grid000 is the first image. If you look at that proto in the editor you can see that its the first image in the list (grid000 shown in the upper right hand corner of screen).

    Now follow down the artemple.txt until you find the first number that is not 65537 in the left column. You find 65728. If you look in the editor it uses the image edge5001. If you subtract 65536 from this number you get 192. And if you look at this image name position in \art\tiles\tiles.lst you see its on line 192 (count the first line "reserved" as zero, its the start of the address range 10000).

    So this number is simply a mapping to which tile image is there. Subtract 65536 from the numbers and you get the position of the art file in tiles.lst. It looks to me like the mapper just lists all the tiles in sequential order in the mapper (first tile count to last tile count).

    You will find that all of the art works similar to this. Take critters for example, the first critter FRM has a FID number of 16777217. Convert that to hex and you have 1000001. So for critters you subtract 16777216 to get the position of the art file.

    Note that the mapper also makes .txt versions of edited protos and puts them in \fallout2\dev\proto. If you edit an critter and look in the text file, you'll see those fid numbers like this:

    fid: 16777227 hmjmps,11,1

    The fid numbers are used for all mappings to FRMs so this is key to any automatic converter. The critter protos (text) actually list the file name, but many of the protos do not. So understanding the calculation to position in *.lst is the only way to convert all these protos.

    http://www.coljack.pwp.blueyonder.co.uk/fallout/merge.html

    See the rest of coljack's tutorials
    http://www.coljack.pwp.blueyonder.co.uk/fallout/
     
  5. mvBarracuda

    mvBarracuda Vault Dweller

    754
    Apr 11, 2004
    Ahh thx :) that's cleared up things a lot :)

    You saved my day with the link *builds-a-palace-for-dude_obj*

    EDIT: This "save_text_maps=1" thingy doesn't seem to work :( You can save the maps as text files but you CAN'T reopen them with "Open from text" :( Maybe there's a parameter but ATM it doens't work :(
     
  6. ColJack

    ColJack Where'd That 6th Toe Come From?

    422
    May 7, 2003
    i do wish people would read the tutorials properly before saying they don't work....

     
  7. red

    red Still Mildly Glowing

    271
    Apr 5, 2003
    Just a note about the CFG files. It's simply used by the mapper to store the bookmarks set for a perticular map.

    This is mentioned in the "mapper keys" document.

    As for the "sq" number part it's actually the value of both the floor and tile in dword (decimal) format. Technically for your conferter you won't care about this value anyhow since the text equivalents'll probably be much more handy