Templates can be added at the bottom of the galaxy map in notepad or the like. Here's an example of that (it follows after the "player count" info which I have shown too just so you know where it will be--towards bottom of map file):
playerCount 1
player
designName "NewPlayer0"
inGameName "NewPlayer0"
overrideRaceName ""
teamIndex -1
startingCredits 12000
startingMetal 6000
startingCrystal 6000
isNormalPlayer TRUE
isRaidingPlayer FALSE
isInsurgentPlayer FALSE
themeGroup ""
themeIndex 0
pictureGroup ""
pictureIndex 0
templates 1
This shows the total number of templates you will use on the map--make sure the number of templates matches that number. Next, you will actually add the templates. Here is an example of a player template named and identified as "Start":
templates 1
template
templateName "Start"
subTemplates 0
groups 6
group
condition
type "PlanetOwnerIsRaceNormalStart"
param "Tech"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Tech:CapitalShip:Colony"
item "Tech:Frigate:Light"
item "Tech:Frigate:Light"
item "Tech:Frigate:Heavy"
item "Artifact:WormholeTravel"
group
condition
type "PlanetOwnerIsRaceNormalStart"
param "Psi"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Psi:CapitalShip:Colony"
item "Psi:Frigate:Light"
item "Psi:Frigate:Light"
item "Psi:Frigate:Heavy"
item "Artifact:WormholeTravel"
group
condition
type "PlanetOwnerIsRaceNormalStart"
param "Phase"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Phase:CapitalShip:Colony"
item "Phase:Frigate:Light"
item "Phase:Frigate:Light"
item "Phase:Frigate:Heavy"
item "Artifact:WormholeTravel"
group
condition
type "PlanetOwnerIsRaceQuickStart"
param "Tech"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Tech:CapitalShip:Colony"
item "Tech:Frigate:Light"
item "Tech:Frigate:Light"
item "Tech:Frigate:Heavy"
item "Artifact:WormholeTravel"
group
condition
type "PlanetOwnerIsRaceQuickStart"
param "Psi"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Psi:CapitalShip:Colony"
item "Psi:Frigate:Light"
item "Psi:Frigate:Light"
item "Psi:Frigate:Heavy"
item "Artifact:WormholeTravel"
group
condition
type "PlanetOwnerIsRaceQuickStart"
param "Phase"
owner "PlanetOwner"
colonizeChance 0.000000
items 5
item "Phase:CapitalShip:Colony"
item "Phase:Frigate:Light"
item "Phase:Frigate:Light"
item "Phase:Frigate:Heavy"
item "Artifact:WormholeTravel"
The above template affects any player owned world it is attached to (we'll do that next). In this case, it looks at what race the planet owner is and then gives him the ships/constructions/artifacts shown in the template. If he's Advent, he gets Advent stuff, etc.
Now here is the stuff you will add to the planet you want the template on and it will be up in your galaxy file. If you open in notepad you will see the planets and stars there. Here's what they look like before the template is added say if you created the map to start with Galaxy Forge:
planet
designName "Planet154"
inGameName "Your Sample Planet"
type "Terran"
pos [ 4460 , 7387 ]
owner ""
isHomePlanet FALSE
normalStartUpgradeLevelForPopulation 0
normalStartUpgradeLevelForCivilianModules 0
normalStartUpgradeLevelForTacticalModules 0
normalStartUpgradeLevelForArtifacts 0
normalStartUpgradeLevelForInfrastructure 0
quickStartUpgradeLevelForPopulation 0
quickStartUpgradeLevelForCivilianModules 0
quickStartUpgradeLevelForTacticalModules 0
quickStartUpgradeLevelForArtifacts 0
quickStartUpgradeLevelForInfrastructure 0
planetItems
templateName ""
subTemplates 0
groups 0
spawnProbability 1.000000
useDefaultTemplate TRUE
Now to add the template we created back above, this is how the planet info above would change:
planet
designName "Planet154"
inGameName "Your Sample Planet"
type "Terran"
pos [ 4460 , 7387 ]
owner "NewPlayer0"
isHomePlanet FALSE
normalStartUpgradeLevelForPopulation 0
normalStartUpgradeLevelForCivilianModules 0
normalStartUpgradeLevelForTacticalModules 0
normalStartUpgradeLevelForArtifacts 0
normalStartUpgradeLevelForInfrastructure 0
quickStartUpgradeLevelForPopulation 2
quickStartUpgradeLevelForCivilianModules 2
quickStartUpgradeLevelForTacticalModules 2
quickStartUpgradeLevelForArtifacts 2
quickStartUpgradeLevelForInfrastructure 2
planetItems
templateName ""
subTemplates 1
template "Start"
groups 0
spawnProbability 1.000000
useDefaultTemplate FALSE
That's an example of a template applied to a player owned world. If you wanted the planet to be the player homeworld, then you would change the FALSE to TRUE on that line. Militia's are done a little differently but I don't have a working template handy for one here. Here's a link on the forum to more info that can help:
https://forums.sinsofasolarempire.com/339832