TAfirehawk
Nov 15, 2007, 09:52 PM
This will cover all the concept and idea changes that the WoC has made to BtS.
The "How to" guide is in a different thread: http://forums.civfanatics.com/showthread.php?t=251146
TAfirehawk
Nov 17, 2007, 12:59 PM
Philosophy and Documentation of the SDK
This is done in a very specific manner to allow for "easy" upgrading of your mod to a new Firaxis patch....as well as "easy" merging for other modders.
/************************************************** ***********************************************/
/** CITY_RADIUS 08/18/07 MRGENIE */
/** */
/** */
/************************************************** ***********************************************/
m_iCitizenRadiusModifier = 0;
changeCitizenPlotBoundary();
/************************************************** ***********************************************/
/** CITY_RADIUS END ***/
/************************************************** ***********************************************/
This is important so other modders can easily identify added code...and allow searching by modder name or modcomp name.
/************************************************** ***********************************************/
/** CITY RADIUS 08/16/07 MRGENIE */
/** */
/** */
/************************************************** ***********************************************/
SAFE_DELETE_ARRAY(m_aeBestBuild);
// bugtracking to find firaxis bugs start
//delete [] (m_aiBestBuildValue-1);
// bugtracking to find firaxis bugs end
SAFE_DELETE_ARRAY(m_aiBestBuildValue);
/************************************************** ***********************************************/
/** CITY RADIUS END ***/
/************************************************** ***********************************************/
This example shows that existing code needs to be commented out, not deleted and no new text in the existing lines...we do this so a program like WinMerge can easily recognize the changes, thus making it much easier to go back and modify/merge at a later date.
TAfirehawk
Nov 17, 2007, 12:59 PM
Philosophy and Documentation of the XML
We have developed a totally new modular loading scheme in the SDK, which results in all new schema files. These files are located here: http://worldofciv.svn.sourceforge.net/svnroot/worldofciv/Assets/EmptyModuleExample/
Also included with the new schema files, we have provided example XML showing required tags...which is basically the TYPE and nothing else. Although sub-tags as I call them are needed, see example:
<Rands>
<iRandApp1>25</iRandApp1>
<iRandApp2>25</iRandApp2>
<iRandApp3>0</iRandApp3>
<iRandApp4>0</iRandApp4>
</Rands>
In this example even tags with "0" are needed.
Below is a resource in the WoC format:
<Civ4BonusInfos xmlns="x-schema:CIV4TerrainSchema.xml">
<BonusInfos>
<BonusInfo>
<Type>BONUS_HEMP</Type>
<Description>TXT_KEY_BONUS_HEMP</Description>
<Civilopedia>TXT_KEY_BONUS_HEMP_PEDIA</Civilopedia>
<BonusClassType>BONUSCLASS_GENERAL</BonusClassType>
<ArtDefineTag>ART_DEF_BONUS_HEMP</ArtDefineTag>
<TechReveal>TECH_CALENDAR</TechReveal>
<TechCityTrade>TECH_CALENDAR</TechCityTrade>
<TechObsolete>NONE</TechObsolete>
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
</YieldChanges>
<iHappiness>2</iHappiness>
<iPlacementOrder>5</iPlacementOrder>
<iConstAppearance>50</iConstAppearance>
<iMinAreaSize>3</iMinAreaSize>
<iMaxLatitude>70</iMaxLatitude>
<Rands>
<iRandApp1>25</iRandApp1>
<iRandApp2>25</iRandApp2>
<iRandApp3>0</iRandApp3>
<iRandApp4>0</iRandApp4>
</Rands>
<iPlayer>100</iPlayer>
<iUnique>2</iUnique>
<iGroupRange>1</iGroupRange>
<iGroupRand>50</iGroupRand>
<bArea>1</bArea>
<bFlatlands>1</bFlatlands>
<bNormalize>1</bNormalize>
Below is a resource in the Firaxis format:
<Civ4BonusInfos xmlns="x-schema:CIV4TerrainSchema.xml">
<BonusInfos>
<BonusInfo>
<Type>BONUS_ALUMINUM</Type>
<Description>TXT_KEY_BONUS_ALUMINUM</Description>
<Civilopedia>TXT_KEY_BONUS_ALUMINUM_PEDIA</Civilopedia>
<BonusClassType>BONUSCLASS_MODERN</BonusClassType>
<ArtDefineTag>ART_DEF_BONUS_ALUMINUM</ArtDefineTag>
<TechReveal>TECH_INDUSTRIALISM</TechReveal>
<TechCityTrade>TECH_MINING</TechCityTrade>
<TechObsolete>NONE</TechObsolete>
<YieldChanges>
<iYieldChange>0</iYieldChange>
<iYieldChange>1</iYieldChange>
<iYieldChange>0</iYieldChange>
</YieldChanges>
<iAITradeModifier>10</iAITradeModifier>
<iHealth>0</iHealth>
<iHappiness>0</iHappiness>
<iPlacementOrder>2</iPlacementOrder>
<iConstAppearance>100</iConstAppearance>
<iMinAreaSize>3</iMinAreaSize>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>90</iMaxLatitude>
<Rands>
<iRandApp1>10</iRandApp1>
<iRandApp2>10</iRandApp2>
<iRandApp3>0</iRandApp3>
<iRandApp4>0</iRandApp4>
</Rands>
<iPlayer>100</iPlayer>
<iTilesPer>0</iTilesPer>
<iMinLandPercent>0</iMinLandPercent>
<iUnique>0</iUnique>
<iGroupRange>0</iGroupRange>
<iGroupRand>0</iGroupRand>
<bArea>0</bArea>
<bHills>1</bHills>
<bFlatlands>0</bFlatlands>
<bNoRiverSide>0</bNoRiverSide>
<bNormalize>0</bNormalize>
In the Firaxis format above, the lines in BOLD are not needed in the WoC format...leaving the modder with only non-"0" tags, making it much easier to see the customizations.
NOTE: the <iMaxLatitude>90</iMaxLatitude> value is the default, with 90 instead of 0 :)
Next is an example of changing an existing Firaxis item, in this case the Work Boat adding the ability to Break Ice:
WoC Standard:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sid Meier's Civilization 4 Beyond the Sword -->
<!-- Modified by the World of Civilization Team -->
<!-- Unit Infos -->
<!-- -->
<Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">
<UnitInfos>
<UnitInfo>
<Type>UNIT_WORKBOAT</Type>
<bCanMoveImpassable>1</bCanMoveImpassable>
<Builds>
<Build>
<BuildType>BUILD_BREAK_ICE</BuildType>
<bBuild>1</bBuild>
</Build>
</Builds>
</UnitInfo>
</UnitInfos>
</Civ4UnitInfos>
Firaxis Standard:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Unit Infos -->
<Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">
<UnitInfos>
<UnitInfo>
<Class>UNITCLASS_WORKBOAT</Class>
<Type>UNIT_WORKBOAT</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>NONE</Combat>
<Domain>DOMAIN_SEA</Domain>
<DefaultUnitAI>UNITAI_WORKER_SEA</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_WORK_BOAT</Description>
<Civilopedia>TXT_KEY_UNIT_WORK_BOAT_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_WORK_BOAT_STRATEGY</Strategy>
<Advisor>ADVISOR_ECONOMY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bQuickCombat>0</bQuickCombat>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>0</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>0</bPillage>
<bSpy>0</bSpy>
<bSabotage>0</bSabotage>
<bDestroy>0</bDestroy>
<bStealPlans>0</bStealPlans>
<bInvestigate>0</bInvestigate>
<bCounterSpy>0</bCounterSpy>
<bFound>0</bFound>
<bGoldenAge>0</bGoldenAge>
<bInvisible>0</bInvisible>
<bFirstStrikeImmune>0</bFirstStrikeImmune>
<bNoDefensiveBonus>0</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bCanMoveAllTerrain>0</bCanMoveAllTerrain>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>1</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>1</bMechanized>
<bRenderBelowWater>1</bRenderBelowWater>
<bSuicide>0</bSuicide>
<bHiddenNationality>0</bHiddenNationality>
<bAlwaysHostile>0</bAlwaysHostile>
<UnitClassUpgrades/>
<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>
<FlankingStrikes/>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_WORKER_SEA</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs/>
<Builds>
<Build>
<BuildType>BUILD_FISHING_BOATS</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_WHALING_BOATS</BuildType>
<bBuild>1</bBuild>
</Build>
<Build>
<BuildType>BUILD_OFFSHORE_PLATFORM</BuildType>
<bBuild>1</bBuild>
</Build>
</Builds>
<ReligionSpreads/>
<CorporationSpreads/>
<GreatPeoples/>
<Buildings/>
<ForceBuildings/>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqCorporation>NONE</PrereqCorporation>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>TECH_FISHING</PrereqTech>
<TechTypes/>
<BonusType>NONE</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>30</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>2</iMoves>
<bNoRevealMap>0</bNoRevealMap>
<iAirRange>0</iAirRange>
<iAirUnitCap>0</iAirUnitCap>
<iDropRange>0</iDropRange>
<iNukeRange>-1</iNukeRange>
<iWorkRate>100</iWorkRate>
<iBaseDiscover>0</iBaseDiscover>
<iDiscoverMultiplier>0</iDiscoverMultiplier>
<iBaseHurry>0</iBaseHurry>
<iHurryMultiplier>0</iHurryMultiplier>
<iBaseTrade>0</iBaseTrade>
<iTradeMultiplier>0</iTradeMultiplier>
<iGreatWorkCulture>0</iGreatWorkCulture>
<iEspionagePoints>0</iEspionagePoints>
<TerrainImpassables>
<TerrainImpassable>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<bTerrainImpassable>1</bTerrainImpassable>
</TerrainImpassable>
</TerrainImpassables>
<FeatureImpassables/>
<TerrainPassableTechs>
<TerrainPassableTech>
<TerrainType>TERRAIN_OCEAN</TerrainType>
<PassableTech>TECH_ASTRONOMY</PassableTech>
</TerrainPassableTech>
</TerrainPassableTechs>
<FeaturePassableTechs/>
<iCombat>0</iCombat>
<iCombatLimit>0</iCombatLimit>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>0</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>0</iFirstStrikes>
<iChanceFirstStrikes>0</iChanceFirstStrikes>
<iInterceptionProbability>0</iInterceptionProbability>
<iEvasionProbability>0</iEvasionProbability>
<iWithdrawalProb>0</iWithdrawalProb>
<iCollateralDamage>0</iCollateralDamage>
<iCollateralDamageLimit>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iAnimalCombat>0</iAnimalCombat>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives/>
<FeatureNatives/>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>0</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>1</iAsset>
<iPower>0</iPower>
<UnitMeshGroups>
<iGroupSize>1</iGroupSize>
<fMaxSpeed>2.25</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>1</iMeleeWaveSize>
<iRangedWaveSize>1</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_WORKBOAT</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_WORKBOAT_MODERN</LateArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<FormationType>FORMATION_TYPE_MACHINE</FormationType>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
</UnitInfo>
</UnitInfos>
</Civ4UnitInfos>
TAfirehawk
Nov 17, 2007, 01:00 PM
Philosophy and Documentation of Misc. Items
Folder Structure
Mods\World of Civilization\Assets
Art\ - some art files like the Main Menu and Loading screens here
EmptyModuleExample\ - WoC schema files and examples showing required TAGS
Modules\ - location for all modules
Art Styles\ -
Balance\ -
Buildings\ -
Builds\ -
Civics\ -
Civilizations\ -
Combat\ -
Corporations\ -
Events\ -
Game Concepts\ -
Interface\ -
LeaderHeads\ -
Maps\ -
Original BtS\ -
Projects\ -
Python Screens\ -
Religions\ -
Resources\ -
Scenarios\ -
Technologies\ -
Units\ -
Wonders\ -
Python\ - location for all python files
Res\Fonts\ - GameFont files
Sounds\ - soundtrack for Main Menu
Unloaded Modules\ - location for modules that are not loaded into game
XML\ - regular BtS XML
Mods\World of Civilization\SDK - source code
Files outside of Modules
TAfirehawk
Feb 09, 2008, 08:43 AM
Folder Structure updated.
xienwolf
May 20, 2008, 02:20 AM
Having made (essentially) all the fields optional, the next step is to make the order not matter. I know that the DLL doesn't care too much about the order, and I have recently discovered that the XML doesn't care where you place <Button/> in the CIV4PromotionInfos.xml. I thought it was because of the maxoccurs"*" at first, but placing that on another field didn't let me move it around. So I will hope for future inspiration to puzzle it out for me if none of you have already solved it.
xienwolf
May 20, 2008, 08:51 AM
Figured out why Button is so special. Looks like bGraphicalOnly would also be completely free placement. Each are defined as a global attribute, not tied to specific Cv sections. Pretty nifty effect, and I am wondering if you could do it for more things in the game to make it easier to have a field used in multiple files :)
TAfirehawk
Jul 28, 2008, 10:19 PM
Please use the wiki for updated info here, thanks.
http://woc.dreamhosters.com/wiki/index.php?title=Main_Page