Here is an informal one. Perhaps I will consider making a larger one, but I'm working on a mod right now.
Adding a technology:
In order to add a technology, open up modboddy, create a new mod, etc. In the XML file you create, add code like this:
Code:
<GameData>
<Technologies>
</Technologies>
</GameData>
This will tell the file that it is referencing the Technologies XML.
Adding a technology is simple. For this example, I'll add Fishing.
Code:
<GameData>
<Technologies>
<Row>
<Type>TECH_FISHING</Type>
<Cost>35</Cost>
<Description>TXT_KEY_TECH_FISHING_TITLE</Description> <!-- the name of your technology -->
<Civilopedia>TXT_KEY_TECH_FISHING_DESC</Civilopedia> <!-- the Civilopedia entry -->
<Help>TXT_KEY_TECH_FISHING_HELP</Help> <!-- Mouse-over help text -->
<Era>ERA_ANCIENT</Era> <!-- self-explanatory -->
<Trade>true</Trade> <!-- guessing this is an available technology for Research Agreements -->
<GoodyTech>true</GoodyTech> <!-- Ancient Ruins gives this to you? -->
<GridX>0</GridX> <!-- position left-to-right on tech tree. The absolute left value is 0 -->
<GridY>1</GridY> <!-- position top-to-bottom on tech tree. The absolute top value is 0 -->
<Quote>TXT_KEY_TECH_FISHING_QUOTE</Quote> <!-- Quote displayed when tech is researched -->
<PortraitIndex>9</PortraitIndex> <!-- exactly what icon from the atlas is being displayed (see below)
<IconAtlas>RESOURCE_ATLAS</IconAtlas> <!-- what is being referenced for the icon displayed -->
<AudioIntro></AudioIntro> <!-- not needed for custom techs -->
<AudioIntroHeader></AudioIntroHeader> <!-- not needed for custom techs -->
</Row>
</Technologies>
</GameData>
Excellent! We have added Fishing into the game! Those TXT_KEY references are just keys to help translate the game. If you want, you can instead fill those TXT_KEY's with the actual text you want displayed, but then it can't be translated. If you want to keep those in, we'll reference those later.
Now that the tech is displayed in the game, it appears in the tech tree. But it has no prereqs (meaning you'll be able to research it from the start), and no flavors (I'm pretty sure this means the AI will do its best to ignore it).
For the sake of moving this along, let's have fishing grant the fishing boats ability, as well as the ability to train Work Boats. We'll have Sailing require Fishing. Let's tackle the easier stuff first, the prereqs and the AI flavors. As I said above, the prereqs make the lines appear on the tech tree, as well as make that technology required, and the flavors help with the AI. In the same XML file as above, let's add the following:
Code:
<GameData>
<Technologies>
<Row>
<Type>TECH_FISHING</Type>
<Cost>35</Cost>
<Description>TXT_KEY_TECH_FISHING_TITLE</Description> <!-- the name of your technology -->
<Civilopedia>TXT_KEY_TECH_FISHING_DESC</Civilopedia> <!-- the Civilopedia entry -->
<Help>TXT_KEY_TECH_FISHING_HELP</Help> <!-- Mouse-over help text -->
<Era>ERA_ANCIENT</Era> <!-- self-explanatory -->
<Trade>true</Trade> <!-- guessing this is an available technology for Research Agreements -->
<GoodyTech>true</GoodyTech> <!-- Ancient Ruins gives this to you? -->
<GridX>0</GridX> <!-- position left-to-right on tech tree. The absolute left value is 0 -->
<GridY>1</GridY> <!-- position top-to-bottom on tech tree. The absolute top value is 0 -->
<Quote>TXT_KEY_TECH_FISHING_QUOTE</Quote> <!-- Quote displayed when tech is researched -->
<PortraitIndex>9</PortraitIndex> <!-- exactly what icon from the atlas is being displayed (see below)
<IconAtlas>RESOURCE_ATLAS</IconAtlas> <!-- what is being referenced for the icon displayed -->
<AudioIntro></AudioIntro> <!-- not needed for custom techs -->
<AudioIntroHeader></AudioIntroHeader> <!-- not needed for custom techs -->
</Row>
</Technologies>
<Technology_Flavors>
<Row>
<TechType>TECH_FISHING</TechType>
<FlavorType>FLAVOR_NAVAL_TILE_IMPROVEMENT</FlavorType>
<Flavor>3</Flavor>
</Row>
</Technology_Flavors>
<Technology_PrereqTechs>
<Row>
<TechType>TECH_SAILING</TechType>
<PrereqTech>TECH_FISHING</PrereqTech>
</Row>
</Technology_PrereqTechs>
</GameData>
For the AI flavors, I put Naval Tile Improvement as the flavor because it seemed to fit the most for the technology. If Fishing grants the ability to make Fishing Boats, then it should be common sense that the AI thinks that's what it's going to do as well.
For PrereqTechs, TechType defines the technology you want to be researched, and PrereqTech defines the technology that needs to be researched in order to research the next tech. Fishing is at the left of the tree (with Agriculture) so I do not need to specify a Prereq for it (it can be researched at the start of the game). For other technologies, you will need to have to assign a PrereqTech for that, as well another tech to require the one you just made (refer to Kael's Modding Guide for updates).
So far, we have added the technology, gave it a prereq, and gave it a flavor. It's fully functional. The remaining bits are making it allow units, fishing boats, and making those TXT_KEYs mean something.
Create a new XML, or use the technology one, but creating a new XML is recommended by myself, and most likely many other people. Type the following:
Code:
<GameData>
<Builds>
<Update>
<Set PrereqTech="TECH_FISHING"/>
<Where Type="BUILD_FISHING_BOATS"/>
</Update>
</Builds>
<Resources>
<Update>
<Set TechCityTrade="TECH_FISHING"/>
<Where Type="RESOURCE_PEARLS"/>
</Update>
<Update>
<Set TechCityTrade="TECH_FISHING"/>
<Where Type="RESOURCE_FISH"/>
</Update>
</Resources>
</GameData>
Notice I used Update commands here. This is referenced in the Modding Guide. I basically did not have to add a single line of code to the XML, just updated the previous codes to reflect my new technology. They will not require Sailing anymore (although Sailing's tooltip will still say they do, this is just an aesthetic change).
And another code for the units:
Code:
<GameData>
<Units>
<Update>
<Set PrereqTech="TECH_FISHING"/>
<Where Type="UNIT_WORKBOAT"/>
</Update>
</Units>
</GameData>
Viola! Now Fishing grants a Work Boat, allows you to build Fishing Boats, and allows you to work Pearls and Fish. We're done (gameplay-wise!). Now let's change the aesthetics (i.e. make those TXT_KEY stuff display text)!
Code:
<Language_en_US>
<Row Tag="TXT_KEY_TECH_FISHING_TITLE">
<Text>Fishing</Text>
</Row>
<Row Tag="TXT_KEY_TECH_FISHING_DESC">
<Text>Man has long relied on the sea to provide sustenance. The most primitive peoples gathered mollusks and crabs from the sand; eventually they learned to make spears to capture the rich foodstuffs out of reach of hand. The fishing technology allows sophisticated advancements in fishing: building small coastal fishing vessels, weaving and deploying large fishing nets, constructing crab traps, and so forth. [NEWLINE][NEWLINE]Fishing is a major industry in the world today, and hundreds of thousands of pounds of fish are taken from the sea every day. However, this has put a serious strain on the ocean's ecology, and continued unfettered fishing may soon overwhelm and destroy this precious resource.</Text>
</Row>
<Row Tag="TXT_KEY_TECH_FISHING_HELP">
<Text>Allows you to build [COLOR_POSITIVE_TEXT]Work Boats[ENDCOLOR], allowing you to harvest [ICON_RES_FISH] [COLOR_POSITIVE_TEXT]Fish[ENDCOLOR] and [ICON_RES_PEARLS] [COLOR_POSITIVE_TEXT]Pearls[ENDCOLOR] from the coast.</Text>
</Row>
<Row Tag="TXT_KEY_TECH_FISHING_QUOTE">
<Text>"Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime." - Kurdish Proverb</Text>
</Row>
</Language_en_US>
And...we're done! Try this out and you should be able to add a technology.
Updating and deleting technologies to come on request...this is much harder.
Enjoy!