Fractal Softworks Forum
April 26, 2017, 10:42:55 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Starsector 0.8a is out (hotfix is up!) ; New blog post: Ship’s Log of Salvage Dave’s Final Mission (3/29/17)
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How Station Mechanics are Handled  (Read 353 times)
InventorRaccoon
Commander
***
Posts: 129



View Profile
« on: April 21, 2017, 10:01:08 AM »

Dug into the files, to see what makes stations in combat tick. Here's what I found:

- Firstly, each module and the base are a separate .ship file and are technically ships. The base is capital sized, and the modules should be frigate-sized. The base should have Axial Rotation as hullmods, to make it spin in place, the modules should have "Reduced Explosion" (reduces death explosion to 1/4 the size and 1/10 the damage), and both the base and modules should have Targeting Supercomputer for extra range (I assume it isn't necessary for the base, if that part is unarmed). If you want your station base to be invincible, give it Vast Bulk (reduces engine and hull damage to 0), it does not affect the mass (that's in the csv). There is also a hullmod called Never Detaches, to stop modules from detaching when destroyed, and Always Detaches, for the opposite.

Axial Rotation forces a ship to always be turning right. You can use that as a template to have hullmods which force a ship to do other commands. Commands are in starfarer\api\combat, and including turning in either direction, strafing in either direction, accelerating forwards or backwards, decelerating, firing, venting, toggling shields or phase, toggling autofire, holding fire, toggling fighter mode, or using system. Have fun.

- Secondly, modules are attached through the use of a new weapon mount type, "STATION_MODULE", which should be large sized and hardpoints. Mounts intended to be used as weapons should be set up as normal, with whatever size and type you want. Since everything is modular, you set what modules go where in the .variant file, which makes it easy to have stations with different weapon loadouts while keeping the same base and modules. Different modules also have their own .variant files where you can decide what weapons each loadout uses.

- Thirdly, for stats, both station bases and modules are made in the same format as normal ships, in the same .csv. The "name" column should be blank, put the name of the entire station (for the base) or what the module is (for the module) in the "designation" column instead. Station bases should have the "STATION" flag (extremely important, this is what allows a station to have modules and what makes it behave like a station. This also forces you into autopilot), and both bases and modules should have "UNBOARDABLE" (also used to make it impossible to board spoiler ships), and "HIDE_IN_CODEX".

- Station bases and modules have .variant files just like normal ships. What modules are on a station is determined by the base. Just stick the name of the module variant you want into the appropriate STATION_MODULE weapon slot.

- Station spawning is handled like normal spawning, with a special category for each station type (each vanilla station has its own category, with just one entry). Not sure when or how it's used.

CSV stuff:

- Station bases have: an actual max speed, acceleration and deceleration, a turn speed (presumably controlling how fast they rotate), no ordnance points (though armed station bases should probably have them, they don't exist in vanilla), a mass of 5000, a maximum crew, minimum crew, fuel and cargo storage value of 0, and a burn speed of 0 (if you want to have them be actually useable in a normal fleet, don't do that, of course). They should also have no peak CR time or CR loss per second. Supplies/month and deployment is 50 for current stations. There's a few new columns on how a station or ship should break apart, stations have a probability of 0 (normal ships range from 0.4 to 0.75, increasing with fragility), and blanks for where minimum pieces and maximum pieces go.
All of this is adjustable on a per-base baseis (heh), and anything not mentioned is set up exactly like a normal ship (health, flux, armor, shields, systems, etc.)

- Station modules have a max speed, acceleration and deceleration of 0, while turn speed is 10 for all current modules. They have 0 storage space, cost blank supplies, use blanked CR per day but use 1% per deployment. They have breakability stats exactly the same as normal ships. Their max burn speed is blank. They have ordnance points as normal.
All of this is adjustable on a per-module basis, anything not mentioned is exactly like a normal ship. Hangar modules are possible, and are handled just as any other carrier (launch bays are the same as 0.7, but wings now go in the variant file, and the number of fighter bays goes in the .csv. Built in wings are handled just like weapons, but with their own section in the .ship. Check a ship with drones for an example.)

Hopefully this is useful to someone. Not entirely sure how station destruction is handled.
« Last Edit: April 21, 2017, 12:43:12 PM by InventorRaccoon » Logged

Raccoon's Arms Pack, for all your slightly-altered-vanilla-ships-with-a-few-new-ones-like-that-Pigeon needs.
Alex
Administrator
Admiral
*****
Posts: 10146


View Profile
« Reply #1 on: April 21, 2017, 11:10:49 AM »

*thumbs up* This is accurate and pretty comprehensive.
Logged
InventorRaccoon
Commander
***
Posts: 129



View Profile
« Reply #2 on: April 21, 2017, 12:36:02 PM »

*thumbs up* This is accurate and pretty comprehensive.
Thanks! I've actually managed to spawn in a modified Conquest, but with two shield generators attached to the sides. It works! It's cool.

One very important question: Adding the STATION flag to a ship allows it to have modules, but is there any way to do it without it automatically going into autopilot and pretending to be a station?
Logged

Raccoon's Arms Pack, for all your slightly-altered-vanilla-ships-with-a-few-new-ones-like-that-Pigeon needs.
Alex
Administrator
Admiral
*****
Posts: 10146


View Profile
« Reply #3 on: April 21, 2017, 01:11:57 PM »

I'm pretty sure STATION isn't actually required to have modules - iirc, STATION triggers the "always deployed, always on autopilot" behavior.
Logged
InventorRaccoon
Commander
***
Posts: 129



View Profile
« Reply #4 on: April 21, 2017, 02:22:12 PM »

I'm pretty sure STATION isn't actually required to have modules - iirc, STATION triggers the "always deployed, always on autopilot" behavior.
Odd. The modules don't spawn if the tag isn't applied, but they do if it is. Maybe there's something more that has to be done for ships without the tag? I just stuck the module variant names into the module weapon slots in their own weapon group. The modules appear in the refit screen with the tag and without.
Logged

Raccoon's Arms Pack, for all your slightly-altered-vanilla-ships-with-a-few-new-ones-like-that-Pigeon needs.
Alex
Administrator
Admiral
*****
Posts: 10146


View Profile
« Reply #5 on: April 21, 2017, 02:27:43 PM »

This looks like a bug, will take a look at it in the near future.
Logged
InventorRaccoon
Commander
***
Posts: 129



View Profile
« Reply #6 on: April 22, 2017, 04:52:07 PM »

I managed to make a working station myself, one that has campaign stats and could feasibly be used as a player's command ship. Turns out that Storm Needlers become extremely overpowered when you triple their range, however. They chew straight through shields and the AI can't handle the constant stream of fire, and even an Onslaught will die slowly to 1 Storm Needler and 2 Heavy Maulers.

Found another possible bug while doing so. Station modules can be refitted perfectly normally in the campaign and will keep their new weapons, but they will instantly revert to their assigned variant in the refit before doing a mission. Doesn't happen to the station base, that'll always keep any changes.
Logged

Raccoon's Arms Pack, for all your slightly-altered-vanilla-ships-with-a-few-new-ones-like-that-Pigeon needs.
InventorRaccoon
Commander
***
Posts: 129



View Profile
« Reply #7 on: April 23, 2017, 01:42:48 PM »

I got non-stations to use modules. Here's 4 different examples of what you can do using only modules that produce frontal shields:

1.
An undershield, protecting your hull from damage if anything sneaks through.

When hit, this particular shield overloads immediately on taking a single hit, emitting long purple arcs to show this (an unintentional effect). After the overload subsides, the shield returns.
2.
A back-facing shield. Funnily enough, the placement of this invisible module makes Salamanders not even consider trying to hit the engines, they'll go straight for the front of this ship.
3.
A frontal shield on a phase ship. The shield does block fire while phased, and moves properly with the parent ship. A weird side effect is that it prevents you from normally unphasing - you'll have to vent.
4.
Broadside shields. Yep.

Lots of possibilities.
Logged

Raccoon's Arms Pack, for all your slightly-altered-vanilla-ships-with-a-few-new-ones-like-that-Pigeon needs.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2011, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!