Any luck with modding component weight in policy files?

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
Jorgen_CAB
Posts: 866
Joined: Wed Mar 17, 2010 7:53 pm

Any luck with modding component weight in policy files?

Post by Jorgen_CAB »

So... have anyone managed to get the weighting system for the component selections in the policy files to actually work properly?!?

For example I have tried to change how different races would prefer shields with a good recharging rate or shields strength.

The end result was that the AI are just stuck using the same component shield no matter what value I put in those fields.

It is quite time consuming to mod these things and then find out they don't work after hours of modding, meaning you have to find a different solution or just give up... right now I'm at the stage that I want to just pause with the modding as I found so many things in the files not working properly or at all.

But... then I keep on testing a bit more.. so... policy files don't work when they are in the mod folder or in mod/policy folder... I can only get them to work if I mod them in the data/policy folder. In addition to that I must set some extreme value like 10 on hyperdrive speed to get the AI to select faster hyperdrives over quicker jump initiation time drives for example... does not make sense at all. For shields I had to add 5 as the value to get the AI to select stronger shields over quicker regeneration ones.
These values make no sense when I look at what values are set for preference of vanilla races in any way.

The following...
<ReactorFuelUsageFactor>1</ReactorFuelUsageFactor>
Also seem to weight the highest fuel use rather than lower... which make no sense as that mean I can get the AI to ever pick the fusion reactor over the quantum reactor.

There probably is more issues but these are the one I have found so far...
User avatar
frankycl
Posts: 402
Joined: Mon Mar 01, 2021 5:16 pm

Re: Any luck with modding component weight in policy files?

Post by frankycl »

Jorgen_CAB wrote: Sun Mar 26, 2023 8:55 pm So... have anyone managed to get the weighting system for the component selections in the policy files to actually work properly?!?
(...)
First of all, those are all quite vague reports/descriptions - like "no matter what value I put in those fields" - what fields do you mean exactly - and what values ?
But if you really want that somebody would help you, you'd either need to describe much more in detail what you are doing, or should post some code-excerps or upload your edited files, I think. ;)

And secondly, the policy files are only for general properties/characteristics of the regarded races and can not (normally - or not that I'd know of) be used to define anything the AI should do with special components or objects - I gues you'd have to do this in other XMLs, like e.g. the ComponentDefinitions.xml. ;)
Jorgen_CAB
Posts: 866
Joined: Wed Mar 17, 2010 7:53 pm

Re: Any luck with modding component weight in policy files?

Post by Jorgen_CAB »

frankycl wrote: Sun Mar 26, 2023 10:08 pm
Jorgen_CAB wrote: Sun Mar 26, 2023 8:55 pm So... have anyone managed to get the weighting system for the component selections in the policy files to actually work properly?!?
(...)
First of all, those are all quite vague reports/descriptions - like "no matter what value I put in those fields" - what fields do you mean exactly - and what values ?
But if you really want that somebody would help you, you'd either need to describe much more in detail what you are doing, or should post some code-excerps or upload your edited files, I think. ;)

And secondly, the policy files are only for general properties/characteristics of the regarded races and can not (normally - or not that I'd know of) be used to define anything the AI should do with special components or objects - I gues you'd have to do this in other XMLs, like e.g. the ComponentDefinitions.xml. ;)
I DID say what values... did you not read it all? ;)

I don't think you know how the policy files work... it defines a weighting system for how difference races consider different components on their ships. I think you need to check the file first...

I did explain a few example in the OP and also that I could get it to work and that it was weird how it works.

This is.. that I just recently moved the modded files from the data folder to the mod folder and that is when I started to have problem with it. I also recently started manipulating the weighting system for the components for each race to.

There are three XML files you can manipulate what components and on what ships a specific race use to design ships. The Race policy XML, DesignTemplates.xml and the Races.xml.

I do know how this work and have successfully moded this so far, but some values don't work correctly... such as for the reactor for example as I stated... problem is that I don't trust it as it seem unstable what works and what does not work. The policy files don't even work if you put them into the mod folder.
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Any luck with modding component weight in policy files?

Post by iancmtaylor »

-- All of the XML data files use this same file-naming and item-overriding approach. So you can change data in the base XML data files by using the same Id value in a modded file, e.g. OrbTypeId for OrbTypes.xml, ResearchProjectId for ResearchProjectDefinitions.xml, etc.
- All of the following XML data files can be modded:
-- ArmyTemplates.xml, Artifacts.xml, CharacterAnimations.xml, CharacterRooms.xml, ColonyEventDefinitions.xml, ComponentDefinitions.xml, CreatureTypes.xml, DesignTemplates.xml, FleetTemplates.xml, GameEvents.xml, Governments.xml, OrbTypes.xml, PlanetaryFacilityDefinitions.xml, Races.xml, ResearchProjectDefinitions.xml, Resources.xml, ShipHulls.xml, SpaceItemDefinitions.xml, TroopDefinitions.xm

Your policy file is not supported :/
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
Jorgen_CAB
Posts: 866
Joined: Wed Mar 17, 2010 7:53 pm

Re: Any luck with modding component weight in policy files?

Post by Jorgen_CAB »

iancmtaylor wrote: Mon Mar 27, 2023 4:42 am -- All of the XML data files use this same file-naming and item-overriding approach. So you can change data in the base XML data files by using the same Id value in a modded file, e.g. OrbTypeId for OrbTypes.xml, ResearchProjectId for ResearchProjectDefinitions.xml, etc.
- All of the following XML data files can be modded:
-- ArmyTemplates.xml, Artifacts.xml, CharacterAnimations.xml, CharacterRooms.xml, ColonyEventDefinitions.xml, ComponentDefinitions.xml, CreatureTypes.xml, DesignTemplates.xml, FleetTemplates.xml, GameEvents.xml, Governments.xml, OrbTypes.xml, PlanetaryFacilityDefinitions.xml, Races.xml, ResearchProjectDefinitions.xml, Resources.xml, ShipHulls.xml, SpaceItemDefinitions.xml, TroopDefinitions.xm

Your policy file is not supported :/
But WHY!!!!

It has to be a bug or oversight... yes?!?

You can mod that file in the data/policy and it works. Elliot even mentioning modding these specific files is OK in this thread... https://www.matrixgames.com/forums/view ... 9&t=380486.

I have modded this file since day one of the game without problems. You just can't store them in the mod folder, you have to overwrite the original files and make a copy of the original ones for safe keeping. Not very modder friendly if you ask me.

The second issue is that whatever values THEY themselves used in this file does not seem to be having any effect on the game as you have to put MUCH higher values for them to have any real effect. I think this is either a BUG or whatever values they use to differentiate the races need with needs to be re-evaluated in the vanilla game.
Post Reply

Return to “Design and Modding”