Fractal Softworks Forum
May 27, 2017, 05:58:53 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Starsector 0.8.1a In-Development Patch NotesStarsector 0.8a is out (hotfix is up!)
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How Station Mechanics are Handled  (Read 800 times)
InventorRaccoon
Commander
***
Posts: 160



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.

Station bases will ALWAYS be immediately disabled upon the destruction or disabling of every module that has ordnance points or weapons. This is hardcoded at the moment. To avoid it, add a tiny spriteless module with a few ordnance points somewhere on your station, and give it Vast Bulk. Remember to take Vast Bulk off of the station base or it wilk be completely unkillable.

If you are intending to make a ship using these mechanics, it does not have to follow some of these rules. It can be whatever size class you want, should NOT have Axial Rotation, and neither it nor the modules should have the supercomputer, unless you want a ship with 3x normal range and horrible imbalance. It should NOT have vast bulk unless you have a good reason for it (perhaps you intend to use the module as the singular weak spot). Make sure to add an invisible invincible module that does nothing if you want to allow every functional module to be destroyed without the base automatically exploding.

NOTE: As of now, there is a bug preventing ships without the STATION tag from having modules outside of the simulator. Alex knows about it and it should be fixed for 0.8.1. Until then, you can only have static stations.

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. You can additionally put stations into normal fleet categories, and they will spawn in fleets and markets. However, if a station spawns in a market, it will have no modules.

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.)

- Both a station base and the modules can be refitted in-game, swapping out weapons and applying hullmods as normal. You can switch between the base and each module by clicking on them. Each has a separate OP bar and hullmods. If you assign a captain to a station, they'll also apply to the modules.

Hopefully this is useful to someone.
« Last Edit: April 26, 2017, 05:16: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: 10618


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

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



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: 10618


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: 160



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: 10618


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: 160



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: 160



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.
TrashMan
Captain
****
Posts: 486


View Profile
« Reply #8 on: May 12, 2017, 12:09:38 AM »

I really wish broadside shields would be possible without this shenaigans.

How difficult would it be to add a new shield type "BRAODSIDE" that would add "two" (actually one) shields, one on each side.
Logged
TrashMan
Captain
****
Posts: 486


View Profile
« Reply #9 on: May 13, 2017, 06:28:41 AM »


- 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. You can additionally put stations into normal fleet categories, and they will spawn in fleets and markets. However, if a station spawns in a market, it will have no modules.

I don't see where it's defined.
Stations have ship entry, variant entry, but I can't find nothing else that defines them.
I thought there might be something in custom_entities, but I can't find anything there either.

So if I made a faction station, do I have to have a custom spawning script to place it in a system and for it to be interactable?
Logged
InventorRaccoon
Commander
***
Posts: 160



View Profile
« Reply #10 on: May 13, 2017, 08:20:34 AM »

I don't see where it's defined.
Stations have ship entry, variant entry, but I can't find nothing else that defines them.
I thought there might be something in custom_entities, but I can't find anything there either.

So if I made a faction station, do I have to have a custom spawning script to place it in a system and for it to be interactable?
Yes. Stations don't spawn normally, you'll to make a script to call for that category or something, I'm not a scripting expert myself.

You should probably look at how [REDACTED] spawn their station.
Logged

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


View Profile
« Reply #11 on: May 13, 2017, 12:22:34 PM »

Bummer. I though one could interact with stations that are present on the map. Attack them and stuff.
Logged
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!