Modding stuff learned so far

Please post here for questions and discussion about data, event, art and sound modding and the game editor for Distant Worlds.

Moderator: MOD_DW2

Post Reply
JohntheGamer
Posts: 3
Joined: Wed Mar 23, 2022 4:21 pm

Modding stuff learned so far

Post by JohntheGamer »

This is what I've found so far:
(ComponentDefinitions, PlanetaryFacilityDefinitions, ResearchProjectDefinitions, ShipHulls)

1. Changes made to the research, component or planetary facilities will not work until you start a new game. No modding savegames as far as I have found.

2. It is possible to make a component with a negative size.
It seems to work for defensive components (shields/armour), but not for general components. If you give, say, a crew compartment a negative size, the game will never stop loading the galaxy creation. I have not tried other component types.

3. New components must follow the numbering. So if the last component is numer 368 (Super Laser), then your custom components must start with number 369. If you skip a number the game will crash.

4. Ship bonusses added to research items do not seem to work. You will need to add these to components instead.

Example:
<EmpireBonuses>
<Bonus>
<Type>ShipManeuvering</Type>
<Amount>0.4</Amount>
<AppliesTo>Empire</AppliesTo>
<FilterId>0</FilterId>
<DiscoveryLevel>0</DiscoveryLevel>
<Description />
</Bonus>
</EmpireBonuses>

Does show up in the technology description, but does not seem to work.

5. It is possible for ship maintainance to go negative, thus giving you income for every ship you have running around.

6. It is totally possible for a component to combine stats, such as armour, power generation, energy collection, crew capacity, etc.

Example:
<ComponentStats>
<AreaShieldRechargeAmount>0</AreaShieldRechargeAmount>
<AreaShieldRechargeEnergyUsedPerUnitCharged>0</AreaShieldRechargeEnergyUsedPerUnitCharged>
<AreaShieldRechargeRange>0</AreaShieldRechargeRange>
<ArmorBlastRating>80</ArmorBlastRating>
<ArmorReactiveRating>8</ArmorReactiveRating>
<AssaultDefense>60</AssaultDefense>
<AssaultPodBoardingRange>0</AssaultPodBoardingRange>
<AssaultPodEnergyPerLaunch>0</AssaultPodEnergyPerLaunch>
<AssaultPodLaunchRate>0</AssaultPodLaunchRate>
<AssaultPodMovementSpeed>0</AssaultPodMovementSpeed>
<AssaultPodShieldPenetration>0</AssaultPodShieldPenetration>
<AssaultPodStrength>0</AssaultPodStrength>
<CargoCapacity>0</CargoCapacity>
<ColonizationPopulationAmount>0</ColonizationPopulationAmount>
<CommandMaintenanceSavings>0.2</CommandMaintenanceSavings>
<CommerceTradeBonus>0</CommerceTradeBonus>
<ComponentCountermeasuresBonus>0</ComponentCountermeasuresBonus>
<ComponentIonDefense>8</ComponentIonDefense>
<ComponentTargetingBonus>0</ComponentTargetingBonus>
<ConstructionBuildSpeed>0</ConstructionBuildSpeed>
<ConstructionRepairSpeed>0</ConstructionRepairSpeed>
<ConstructionYardCount>0</ConstructionYardCount>
<CountermeasuresBonus>0</CountermeasuresBonus>
<CountermeasuresFleetBonus>0</CountermeasuresFleetBonus>
<CrewCapacity>60</CrewCapacity>
<CrewRequirement>0</CrewRequirement>
<DamageReduction>0</DamageReduction>
<DamageRepair>0</DamageRepair>
<DestroyedRepairChance>0</DestroyedRepairChance>
<HullRepair>0</HullRepair>
<DockingBayShipCount>0</DockingBayShipCount>
<DockingBayThroughput>0</DockingBayThroughput>
<EnergyCollectionRate>20</EnergyCollectionRate>
<EnergyFuelProductionRate>0</EnergyFuelProductionRate>
<EngineMainCruiseThrust>0</EngineMainCruiseThrust>
<EngineMainCruiseThrustEnergyUsage>0</EngineMainCruiseThrustEnergyUsage>
<EngineMainMaximumThrust>0</EngineMainMaximumThrust>
<EngineMainMaximumThrustEnergyUsage>0</EngineMainMaximumThrustEnergyUsage>
<EngineVectoringEnergyUsage>0</EngineVectoringEnergyUsage>
<EngineVectoringThrust>0</EngineVectoringThrust>
<ExtractionRate>0</ExtractionRate>
<ExtractionRangeAsteroid>0</ExtractionRangeAsteroid>
<RemoteFuelTransferRate>0</RemoteFuelTransferRate>
<RemoteFuelTransferRange>0</RemoteFuelTransferRange>
<FighterBayBuildRate>0</FighterBayBuildRate>
<FighterBayCapacity>0</FighterBayCapacity>
<FighterBayRepairRate>0</FighterBayRepairRate>
<FuelStorageCapacity>80</FuelStorageCapacity>
<HyperDenyEnergyUsage>0</HyperDenyEnergyUsage>
<HyperDenyRange>0</HyperDenyRange>
<HyperDenyStrength>0</HyperDenyStrength>
<HyperDriveBlockingInsulation>0</HyperDriveBlockingInsulation>
<HyperDriveEnergyUsage>0</HyperDriveEnergyUsage>
<HyperDriveJumpInitiationTime>0</HyperDriveJumpInitiationTime>
<HyperDriveJumpRange>0</HyperDriveJumpRange>
<HyperDriveRechargeTime>0</HyperDriveRechargeTime>
<HyperDriveSpeed>0</HyperDriveSpeed>
<HyperDriveJumpAccuracy>0</HyperDriveJumpAccuracy>
<HyperStopRange>0</HyperStopRange>
<HyperStopStrength>0</HyperStopStrength>
<IonDamageDefense>4</IonDamageDefense>
<MedicalRating>0</MedicalRating>
<PassengerCapacity>0</PassengerCapacity>
<ReactorEnergyOutputPerSecond>60</ReactorEnergyOutputPerSecond>
<ReactorEnergyStorageCapacity>180</ReactorEnergyStorageCapacity>
<ReactorFuelResourceId>14</ReactorFuelResourceId>
<ReactorFuelUnitsForFullCharge>0.4</ReactorFuelUnitsForFullCharge>
<RecreationRating>0</RecreationRating>
<ResearchLabOutput>0</ResearchLabOutput>
<ScannerEmpireMaskingPower>0</ScannerEmpireMaskingPower>
<ScannerExplorationPower>0</ScannerExplorationPower>
<ScannerExplorationRange>0</ScannerExplorationRange>
<ScannerExplorationSurveyAmount>0</ScannerExplorationSurveyAmount>
<ScannerExplorationSurveyMaximumLevel>0</ScannerExplorationSurveyMaximumLevel>
<ScannerExplorationSurveyTime>0</ScannerExplorationSurveyTime>
<ScannerExplorationTime>0</ScannerExplorationTime>
<ScannerJammingPower>0</ScannerJammingPower>
<ScannerJumpTrackingChance>0</ScannerJumpTrackingChance>
<ScannerLongRange>0</ScannerLongRange>
<ScannerLongRangePower>0</ScannerLongRangePower>
<ScannerRoleMaskingPower>0</ScannerRoleMaskingPower>
<ScannerTracePower>0</ScannerTracePower>
<ScannerTraceRange>0</ScannerTraceRange>
<ShieldRechargeRate>0</ShieldRechargeRate>
<ShieldResistance>0</ShieldResistance>
<ShieldStrength>0</ShieldStrength>
<ShieldPenetrationChance>0</ShieldPenetrationChance>
<ShieldPenetrationRatio>0</ShieldPenetrationRatio>
<StaticEnergyUsed>0</StaticEnergyUsed>
<StealthRating>0</StealthRating>
<TargetingBonus>0</TargetingBonus>
<TargetingFleetBonus>0</TargetingFleetBonus>
<TractorBeamDwellTime>0</TractorBeamDwellTime>
<TractorBeamEnergyPerShot>0</TractorBeamEnergyPerShot>
<TractorBeamFireRate>0</TractorBeamFireRate>
<TractorBeamPower>0</TractorBeamPower>
<TractorBeamPowerFalloff>0</TractorBeamPowerFalloff>
<TractorBeamRange>0</TractorBeamRange>
<TroopCapacity>0</TroopCapacity>
<WeaponAreaEffectRange>0</WeaponAreaEffectRange>
<WeaponAreaBlastWaveSpeed>0</WeaponAreaBlastWaveSpeed>
<WeaponArmorBypass>0</WeaponArmorBypass>
<WeaponBombardDamageInfrastructure>0</WeaponBombardDamageInfrastructure>
<WeaponBombardDamageMilitary>0</WeaponBombardDamageMilitary>
<WeaponBombardDamagePopulation>0</WeaponBombardDamagePopulation>
<WeaponBombardDamageQuality>0</WeaponBombardDamageQuality>
<WeaponDamageFalloffRatio>0</WeaponDamageFalloffRatio>
<WeaponDamageType>Undefined</WeaponDamageType>
<WeaponDwellTime>0</WeaponDwellTime>
<WeaponEnergyPerShot>0</WeaponEnergyPerShot>
<WeaponFireRate>0</WeaponFireRate>
<WeaponFireType>Undefined</WeaponFireType>
<WeaponInterceptComponentTargetingBonus>0</WeaponInterceptComponentTargetingBonus>
<WeaponInterceptDamageDirectFire>0</WeaponInterceptDamageDirectFire>
<WeaponInterceptDamageFighter>0</WeaponInterceptDamageFighter>
<WeaponInterceptDamageFullLengthBeam>0</WeaponInterceptDamageFullLengthBeam>
<WeaponInterceptDamageSeeking>0</WeaponInterceptDamageSeeking>
<WeaponInterceptEnergyPerShot>0</WeaponInterceptEnergyPerShot>
<WeaponInterceptFireRate>0</WeaponInterceptFireRate>
<WeaponInterceptRange>0</WeaponInterceptRange>
<WeaponInterceptIonDamageRatio>0</WeaponInterceptIonDamageRatio>
<WeaponIonEngineDamage>0</WeaponIonEngineDamage>
<WeaponIonHyperDriveDamage>0</WeaponIonHyperDriveDamage>
<WeaponIonSensorDamage>0</WeaponIonSensorDamage>
<WeaponIonShieldDamage>0</WeaponIonShieldDamage>
<WeaponIonWeaponDamage>0</WeaponIonWeaponDamage>
<WeaponIonGeneralDamage>0</WeaponIonGeneralDamage>
<WeaponRange>0</WeaponRange>
<WeaponRawDamage>0</WeaponRawDamage>
<WeaponShieldBypass>0</WeaponShieldBypass>
<WeaponSpeed>0</WeaponSpeed>
<WeaponVolleyAmount>0</WeaponVolleyAmount>
<WeaponVolleyFireRate>0</WeaponVolleyFireRate>
</ComponentStats>

7. When adding new technologies: be carefull where you place them on the techtree, they might not show up if you pick the wrong spot.

This one seems to work at least:

<Column>1</Column>
<Row>46</Row>
<PrerequisiteProjects>
<ResearchPath>
<ResearchProjectId>5</ResearchProjectId>
<PathAppearanceLikelihood>1</PathAppearanceLikelihood>
<Priority>0</Priority>
<RaceId>0</RaceId>
</ResearchPath>
</PrerequisiteProjects>

8. Every patch/update to the game seems to reset the files, so be sure to save your custom stuff in a seperate file so you can put them back into the game when needed. Savegames shouldn't be affected as far as I can tell.

9. Ship hulls are grouped by type. When adding a new hull, be sure that it has a unique level number. Escorts for instance use level 0 (standard), 1 (patrol) and 2 (heavy). So a custom escort model must be level 3 or higher.
You can then add it to a technology to unlock it. Every race needs to have their own copy (unless you only want to add a unique hull for a single chosen race).
JohntheGamer
Posts: 3
Joined: Wed Mar 23, 2022 4:21 pm

Re: Modding stuff learned so far

Post by JohntheGamer »

10. Components with negative size work, but make it impossible to retire a ship (they will remain stuck as "damaged", whilst the ship will not be broken down untill all components are destroyed).

11. Keep in mind that any "cheat" component you make will also be available to pirates and independent colonies.
JohntheGamer
Posts: 3
Joined: Wed Mar 23, 2022 4:21 pm

Re: Modding stuff learned so far

Post by JohntheGamer »

12. When changing ship hulls: The game keeps a copy of every ship in the xxx\Distant Worlds 2\data\ShipHullModelData folder. If you want your changes (such as adding component bays) to show up in the game, you have to delete the hull's file in this folder.

The game will generate a new file from the XML upon loading the game.

13. When modding ship hulls: <Size>xxx</Size> is the ships hull hitpoints. It determines the health of the ship without components.

<MaximumSize>xxx</MaximumSize> is how big the ship can get.

The amount of space available for components is MaximumSize - Size = X.

14. Components with armour tend to get knocked out first, as they are considered part of the defensive system. So if you make a reactor component with armour, it will probably get knocked out first. Keep that in mind; don't give shield points/armour points to General components if you want your ship to live through a battle. Or risk it becoming immobilized instead.
Post Reply

Return to “Design and Modding”