1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Tutorial: adding new terrain tiles with hex editor

Discussion in 'Civ3 - Tutorials, Reference, & Guides' started by embryodead, Jul 20, 2007.

  1. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Using a simple hex editor it is possible to edit stuff that is normally unavailable in the standard C3C editor. This tutorial explains how to add new Landmark Terrain (LM Pine Forest, LM Tundra, LM Flood Plain, LM Jungle, LM Marsh, LM Volcano, LM Coast and LM Ocean) to your maps.

    Warning: whatever you do, always backup your files. It's very easy to make the BIQ unreadable with a small mistake.

    Tools needed
    First, install a hex editor, such as HexCmp. Then, download my HexPak.zip.

    Enabling new LM Terrain
    If you're into hex editing, you can do it yourself by changing the "Landmark enabled" byte from 00 to 10 for each terrain (see BIQ reference link at the bottom of the post). However, inside the HexPak.zip, I've included Landmarks.biq that has all the new LM Terrain added already. You can edit their stats in the editor like any other terrain.


    Note that in order to include this in your own scenario, you can import this part of the ruleset into another BIQ (File->Import->Rules->Terrain).

    New LM Terrain and the editor
    While you can change the new terrains' stats easily, the C3C editor will not properly place these tiles on the map. Also, it will get confused with the old LM tiles, so that they get shifted. Fear not, it's just an inconvenience, e.g. to place the usual LM Forest, I have to select LM Hills... etc.

    Now, in order to place the new LM Terrain on the map, first place the base terrain in the C3C editor, e.g. Tundra or Pine Forest. Then, open your BIQ file in the hex editor yourself. Also, open one of the calc sheets provided in the HexPak.zip (one is for Microsoft Excel, another for OpenOffice). The files are based on Shay Yates Roberts' great excel stylesheet :worship: and make the editing much easier/faster. Follow the instructions inside the calc sheets.

    Just to reiterate what is explained there: for each tile, after you entered all the red data, read the "Landmark offset" (=file position) to edit in the hex editor:


    All you have to do now is use the Jump to Offset function (CTRL+G in HexCmp) to jump to "Landmark offset" you've read in the calc sheet:


    ...and change the two-digit number from 00 to 20.


    Graphics
    For some of these new Terrains you can have new graphics. These are all located in the Art/Terrain as usual.
    LM Tundra uses LXTGC.pcx
    LM Coast uses numerous PCXs... basically all L*.pcx that have coast in it
    LM Ocean uses LWCSO.pcx and LWOOO.pcx
    LM Pine Forest uses 5th and 6th rows of LMForests.pcx
    LM Jungle, Marsh and Volcano use their base graphics and cannot be changed

    The Result
    More terrain! Some quick ideas:
    - Real tundra vs. Glacial terrain - like on the screenshot below
    - Named LM Volcano with different stats e.g. Vesuvius or Mount Doom
    - LM Ocean with lower movement cost (winds,currents)
    - LM Coast with higher movement cost (reefs, shoals) - over it you can place a resource, e.g. rocks, since it works better than editing the terrain PCXs
    - LM Pine Forest - adds variety to the terrain

    Here is a screenshot showing Tundra vs. LM Tundra with new graphics; Jungle, Marsh and Volcano with LM marks, LM Pine Forest with Sn00py's forest-marsh graphics contrasted with Palm-Trees-LM-Forest at the bottom. It also shows Jungle-on-plains, which will be explained in another tutorial, though you can figure it out from the calc sheet already.


    Credits:
    AlanH, darndt, Gramphos, KingJoshi, MagForceSeven, Mercator, Nero Would, pdescobar, Tventano - for BIQ file format reference
    Shay Yates Roberts - for the Deepwater Harbours idea in the Age of Piracy scenario and the original XLS spreadsheet
     
  2. rifleman

    rifleman Varangian Guard

    Joined:
    Aug 12, 2002
    Messages:
    415
  3. Blue Monkey

    Blue Monkey Archon Without Portfolio

    Joined:
    Jul 31, 2005
    Messages:
    10,738
    Location:
    Limbo (non-Landmark Virtual Aether)
    If I do not wish to use one of these base terrains, wouldn't it to be possible to replace the base graphics & then have access to 2 new useful terrains (the new base + the new LM)? For example If I was building a mod on Tibet I would not need Volcano graphics*. If I replace them with mountain graphics wouldn't I then have four usable mountain terrains (2 base + 2 LM)? This would let me do a lot as far as mapping the Himalayas, etc.


    * I could either shut down the activity (explained elsewhere) or swap the lava explosion graphics for snowstorm (also posted elsewhere).
     
  4. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Not sure if that is what you want: Yes, it will be 4 usable terrains but with 3 graphics, since LM Volcano will still use whatever graphics you put in Volcanos.pcx.
     
  5. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    There's a way around it though, I just realised. Complex, though: for each map tile, there's a byte that corresponds to a predefined image: in case of volcanoes it's Volcano.pcx and forest/jungle versions. You could have something else at Volcanos jungle.pcx, and turn all your LM Volcanoes on the map into Jungle volcanoes (no matter if there are jungles or not). If that's something you're up for, I can search for the byte and add to the sheet.
     
  6. Shay

    Shay Chieftain

    Joined:
    Oct 12, 2005
    Messages:
    2
    Wow embryodead, you sure made a great tutorial. You are a real asset to the civ community. Great work, my friend!

    -Shay-
     
  7. Blue Monkey

    Blue Monkey Archon Without Portfolio

    Joined:
    Jul 31, 2005
    Messages:
    10,738
    Location:
    Limbo (non-Landmark Virtual Aether)
    I think any info that's not too hard for you to track down would be useful, since it would still be up to us to develop the actual mods and graphics. In this specific case I'll eventually be making a Huge map focusing on the Indian subcontinent. The Himalayan range may be 10 or more tiles thick at certain points. It would be nice to have as many options as possible for variations of mountain graphics and values.

    As an example of how this could be used: I can have besides the base mountains: impassable mountains, mountains where small cities can be founded, true LM mountains like Kailas and the other sacred mountains in Tibet, or any other combination of 3 graphics, 4 total sets of stats for one terrain type. And the limit of graphics types is actually an advantage: I like the idea of having hidden features that players must discover through exploration. Think of how this might be useful in, for example, a Dune scenario.

    By the way I realized I just posted the same question in the other thread where this is being discussed. Just ignore it and I'll edit it to link to your answer here.
     
  8. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Thanks Shay, wouldn't be possible if not Age of Piracy and Civinator inquiring on it :)

    @Blue Monkey
    4 terrains with 3 graphics is what you can do with this tutorial already (there's also snow-capped mountains too for more variation ;) )
    I'll soon post an additional stylesheet that calculates the place of the image index; just so it is clear though, this change will behave in the same way as Shay's deepwater harbours - editing the map in C3C editor will reset the changes.
     
  9. Pounder

    Pounder Phaethon was here

    Joined:
    Jun 14, 2003
    Messages:
    5,580
    Location:
    Your territory
  10. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    @Pounder
    No, BIQ only holds data about the map/scenario, can't change how the game works.
     
  11. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    @Blue Monkey
    Looks like 4 tiles with 3 graphics is the best you can have. It appears that the image index of the volcanoes is not saved in the BIQ, but automatically chosen by the game.
     
  12. Pounder

    Pounder Phaethon was here

    Joined:
    Jun 14, 2003
    Messages:
    5,580
    Location:
    Your territory
  13. Blue Monkey

    Blue Monkey Archon Without Portfolio

    Joined:
    Jul 31, 2005
    Messages:
    10,738
    Location:
    Limbo (non-Landmark Virtual Aether)
    I interpret this to mean that the game chooses whether to use the straight volcano or the jungle volcano graphic? But I could still have the LM stat/rule variation while using the same graphics for both it & the standard volcano terrain?
     
  14. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Precisely (had to use to cool word to get past 10 chars)
     
  15. godrick

    godrick Chieftain

    Joined:
    Jul 27, 2007
    Messages:
    5
    im not really into the modding thing usualy but ide like to make a map and im just not sure how
    can any one help me on how to get the files needed to make a map from scratch
     
  16. godrick

    godrick Chieftain

    Joined:
    Jul 27, 2007
    Messages:
    5
    im new to this whole modding thing and im looking to get all the files needed to make a map can any one help with finding the files needed to do this
     
  17. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Godrick: this is hex editing tutorial, not map making one. In order to make maps all you need is the editor that comes with Civilization 3, accessible through your Start menu.

    Also, for general questions like that, please use the General Creation & Customization forum.
     
  18. Varlin Saliptor

    Varlin Saliptor Does not hate the future.

    Joined:
    Oct 8, 2004
    Messages:
    1,515
    Location:
    San Marcos, Texas
    I have a (probably obviously answered) question:

    If I create a scenario/mod with the Hex-Edited Editor, then can it be played by others if I upload it?

    Again, this is probably a stupid question, but I just wanted to make sure.
     
  19. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Yes (since it's the BIQ that's hex-edited, not the Editor).
     
  20. Varlin Saliptor

    Varlin Saliptor Does not hate the future.

    Joined:
    Oct 8, 2004
    Messages:
    1,515
    Location:
    San Marcos, Texas
    That's what I figured.
     

Share This Page