PSSCombat

From HerzbubeWiki
Jump to: navigation, search

This page attempts to give the details about the combat system in the computer game "Pixel Starships".


Things that can happen

This is a (probably incomplete) list of things that can happen during a battle. The list can be used as inspiration for exploring certain game mechanics.

  • A room recharges.
  • A fully charged room performs its action.
  • A room takes damage.
  • An EMP effect occurs
  • A crew member takes damage.
  • A craft takes damage.
  • A fire ignites.
  • Fire damage is calculated.
  • A fire deals damage.
  • A crew member activates her Special Ability.
  • A crew member's crew collection perk activates.
  • A crew member attacks an enemy crew member.
  • A crew member attacks a room.
  • A crew member repairs a room.
  • A crew member walks.
  • A crew member teleports.
  • A landmine triggers.
  • A landmine explodes.
  • A landmine re-arms.
  • A sprinkler activates.


When do things happen?

The game engine runs on 40 frames per second. Theoretically everything can happen on every frame. Practically the game engine restricts some things so that they can happen only at certain times. Here is what I know so far:

  • A Room Frame is 40 regular frames, i.e. 1 second. Room Frames are counted from the beginning of the battle. All rooms share the same Room Frame sequence.
  • A fire can ignite on any regular frame.
  • Fire damage is calculated and dealt on every Room Frame. An amount of fire damage that is calculated on Room Frame n is dealt only on the next Room Frame n + 1 (if the fire still lasts then).
  • On any given frame, weapons fire after the game engine has processed all AI scripts. In conclude this from the following observed behaviour:
    • Rush Command crew in my Mineral Mining Laser room have "None - Use Special Ability", and they have a combined 100% ability.
    • So during frame 1 of the battle, the Mineral Mining Laser immediately fires, and because it has no projectile that needs time to travel, its beam instantly hits the enemy shield. So when frame 1 is finished, the enemy shield is guaranteed to be < 100%.
    • Rush Command crew in my Teleport room have "None - Use Special Ability" and "Enemy Shield <100% - Target <some other room>".
    • I can observe that the Teleport room gets rushed. This means that the "Enemy Shield <100% - Target <some other room>" did not execute, so at the time the AI script was processed the enemy shield was still at 100%. Ergo the Mineral Mining Laser has not yet fired when the AI script was processed.


Hand-to-hand combat

Basic rules

Warning: A lot of the information in this section is pure conjecture, based on observations made during battle reviews, or common-sense deductions from the sparse information that I could find on the PSS wiki. The main information source is the PSS wiki page on the Teleport room.


Hand-to-hand combat occurs when two crew members from opposing sides meet each other. More than two crew members can be involved, of course.


When does hand-to-hand combat occur / not occur:

  • The two crew members must be in the same room.
  • The two crew members must be targeting the room they are in.


The second rule is very important to understand for beginners of the game, because it causes non-intuitive crew member behaviour. Some examples:

  • On your ship, a friendly crew member is waiting in room A for a lift on her way to room B that she is targeting. An enemy crew member is also in room A and is targeting room A. Because they are targeting different rooms the two crew members completely ignore each other and do not engage in hand-to-hand combat. The enemy crew member happily dismantles the room and the the friendly crew member does not prevent the enemy crew member from her sabotage.
  • A friendly crew member is targeting a room on the enemy ship and is waiting in the Teleport room on your ship for the Teleport room to reload. An enemy crew member is also in the Teleport room on your ship and is targeting the Teleport room. The same happens as in the first example: The two crew members do not engage in hand-to-hand combat because they are targeting different rooms. The enemy crew member is completely free to dismantle the Teleport room. When the Teleport room is destroyed the friendly crew member becomes stuck indefinitely: Not only will she not prevent the enemy from sabotage, she will also not repair the destroyed room.
  • Because activating a Special Ability is not part of hand-to-hand combat, a damage-dealing Special Ability like Poison Gas or Critical Attack does trigger even if hand-to-hand combat does not occur. This results in the seemingly paradoxical behaviour that a crew member heavily injures an enemy crew member via Special Ability, but then does not continue to finish the job via hand-to-hand combat.


Positioning rules

  • The room where hand-to-hand combat takes place has n positions: The number of positions depends on how many crew members can target the room (e.g. 1 for a security room, 2 for a Bolter, 3 for a Small Reactor, 5 or a Hangar, etc.).
  • The room can hold up to 2 * n crew members: One set of n positions is for crew members from the boarding side, the other set of n positions is for crew members from the defending side.
  • Crew members from one side are assigned their side's positions in the order in which they target the room. Looking at the room from the defending side:
    • Defending crew members are assigned positions in the room from left to right. The defending crew member who is the first to target the room is assigned the leftmost position, the defending crew member who is the second to target the room is assigned the second-to-leftmost position, etc.
    • Boarding crew members are assigned positions in the room from right to left. The boarding crew member who is the first to target the room is assigned the rightmost position, the boarding crew member who is the second to target the room is assigned the second-to-rightmost position, etc.
  • Each side has a primary target crew member:
    • From among all the crew members who have assigned positions and who are currently in the room, the one at the leftmost/rightmost position is the primary target.
    • For the defending side the primary target is the one with the leftmost position.
    • For the boarding side the primary target is the one with the rightmost position.


Hand-to-hand combat sequence

  • Position takeup
    • A crew member who enters the room moves to her assigned position according to the positioning rules above.
      • A crew member who enters the room on foot must first walk to her assigned position before she can engage in hand-to-hand combat.
      • A crew member who teleports into the room immediately takes up her assigned position, but suffers a delay of 0.5 seconds before she can engage in hand-to-hand combat.
    • A crew member who is already in her assigned position can immediately engage in hand-to-hand combat.
  • Attack loop
    • When a crew member is ready to engage in hand-to-hand combat, she attacks the enemy side's primary target crew member according to the positioning rules above.
    • From now on the crew member continues to attack with a 1 second delay between attacks.
    • The crew member continues to attack until no more primary target enemy crew member is present. This may be because all enemy crew members are dead, or because all of them have left the room.
  • Damage dealing
    • Whenever a crew member attacks, her Attack stat value is subtracted from the attacked crew member's current HP value.
    • The attacked crew member dies if her HP value drops to zero or below.
    • When the attacked crew member dies, all remaining crew members from her side are assigned new positions. As a consequence all remaining crew members move to take up their new positions, and one of the remaining crew member becomes the new primary target crew member for her side.


Notable consequences:

  • A crew member attacks only one enemy crew member at the same time.
  • A crew member can be attacked by many enemy crew members at the same time, but only if she is her side's primary target crew member.
  • A crew member who is not her side's primary target crew member is not attacked at all.
  • While crew members take up their new positions after their primary target crew member was killed, they cannot attack themselves. On the other hand, the new primary target crew member can can be attacked by all enemy crew members that have already taken up their position in the room.


Crew damaging a room

Following the hand-to-hand combat rules in the previous section, if a crew member is located in an enemy room and finds no enemy crew member to attack, she will instead attack the room she is targeting.

Whenever a crew member attacks an enemy room, her Attack stat value is subtracted from the attacked enemy room's current HP value.


Crew repairing a room

Following the hand-to-hand combat rules in the previous section, if a crew member is located in a friendly room and finds no enemy crew member to attack, she will instead repair the room she is targeting.

Whenever a crew member repairs a friendly room, her Repair stat value is added to the repaired friendly room's current HP value.


Special Ability activation

General rules

  • A crew member must be level 10 or higher to be able to activate her Special Ability.
  • A crew member can activate her Special Ability only once during a battle.
  • Special Abilities have innate conditions that prevent them from being activated uselessly. The AI action "Use Special Power" does not activate a Special Ability if the ability's innate condition is not met. The section "Innate Conditions" below lists the innate conditions of all Special Abilities.
  • Activating a Special Ability is not part of hand-to-hand combat. This has a number of more or less surprising consequences listed in the "Hand-to-hand combat" section below.


Targeting

  • A crew member can activate her Special Ability only when she is in the room that she is targeting. A crew member cannot activate her Special Ability while she is still en route to her target room.
  • Targeting happens before Special Ability activation. This is notable especially at the beginning of a battle: A crew member starts in room A, but has a targeting command in her AI script that targets room B. The crew member in this case will not activate her Special Ability in room A, instead she will navigate to room B where she will then activate her Special Ability.


Hand-to-hand combat

As mentioned in the "Basic Rules" section, Special Ability activation is not part of hand-to-hand combat. The main consequences of this are:

  • A crew member entering her target room does not have to wait until she has taken up position for hand-to-hand combat before she can activate her Special Ability. She can do so immediately upon entering the room.
  • Furthermore, Special Ability activation occurs before hand-to-hand combat. This means that if enemy crew members are already in position in the room, they cannot use hand-to-hand combat to prevent a crew member who enters the room from activating her Special Ability.
    • Example: A crew member entering the room can activate her Poison Gas ability and possibly kill all enemy crew members before they have a chance to retaliate in hand-to-hand combat.
  • Last but not least, a crew member can activate her Special Ability even though enemy crew members that are present in the room target a different room.
    • Example 1: If enemy crew members are waiting in the Teleport room to be teleported, they target a room on the other ship - nevertheless a crew member targeting the Teleport room can activate a Poison Gas or Critical Attack ability as soon as she enters the room.
    • Example 2: A defending crew member is manning a weapon room (i.e. she's in the weapon room and targeting the weapon room). An enemy boarder passes through the weapon room while en route to a different target room. The defending crew member can now activate a Poison Gas or Critical Attack ability as soon as the enemy boarder enters the room. This results in a crucial defense tactic against boarding: Position weapon rooms in between important other rooms, such as Reactors, and man them with Critical Attack defenders - the defender will act like a one-time security gate, either killing or severely damaging an enemy boarder that passes through.


Boarding the enemy ship

  • When a crew member teleports into a room there is a 0.5 seconds delay before she can activate her Special Ability. This gives defenders the advantage, i.e. defenders can safely activate their Special Ability before the boarder can.


Timing

  • Crew members who enter a room by walking (i.e. not via teleport) activate their Special Ability before crew members that are already in the room.
    • Example: Two crew members from opposing sides, both with Critical Attack, target the same room. One crew member is already in the room, the other walks into the room. The crew member walking into the room activates her Special Ability first. If this kills the crew member already in the room, the crew member walking into the room is unharmed.
    • TODO: There is a bit of uncertainty whether the types of the Special Abilities involved have an effect on the order of activation. E.g. does Freeze Bomb go off before Critical Strike? What about Poison Gas vs. Critical Strike?
  • Multiple crew members activate their Special Ability in the order of seniority. If the first activation removes the trigger, then subsequent Special Abilities are not activated at all.
    • Example: A boarder arrives in a room that has two enemy crew members in it. The one with higher seniority has Critical Strike, the other has Freeze Bomb. The one with higher seniority activates her Critical Strike first and kills the boarder. Because the boarder is no longer there the Freeze Bomb ability is not activated.


Innate conditions

Special Abilities' innate conditions
Special Ability Innate condition Comment
Rush Command The crew member must be in a friendly room and target that room. The room must be chargeable.
Urgent Repair The crew member must be in a friendly room and target that room. The room must be damaged.
Poison Gas The crew member can be in any room and must target that room. There must be enemy crew in the room.
Critical Attack The crew member can be in any room and must target that room. There must be enemy crew in the room.
System Hack The crew member must be in an enemy room and target that room. The room must be a room that is capable of consuming energy (even if it doesn't currently consume energy). Observed during a battle: The Special Ability triggers even if the target room is destroyed.
Ultra Dismantle The crew member must be in an enemy room and target that room. The room must have HP > 0.
Healing Rain ?
First Aid ?
Arson ?
Firewalk ?
Freeze Bomb ?


Weapons fire

Basic weapon types

Weapon rooms can be classified into two basic types:

  • Missile launchers: This type of weapon room fires missiles which can't be stopped by a shield. With the aid of engine rooms, however, missiles can be dodged with a certain probability. All missile launchers fall under the AI category "Missile Room".
  • Everything else: The fire of all other weapon rooms can be stopped by a shield. These "other" weapon rooms either have the AI category "Laser Room" or "Cannon".


Projectile speed

A few laser weapon rooms fire an energy bolt that instantaneously hits the enemy ship. These energy bolts can be said to have infinite projectile speed.

Most weapon rooms, however, fire an energy bolt or some sort of physical projectile that takes a certain time to reach the enemy ship. These projectiles have a finite projectile speed that is measured in "pixel per frame".


Volleys

TODO


Information from Discord

On 27 March 2020, a discussion was going on in the general-english-chat channel of the PSS Discord server. The following pieces of information were revealed:

  • Bril asserts that projectile speeds are measured in "pixel per frame", and that the unit "pixel per second" given on the PSS wiki is wrong.
  • Bril has measured that the approximate distance between the front of the two ships is 140 grid spaces. He says that 1 grid space = 25 pixel, so the approximate distance between the front of the ships is 140 * 25 = 3500 pixel.
  • Bril says that all missile types travel at 12 pixel/frame (corroborated by the PSS wiki, only that it says 12 pixel/s). Therefore the approximate travel time for a missile is about 292 frames, or 7.3 seconds.
  • Bril also says that for the exact travel time of a missile one would need to add the extra distance from the position of the missile launcher and the target room to the front of their respective ships.
  • In response to a direct question Kildare says this about distances:
    • A "field size" is calculated based on the sizes of the ships. This calculation is pureley dependent on the "number of columns", or "grids", as Kildare expressed it. The choice of the word "column" implies that only the width of the ships is important.
    • Then the starting center positions of each ship are set to 10% of the field size from each edge.
    • In other words, the distance scales with the size of the ships.
  • Also after being asked Kildare says this about craft:
    • When craft fly around an enemy ship, the orbit is around the center of the ship, and the radius of the orbit scales with ship size.
    • The orbit is not a fixed ellipse that is simply scaled up. Instead the orbit changes shape according to the form of the ship hull.
    • Because the orbit becomes higher and/or wider with bigger ships, the position of the AA room(s) on a bigger ship matters a lot: Putting the AA room(s) in the center of a long ship may result in it not being able to hit any craft! This is because AA rooms have a range. In-game this is shown as a numeric value without a unit. The PSS wiki says the unit is "pixel", and the range is always 1000 pixel.


Damage types

A lot of the information in this section is taken straight from the PSS wiki.


System damage

  • A room's HP is determined by the room's maximum power consumption (non-reactors) or power production (reactors).
  • Conversely, if a room is damaged and its HP are lowered, the room can only consume or produce power up to the maximum of the room's HP. Fractions are truncated, e.g. a room with 2.9 HP can consume or produce power only up to a maximum of 2.
  • If a room currently consumes less power than its maximum, the room's HP is not affected.
  • Although I couldn‘t find a definitive source for this, it is an educated guess that the green bars displayed in the UI show the room‘s current HP.
  • When a weapon or crew deals system damage, that damage is subtracted from the room's current HP.
  • When a room’s HP reaches 0 it is destroyed and ceases to perform its function. Surplus system damage:
    • Weapon: Surplus system damage dealt by a weapon is carried over to deal hull damage. If the room is already at 0 HP, any system damage is fully converted to hull damage.
    • Crew: Surplus system damage dealt by a crew member has no effect. Crew members cannot damage a ship's hull.
  • Hull damage is what lowers a starship‘s HP.
  • Repairing a room increases a room's HP.
  • Armor reduces the amount of system damage taken. This is the case even if a room is destroyed! As a consequence, armor can be said to prevent hull damage.


Barriers:

  • A barrier that is placed in a room increases the room's HP.
  • The additional HP provided by a barrier has no effect on the room's energy production or consumption.
  • System damage dealt to the room is first deducted from the barrier's HP.
  • When the barrier's HP becomes zero it is destroyed.
  • Repairing the room does not repair the barrier - barriers can only be repaired after a battle. Once a barrier has been destroyed it therefore plays no further role during a battle.
  • Armor reduces system damage dealt to the barrier.


Crew damage

  • Crew damage affects a crew member's HP.
  • When a crew member's HP reaches 0 she is killed. Certain crew collections provide a buff that may resurrect the crew member with 1 HP (currently known: the Cats crew collection).
  • Surplus crew damage does nothing.
  • Armor or barriers have no effect on crew damage.
  • Crew damage dealt by weapons, missiles, crafts and fires is dealt equally to all crew members in a room, i.e. it is not split up and distributed. For instance, when 2 crew members are present in a room, one with 5 HP and the other with 3 HP, and 4 crew damage is dealt to the room, one crew member is killed and the other survives with 1 HP left.
  • Important: Weapons, missiles, crafts and fires deal crew damage to both enemy crew members and your own crew members!
  • Crew damage dealt by crew members in hand-to-hand combat is dealt only to a single enemy crew member.
  • How crew damage dealt by a crew member's Special Ability is distributed depends on the ability:
    • Poison Gas: Affects all enemy crew members.
    • Critical Attack: Affects only one enemy crew member.


Shield damage

  • Shield damage affects the starship's shield HP
  • When the shield‘s HP reaches 0 it is disabled.
  • Surplus shield damage is discarded.
  • I have not found a definitive source that describes how the shield is recharged. An educated guess (which matches the observed behaviour) is that when the shield generator finishes its reload, it adds back 1 HP to the shield.


Hull damage

  • Hull damage affects the starship's HP
  • Surplus system damage dealt to a destroyed room is converted to hull damage
  • Some weapons deal direct hull damage without requiring the targeted room to be destroyed
  • Armor reduces the amount of hull damage taken - even direct hull damage!


Armor Piercing (AP) damage

  • AP damage affects a room's HP
  • Armor does not reduce AP damage. Innate armor affects AP damage, though.
  • Surplus AP damage is not converted to hull damage
  • If AP and system damage occur at the same time, AP damage is dealt first
  • Certain weapons and fire deal AP damage.
  • AP damage dealt to a room that contains a barrier is first deducted from the barrier's HP. See the "System damage" section for more details about barriers.


Fire damage

This section is a summary of the PSS wiki page on fire damage, minus the stuff that over-complicates the explanation.


Fire damage is not another special category of damage, it's merely a combination of crew and AP damage.

  • Crew damage dealt by fire is mitigated by a crew member's Fire Resistance.
  • AP damage dealt by fire is not mitigated by armor.


The basic fire damage dealing mechanism works like this:

  • When a fire is ignited it has an initial length in frames.
  • A fire can be ignited on any regular frame.
  • When the next room frame elapses, fire damage A is calculated but not yet dealt.
  • When the next room frame elapses, fire damage A is dealt and fire damage B is calculated but not yet dealt.
  • When the next room frame elapses, fire damage B is dealt and fire damage C is calculated but not yet dealt.
  • When the next room frame elapses, fire damage C is dealt and fire damage D is calculated but not yet dealt.
  • The fire ends before the next room frame elapses. Fire damage D is not dealt.


The amount of damage calculated on each room frame (A, B, C, D in the example) is determined by the fire's remaining duration. This means that a fire is strongest when it's fresh and grows weaker the longer it last.

  • AP damage = Remaining fire duration in frames / 50. Example: A fire with a remaining duration of 200 frames (5 seconds) deals 0.4 AP damage.
  • Crew damage when crew member has no fire resistance = Remaining fire duration in frames / 20. Example: A fire with a remaining duration of 200 frames (5 seconds) deals 1 crew damage.
  • A crew member's fire resistance is a percentage value denoting how much crew damage is mitigated. A fire resistance value 10 means that 10% are mitigated, or 90% are dealt. A fire resistance value 100 means that 100% are mitigated, or 0% are dealt.


A fire's duration can be reduced by two means:

  • When a fire ignites and a sprinkler is in the room, the sprinkler activates and immediately reduces the fire duration by a factor of 100 / (100 + sprinkler stat). Example: A sprinkler stat of 125 results in a factor of 0.8 (or a 20% reduction). The formula can be better understood when looking at the already reduced duration: A sprinkler stat of 125 means that without the sprinkler the fire would last 25% longer.
  • When a crew member tries to repair the room that is on fire. Reduction in frames = Repair stat * 20. Example: A repair stat of 3 results in a reduction by 60 frames.


EMP

EMP = Electromagnetic pulse.


EMP sources

There are several sources of EMP effects:

  • EMP missile
  • EMP weapons (EMP cannon, Photon Disruptor)
  • Corsair craft
  • Crew collection perks (SavySoda, Ardent)


EMP effects

An EMP affects powered rooms and certain module types. Affected module types are sprinklers and landmines.


An EMP has a duration. When an EMP is applied to an already EMP'd room or module, the EMP with the longer duration overrides the shorter one.


Effects of an EMP on a room:

  • The room stops working.
  • The room stops reloading. The current reload progress does not change, though, it is just frozen.
  • The room's power consumption cannot be changed, either by AI or manual control.


Effects of an EMP on a landmine:

  • The landmine stops working.
  • A landmine that is EMP'd does not trigger. If an enemy crew member enters the room and then leaves the room again while the landmine is EMP'd, then the landmine will not explode when the EMP effect wears off, simply because it was never triggered.
  • An already triggered landmine that is EMP'd does not explode. In fact, the EMP causes the landmine to "forget" that it was triggered. So when the EMP effect wears off:
    • If there are no enemy crew members in the room, the landmine will not explode at all.
    • If there is an enemy crew member in the room, the counter for the explosion delay (1 second) starts again at zero, i.e. the explosion delay was reset by the EMP.
  • Last but not least, an EMP disarms the landmine. Once the EMP effect wears off there is an extra delay of 0.5 seconds until the landmine becomes re-armed. The landmine cannot trigger before it is re-armed. So when the EMP effect wears off:
    • If there is an enemy crew member in the room, but she leaves within the 0.5 seconds before the landmine becomes re-armed, the landmine will not explode at all.
    • If there is an enemy crew member in the room, and she stays in the room after the 0.5 seconds re-arm delay, there is a total delay of 1.5 seconds until the landmine explodes: 0.5 seconds for the re-arm, and 1 second for the explosion delay.
  • Thanks to Bril on PSS Discord for this information. The length of the re-arm delay still needs confirmation.


Effects of an EMP on a sprinkler:

  • The sprinkler stops working.
  • If a sprinkler is EMP'ed at the time when a fire ignites, the sprinkler won't activate and therefore won't reduce the fire duration.
  • When the EMP effect wears off, a sprinkler will not retroactively reduce the duration of a fire that was ignited while the sprinkler was EMP'd.


EMP vs. System Hack

The System Hack special ability and EMPs have similar effects, but they are two different things and they should be treated differently.

If a crew member both has a crew collection perk that causes an EMP and has the System Hack special ability, then the EMP from the perk will trigger before the System Hack ability. This information comes from user Bril on the PSS Discord server.

TODO: Does System Hack trigger when a room is EMP'd?


EMP vs. Rush Command

TODO