Avorion

Avorion

Not enough ratings
Faction Pack Creation Tips
By Helios
Things I've learnt while making my own faction pack.
   
Award
Favorite
Favorited
Unfavorite
General Tips
Auto Scaling
The game will determine a base volume value, based on the distance of the faction's home sector to the center, then upscale/downscale all ships and stations spawned by that faction accordingly. The scaling is done uniformly, no stretching in a single axis.


Left: Original size. Right: Size spawned by the faction.


Size stats of the three ships, spawned by a faction. Note they have exactly the same volume.

Texture-based details will be changed or lost due to scaling.

Material Upgrading/Downgrading

Ship materials will also upgrade/downgrade automatically. The game will pick a material for the ship, then change all blocks to that material if possible.

If some blocks are unavailable in the changed material, I.E. a ship equipped with advanced modules like Xanion Transporters were downgraded into a Titanium one, the unavailable blocks will be kept on the ship. This made it possible to acquire late game materials (or even entire functional late game ships if they were successfully boarded) way ahead of time!

Two carriers spawned during a faction war. The one on the right is made of Titanium, but still keeps its Trinium Hangers. Xanion Transporters and Cloning Pods inside the ship also remain.

To avoid this, do the following:
Remove all Transporter, Hyperspace Core, Computer Core, Academy and Cloning Pod blocks from your ship. The AI ships won't benefit from them anyway, even the transporter on freighter is useless as the spawned ship lacks transporter software.

Remove all the Hangers too, if it's not a carrier.

Change Avorion Inertia Dampeners into Iron ones. Alternatively, you could use the Modify Entire Ship option from the build mode, as the spawned ship will be automatically upgraded into a suitable material.

If it has shields, make sure your faction's maxDist is equal or lower than 350.

For reference, here is a list of the material "zones" and their distance to the center:

Distance
Material Zone
0-75
Avorion
75-150
Ogonite
150-200
Xanion
200-300
Trinium
300-350
Naonite
350-500
Iron/Titanium
About Ships
Generic warships (sector defenders):
  • Equipped with 10 exact copies of the same weapon.
  • Turrets will be randomly placed on Turret Base blocks. If there are not enough base blocks available, the remaining blocks will be placed randomly on suitable surfaces.
  • Edge Turret Base (the angled one) will not be used.
  • Coax guns mounts will be treated like normal turret bases.
  • Does not use torpedoes, even if they have torpedo tubes.
  • Warships spawned by the same faction always have the same volume.

Turrets will use the vanilla model. Custom turret designs are discarded, most likely due to incompatibility with scaling.


These were meant for coax guns, but the spawned ship treat them as normal turret bases.

Carriers:
  • Only show up during faction war from Trinium sectors onward.
  • Equipped with 10 Point Defense Chainguns and 10 Anti-Fighter Cannons. No offensive weapons.
  • Carries about 10 fighters.
  • Always have the same volume, roughly twice as large compared to warships.

Miners:
  • Equipped with 10 exact copies of the same mining laser.
  • Volume is relative to the size of warships but varies greatly, no standard volume.

The turret bases on this downscaled ship were too small for 1.5 size mining turrets, so the rest of them were placed on the flat side of the hull. Also note the angled turret bases were not used.

Freighters:
  • Sometimes unarmed.
  • Equipped with 10 weapons like warships if armed.
  • Volume is relative to the size of warships but varies greatly, no standard volume.

Fighter designs are purely cosmetic (and barely noticeable) as always.

To ensure optimal turret placement, make sure you have at least 10 normal sized turret bases for warships, or 20 smaller ones for carriers, as carriers are much larger than warships, and PDs are always 0.5 in size. Keep the auto scaling in mind.

Classification
The game classifies generated ships by volume.

Combat ships:
  • Below 128 k = Scout
  • 128 k - 320 k = Sentinel
  • 320 k - 800 k = Hunter
  • 800 k - 2 mil = Corvette
  • 2 mil - 5 mil = Frigate
  • 5 mil - 12.5 mil = Cruiser
  • 12.5 mil - 19.7 mil = Destroyer
  • 19.7 mil - 31.2 mil = Dreadnought
  • 31.2 mil - 49.4 mil = Battleship
(Yes, Destroyer is considered larger than Cruiser, that's why you rarely see them.)

Miners:
  • Below 320 k = Light Miner
  • 320 k - 2 mil = Miner
  • 2 mil - 12.5 mil = Heavy Miner
  • 12.5 mil - 31.2 mil = Mining Moloch

Freighters:
  • Below 128 k = Transporter
  • 128 k - 320 k = Lifter
  • 320 k - 800 k = Freighter
  • 800 k - 2 mil = Loader
  • 2 mil - 5 mil = Cargo Transport
  • 5 mil - 12.5 mil = Cargo Hauler
  • 12.5 mil - 19.7 mil = Heavy Cargo Hauler

About Stations
Stations follow the same volume-based scaling rule as ships. Like miners and freighters, stations have no standard volume and varies greatly from station to station. The level of factory stations also have no correspondence to its volume, an "M" factory could be several times larger in volume than an "XL" factory.

Most of the stations are unarmed, except the military outpost and headquarter (10 turrets each).

The amount of assembly blocks does affect the production speed of spawned factory stations, if the type of factory can benefit from additional production.

Docks

A station must have at least one dock, to a maximum of four.

Even though the "clearance box" of docks can overlap, the "docking guide lights" projected by each dock must NOT overlap in order to be considered functional.

Only two docks are functional here.

That being said, there are still some space between the dock block and the "clearance box" it projects. You can build within this space as long as the "clearance box" remains clear.


The dock remains functional even if the surface is covered. This allows some limited greebling.

The station will also project six blinking "warning lights" on the further most blocks of each axis.

I recommend adding some kind of antenna for those blinking lights, otherwise they'll just show up in the middle of nowhere.
Best Practices, or the TL;DR version
Do NOT supply the entire range of ship classes from corvettes to battleships in a single pack, or you'll end up with huge corvettes and tiny battleships. Instead, choose or build similar sized ships and stations according to the faction's spawn range.

Here's a list of spawn range and its average volume for reference, calculated from game code.
Miners and Freighters can vary but the average volume is the same as the standard ship volume.
Station volume will hit the upper limit at around 200 distance, so it stops growing at 0-100 range.
Spawn Range
Avg. Ship Volume
Avg. Carrier Volume
Avg. Station Volume
0-100
18.6 mil
37.3 mil
375 mil
100-200
13 mil
26.1mil
375 mil
200-300
7.9 mil
15.8 mil
263.4 mil
300-400
3 mil
6.1 mil
102.2 mil
400-500
1.4 mil
(No Carriers)
48 mil

For example, a good faction pack would look like this:
==========================================
minDist = 300,
maxDist = 400,

ships =
{
"Ship1.xml", -- 3 mil volume
"Ship2.xml", -- 3.2 mil volume
"Ship3.xml", -- 2.7 mil volume
},

carriers = {"Carrier1.xml",}, -- 6.5 mil volume
freighters = {"Freighter1.xml",}, -- 3.3 mil volume
miners = {"Miner1.xml",}, -- 2.8 mil volume
fighters = {"fighter.xml",},

stations =
{
"Station1.xml", -- 101 mil volume
"Station2.xml", -- 103.2 mil volume
"Station3.xml", -- 94.7 mil volume
"Station4.xml", -- 112 mil volume
"Station5.xml", -- 104.5 mil volume
},
==========================================

This will make the ships and stations look consistent in size, minimizing the effect of auto scaling.
3 Comments
lemoneldar9 25 May, 2021 @ 4:38pm 
Thanks for answering my questions! I never consider hollowing since it seems counter-intuitive to have wasted space in a space ship, but I guess for now that's the only way to do it. Until someone else makes a mod, or I get frustrated enough and do it myself.
Helios  [author] 25 May, 2021 @ 10:27am 
@fortehzian
A faction only have a single class of warship (sector defenders), namely the category called "ships" in factionpack.lua. Every ship from that category will be scaled to the same volume, calculated from that faction's home sector coordinates. There's no such thing as "a mix of ship classes" for sector defenders of the same faction.

Pirates and Xsotans doesn't have a home sector, so their volume is based on the coordinates they were spawned in.

There is a workaround to visually maintain a large ship's original size: hollowing. By removing some internal components, you can reduce its volume without downscaling it, bringing its volume closer to other smaller ships in the pack.
lemoneldar9 24 May, 2021 @ 6:45pm 
Great write up, I spent hours reading and trying to understand how to put together these faction packs. I had a few questions that maybe you know the answer from testing.

When spawning sector defenders, does the game just look at average volume and scale everything else to it?
Is there any logic that tries to spawn a mix of ship classes?
Do Pirates and Xsotans follow the same rules?

From my understanding, it seems that using sci-fi ships from other settings doesn't lead to great results in terms of maintaining their realism. Without actually digging into the code and remaking the system, I don't see a way to make a faction pack, or several, that uses ships from other settings, and have it work as I think we want it to i.e. fly into a sector and see a faction spawn a fleet of outside IP ships whilst having a balanced fleet. Correct me if I'm wrong on any of this.