Need to confirm that I'm right on a few of the basics

Evening ladies and gentlemen!

Ok, so I've found Faction Defs, and I know that I need to copy this into my Mods directory, then rename it for whatever faction I want to create, then go into it with Notepad++, delete all Defs but one (to use as a template) at which point I get the below.  Just a few questions :-)

<Faction>
<InternalName>FACTION_TERRAN</InternalName>  Is this what the faction is known as only in the XML?
<DisplayName>FACTION_TERRAN_Name</DisplayName>  Is this the full name of the faction in game?
<DisplayNameShort>FACTION_TERRAN_ShortName</DisplayNameShort>
<LeaderName>FACTION_TERRAN_LeaderName</LeaderName>
<Description>FACTION_TERRAN_Dec</Description>  When making my own factions do I have to type the whole description in here?  Or do I reference a word file?

<LeaderDescription>FACTION_TERRAN_LeaderDec</LeaderDescription>  Same question as above.

<RaceType>Major</RaceType>
<PersonalityTraits>Neutral</PersonalityTraits>  Is this the Ethical stance, as in Benevolent/Malevolent?
<PersonalityTraits>Expansionist</PersonalityTraits>
<PersonalityTraits>Diplomatic</PersonalityTraits>
<RaceTraits>EngineersAbility</RaceTraits>
<RaceTraits>ColonizersAbility</RaceTraits>
<RaceTraits>Productive2</RaceTraits>  For all the race traits, I'm assuming that 4=+2, 3=+1 and so on, is this correct?
<RaceTraits>Adventuresome2</RaceTraits>
<RaceTraits>Likeable2</RaceTraits>
<RaceTraits>Fast2</RaceTraits>
<RaceTraits>Organized2</RaceTraits>
<RequiresHomeworld>true</RequiresHomeworld>
<HomeStarSystem>SolSystem</HomeStarSystem>
<StartingShips>ColonyStaticBlueprint</StartingShips>
<StartingShips>SurveyStaticBlueprint</StartingShips>
<StartingShips>ScoutStaticBlueprint</StartingShips>
<TechTree>Terran_Tree</TechTree>
<ShipCallsign>FACTION_TERRAN_Callsign</ShipCallsign>  Can I just input my own callsign here?  'HMS' for example.
<LogoImage>RaceLogo00.png</LogoImage>
<LeaderThumbnail>GC3_DL_Bradley_Small.png</LeaderThumbnail>  Where in the directory do I put the leader pics?
<NewsRobotMovie_Approach>Terran_ResearchAdviser_Approach.bk2</NewsRobotMovie_Approach>
<NewsRobotMovie_Idle>Terran_ResearchAdviser_Idle.bk2</NewsRobotMovie_Idle>
<StartupImage>StartGameTerran.png</StartupImage>
<StartupTitle>FACTION_TERRAN_StartupTitle</StartupTitle>
<StartupDescription>FACTION_TERRAN_StartupDescription</StartupDescription>
<StartupTraitsDescription>FACTION_TERRAN_StartupTraitsDescription</StartupTraitsDescription>
<ConquestMovie>MilVic_TERRAN.bk2</ConquestMovie>
<MapColorDef>TerranMapColors</MapColorDef>
<UIColorDef>TerranUIColors</UIColorDef>
<FactionMoviesFGDef>TerranMoviesFG</FactionMoviesFGDef>
<FactionMoviesBGDef>TerranMoviesBG</FactionMoviesBGDef>
<FactionMusicDef>TerranMusic</FactionMusicDef>
<Material1>GC3_Ship_Material_01</Material1>  
<Material2>GC3_Ship_Material_02</Material2>
<Surface1>GC3_Default_Surface_01</Surface1>
<Surface2>GC3_Default_Surface_02</Surface2>
<Appearance>GC3_Terran_Appearance</Appearance>
<ShipStyleSet>TerranShipStyleSet</ShipStyleSet>
<CreditsInit>5000</CreditsInit>

 

In regard to the below - what are the scales?  Obviously 0 is the lowest, but what are the highest?

<WarEnduranceInit>90</WarEnduranceInit>
<DefaultResistance>0.25</DefaultResistance>
<InfluenceTallyInit>10</InfluenceTallyInit>
<StartingColonyPopulation>10</StartingColonyPopulation>
<AICategoryWeight>
<Military>15</Military>
<Growth>10</Growth>
<Tech>20</Tech>
<Diplomacy>15</Diplomacy>
<Expansion>20</Expansion>
<Wealth>10</Wealth>
<Influence>5</Influence>
<Fortification>5</Fortification>
</AICategoryWeight>
</Faction>

If you guys can answer these for me I should be able to make a start on the basics - thanks in advance! :-)

 


10,616 views 8 replies
Reply #1 Top

<InternalName> is how you reference the object defined in this code block in other xml files.

<DisplayName> is a string reference - the game looks at the text files, locates this, and then prints whatever string is attached there.

<Description> is another string reference and operates the same way.

<PersonalityTraits> refer to the various AI personality types. Different AI personalities react differently in diplo, and can have different scripted behaviour.

<RaceTraits> go from 1 (highest bonus) to 4 (worst penalty).

<ShipCallsign> is another string ref.

<WarEnduranceInit> is a hidden stat which determines how long an AI will hold out for. Various actions in war increase or decrease war endurance. The higher this number is, the longer the AI will hold out. I don't think there's any upper limit.

<DefaultResistance> is the basic resistance; again there's no hard limit, but keeping it below 1 is a good idea.

<InfluenceTallyInit> is starting inf. This can again be however big as you like, but obviously it will impact your borders so making it too big is just silly.

<StartingColonyPopulation> is the starting population, and yet again there's no real limit - but population will die if there's no food for them.

 

The things at the bottom (in the AI category Weight scope) are tech weights. They're a weight table. They only have value in relation to each other. Since most of the techs and strategies are based around 25ish (though there's numerous examples of anything upto 100),  good range to keep it in is 0-25, unless you want to re-write the whole AI tech selection system (which I've done, and it's very tedious).

Reply #2 Top

Cheers for the answers mate - but they have spawned more questions lol!

What is a string reference. and how do I change it?

Is the AI Weight scope like the Priority Order in the Custom Faction UI?  If so can I leave that alone in the XML and amend it in the UI afterwards?  

In fact, thats a general question - I take it that any XML created custom faction can then be amended or customized further in-game?

Reply #3 Top

Quoting LeoncitoGB, reply 2

What is a string reference. and how do I change it?
End of LeoncitoGB's quote

 

It's the internal name of a string. A string is words that will be printed on screen. So in the case of FACTION_TERRAN_Name, there's a text file which contains something like this:


<StringTable>
<Label>FACTION_TERRAN_Name</Label>
<String>The Terran Alliance</String>
</StringTable>

End of quote

When the game refers to FACTION_TERRAN_Name on-screen, it will print 'The Terran Alliance'.

 

Quoting LeoncitoGB, reply 2

Is the AI Weight scope like the Priority Order in the Custom Faction UI?  If so can I leave that alone in the XML and amend it in the UI afterwards?  

In fact, thats a general question - I take it that any XML created custom faction can then be amended or customized further in-game?
End of LeoncitoGB's quote

 

I've no idea if you can alter them, though I'd doubt it. In-game factions are created as .faction files, which aren't xml. You'll be able to copy and edit them, though.

 

If you're just looking to make a faction, then doing it via the in-game eidtor is much easier than using the xml - it's one of the few tools we have. You can do almost all the same stuff, aside from changing the population and starting cash.

Reply #4 Top

Hmmm, so if I create a faction with the UI what does the game set as the resistance, war endurance etc?  Or can I create a faction in the UI, then mod those particular aspects in the XML afterwards?

I suppose this is all leading to a question re what order should I do things - would you say the below is a good way of doing it?

1-Create a custom faction in the UI.

2-Mod the war endurance, resistance etc in the XML (if so, would I still copy and paste the Faction Def into my mod directory at this point, or can I leave it in Faction Defs if I have created it in the UI?

3-Design custom ship set

Tbh, those 3 would be everything that I want to do for each of the custom factions I have in mind - I'm not going to get mixed up in the tech trees just yet!

Reply #5 Top

Quoting LeoncitoGB, reply 4

Or can I create a faction in the UI, then mod those particular aspects in the XML afterwards?
End of LeoncitoGB's quote

The in-game faction editor does not write any XML files that are readily visible to the user; if any are written, they are buried inside a *.faction file that no one has yet figured out how to edit, at least to the best of my knowledge. If you want to be able to edit a custom faction without resorting to the in-game faction editor, then you are going to have to create the custom faction without the aid of the in-game editor. It is therefore unlikely that you will be able to create a faction using the in-game editor and then mod whatever aspects you wish to change later, unless you can figure out how to edit a *.faction file without using the in-game editor (in which case, good work; as far as I know, you'd be the first to do so outside of Stardock).

As far as what the default values are, my guess is that FACTION_DEFAULT, defined in FactionDefs.XML, is the template used for custom factions if you don't copy another faction. I am not sure that this is the case, however, and I don't know whether the *.faction file simply stores a set of modifiers to apply to the template or if the *.faction file stores a modified copy of the template or something else.

Reply #6 Top

Ahhh ok, well in that case how about the other way around?

I don't really have the vocabulary to ask the question directly so let me know if this is possible -

1-Design a custom faction using the UI

2-Design custom ships in the UI

3-Create the custom ship set in the XML

4-Apply the new custom ship set to the custom faction previously created in the UI

 

I suppose what I mean is - can you create a custom ship set independently of a XML created custom faction?  Or is it in for a penny in for a pound - as in, do you have to create a custom ship set through the XML in tandem with an XML created custom faction?

Reply #7 Top

Quoting LeoncitoGB, reply 6

I suppose what I mean is - can you create a custom ship set independently of a XML created custom faction? Or is it in for a penny in for a pound - as in, do you have to create a custom ship set through the XML in tandem with an XML created custom faction?
End of LeoncitoGB's quote

If you successfully create a proper ship style set, it should show up in game as a selectable ship style. There should not be any issues with creating a custom faction using the in-game faction editor that uses that ship style, unless perhaps you get rid of the ship style without getting rid of the custom faction and then try to start a new game as that custom faction.