Some explanations needed on how formations work
-
We’ve been using the XTS Battleship Encounters mod on our server for years but today I decided to try to understand just how they work.
Here’s the coding for a Liberty Cruiser encounter in New York.In faction_prop.ini under affiliation = li_n_grp the following lines have been added:
npc_ship = Liberty_Cruiser
npc_ship = Liberty_Battleship
formation = cruisers, walker_m03 <= what does this reference?Apparently it references this formation in formations.ini
[Formation]
nickname = walker_m03
pos = 0, 0, 0
pos = 200, 70, 150
pos = -200, 70, 150
pos = 50, 100, 200
pos = -50, 100, 200
pos = -100, 130, 260
pos = 100, 130, 260
pl_pos = 0, 150, 400 <= Players in some formations don’t seem to be able to form at all, other times the formation is all cockeyed. For example, in the formation I’m using now I’m above but pointed nose down.- How do you read the pos = entries? If I wanted to change the formation layout, how are you certain that pos 0, 0, 0 is actually the battleship?
- Then, the surrounding positions, how do determine where the cruisers/destroyers/gunboats/fighters go? Are they determined by class somehow? What if you wanted to add CSVs or CRVs to the formation?
- In this current formation (I’m in it right now ingame), which is cruisers_liberty.ini I see one cruiser and four fighters.
- Do the formations follow an order when placing the positions? ie sc_battleships, then sc_cruisers or sc_destroyers, then sc_gunboats, and then finally sc_fighters?
This is cruisers_liberty.ini
[EncounterFormation]
ship_by_class = 1, 3, sc_cruisers <= OK, from 1-3 cruisers
pilot_job = assault_leader_job
make_class = wanderer
ship_by_class = 4, 4, sc_fighters <= always 4 fighters
pilot_job = assault_leader_job
make_class = wanderer
formation = walker_m03 <= most formations seem to use a formation_by_class entry here. How does that work? Is that related to the order the ships are listed in the preceding lines?
behavior = wander
arrival = cruise
longevity = 50
allow_simultaneous_creation = false
zone_creation_distance = 3
times_to_create = infinite[Creation]
permutation = 0, 3And this ship has been added to NPCShips.ini
[NPCShipArch]
nickname = Liberty_Cruiser
loadout = Liberty_Cruiser_Loadout
level = d19
ship_archetype = li_cruiser
pilot = cruiser_default
state_graph = CRUISER
npc_class = lawful, class_cruiser, d19 <= I think this is key… -
robocop wrote:
In faction_prop.ini under affiliation = li_n_grp the following lines have been added:
npc_ship = Liberty_Cruiser
npc_ship = Liberty_Battleship
formation = cruisers, walker_m03 <= what does this reference?That defines that all encounter using ‘formation_by_class = cruisers’ uses the ‘walker_m03’ formation
robocop wrote:
- How do you read the pos = entries? If I wanted to change the formation layout, how are you certain that pos 0, 0, 0 is actually the battleship?
the first ship in the encounter uses the first position, the second the second position and so forth.
robocop wrote:
This is cruisers_liberty.ini
[…]
formation = walker_m03 <= most formations seem to use a formation_by_class entry here. How does that work? Is that related to the order the ships are listed in the preceding lines?[…]This specifies that this encounter uses the ‘walker_m03’ formation. It doesn’t matter what the using faction usually uses.
robocop wrote:
npc_class = lawful, class_cruiser, d19 <= I think this is key…The ‘d19’ references the difficulty this ship may be chosen in. The class_cruiser is needed for encounter usage.
e.g. ‘ship_by_class = 1, 1, sc_cruisers’
The class_cruiser to sc_cruisers conversation is done in shipclasses.ini
If you would use this cruiser encounter at a difficulty other than 19, and there is no other cruiser entry in that factions properties, it would not be created.
-
Quarks wrote:
robocop wrote:
- How do you read the pos = entries? If I wanted to change the formation layout, how are you certain that pos 0, 0, 0 is actually the battleship?
the first ship in the encounter uses the first position, the second the second position and so forth.
Ok, that makes sense. Any clarification on the xyz coordinates? 0,0,0 of course would be the center of the formation. I’m presuming the others all build off that. But, which way is up?
quark wrote:
robocop wrote:
npc_class = lawful, class_cruiser, d19 <= I think this is key…The ‘d19’ references the difficulty this ship may be chosen in. The class_cruiser is needed for encounter usage.
e.g. ‘ship_by_class = 1, 1, sc_cruisers’
The class_cruiser to sc_cruisers conversation is done in shipclasses.ini
So,
[NPCShipArch]
nickname = Liberty_Cruiser
loadout = Liberty_Cruiser_Loadout
level = d19
ship_archetype = li_cruiser
pilot = cruiser_default
state_graph = CRUISER
npc_class = lawful, class_cruiser, d19the state_graph makes this a cruiser and the npc_class associates it with class_cruiser
[ShipClass]
nickname = sc_cruisers
member = class_cruiserAnd here class_cruiser is assigned sc_cruisers.
I think that makes sense.So, now I just need to better understand positioning and why the player ship when formed does not align itself correctly with the other ships.
I guess in order to add CSVs and CRVs to a formation I would have to create a new NPCShipArch and a new state_graph for them, correct?
-
Ok, that makes sense. Any clarification on the xyz coordinates? 0,0,0 of course would be the center of the formation. I’m presuming the others all build off that. But, which way is up?
Probably the same way as in the systems, but it should not be too hard to find out.
robocop wrote:
the state_graph makes this a cruiser and the npc_class associates it with class_cruiser.The state graph has to do with how the npc handles different situations. It is the cause (at least partly) for the strange behavior of capships in combat, as they don’t really act as fighters, they fly straight and sometimes turn around. You can of course try to understand the format of the state graphs, but the best ‘tutorial’ available is the one that comes with 88 flak. In a mod I made I replaced them all with the fighter’s state graph, as that makes them perform a lot better in combat.
In fact freelancer doesn’t really recognize any difference between cruisers, fighters and so on, but the shipclass makes sure that the right ship is selected in the encounters, and it defines how other npcs treat it.
The type in the shiparch also affects how other npcs attack, i have found out that normal fighters do not chose capital ships as their targets, no matter what you set as their pilot’s attack preferences.robocop wrote:
I guess in order to add CSVs and CRVs to a formation I would have to create a new NPCShipArch and a new state_graph for them, correct?There is no need to create a new state graph (have a look at them, you won’t like it), but you will have to create a new shipclass or reuse an unused existig one (e.g. the transport5s and 6s and so on)
-
I think I figured out how NPC ships are placed in formations but the player ship doesn’t seem to know where to go when forming with the capship formations.
Here are the formations:
[Formation]
nickname = battleship_wall
pos = 0, 0, 0
pos = 400, 0, 0
pos = -400, 0, 0
pos = 400, 200, 0
pos = -400, 200, 0
pos = 400, -200, 0
pos = -400, -200, 0
pos = 0, 200, 0
pos = 0, -200, 0
pl_pos = 0, 50, 225[Formation]
nickname = battleship_cruisers
pos = 0, 0, 0
pos = 200, 70, 150
pos = -200, 70, 150
pos = 50, 100, 200
pos = -50, 100, 200
pos = -100, 130, 230
pos = 100, 130, 230
pos = -150, 150, 260
pos = 150, 150, 260
pl_pos = 0, 50, 225[Formation]
nickname = battleship_cruiser_fighter
pos = 0, 0, 0
pos = 200, 70, 150
pos = -200, 70, 150
pos = 150, 100, 00
pos = -150, 100, 00
pos = -200, 130, 30
pos = 200, 130, 30
pos = -250, 100, 00
pos = 250, 100, 00
pl_pos = 0, 50, 225[Formation]
nickname = battleship_delta
pos = 0, 0, 0
pos = 50, 70, 50
pos = -50, 70, 50
pos = 75, 100, 75
pos = -75, 100, 75
pos = 50, -70, 50
pos = -50, -70, 50
pos = 75, -100, 75
pos = -75, -100, 75
pl_pos = 0, 50, 225[Formation]
nickname = cruiser_delta
pos = 0, 0, 0
pos = 50, 70, 50
pos = -50, 70, 50
pos = 75, 100, 75
pos = -75, 100, 75
pos = 100, 100, 90
pos = -100, 100, 90
pl_pos = 0, 50, 225[Formation]
nickname = cruiser_gunboat_fighter
pos = 0, 0, 0
pos = 50, 70, 50
pos = -50, 70, 50
pos = 75, 50, -75
pos = -75, 50, -75
pos = 100, 60, -60
pos = -100, 60, -60
pl_pos = 0, 50, 225[Formation]
nickname = destroyer_gunboat_fighter
pos = 0, 0, 0
pos = 100, 0, 20
pos = -100, 0, 20
pos = 35, 10, -75
pos = -35, 10, -75
pos = 50, 20, -60
pos = -50, 20, -60
pl_pos = 0, 50, 225If I read these correctly, the player ship (pl_pos) should be slightly above and well behind the 0, 0, 0 ship and inline with it.
So, directly behind and slightly above.The player ship however seems to be searching for its place in the formation and always ends up nose down looking at the capship, advancing forward, and then correcting position.
Formations seem to work when forming with transports…
[Formation]
nickname = escort_transports_delta_formation
pos = 0, 0, 0
pos = 50, -50, 0
pos = -25, 50, 100
pos = 75, 50, 100
pos = -75, 50, 75
pos = 125, 50, 75
pl_pos = 25, 50, 225they work fine when forming with Walker’s formation in SP…
[Formation]
nickname = walkers_formation
pos = 0, 0, 0
pos = -100, -100, 100
pos = 100, -100, 100
pos = -100, 100, 200
pos = 100, 100, 200
pos = -200, 0, 0
pos = 200, 0, 0
pl_pos = 0, 0, 400Any suggestions?
Thanks
R