The Battle Manual:Weapon Charging

From PlanetsWiki

Jump to: navigation, search

Contents

[edit] Overview

  • New: All objects start with empty systems but charge immediately when entering vcr.
  • New: Even if an object "is there" but not visible it charges. I.e. re-docked wings and 2nd wave objects charge all the time even if they are waiting for (re-)entering combat.
  • New: Except for the old power boost of the cloakers and the super weapons the power bank also starts empty and has to be charged by surplus energy which was left after normal charging.
  • "PowerBoost Cloak" still takes place at tick 25.
  • The old power boost of the super weapons still take place at tick 310 and tick 4000.
  • New: Charging takes now place any single tick. There isn't a difference before or after tick 300 like it was till host212.

[edit] Ships

If Crew > 0 and Control Damage < 99,9% then charging takes place.

[edit] Normal weapon charging

[edit] New: Power Bank (due to new power boost) charging

After the aforementioned charging process the charging of the power bank can take place. The conditions are

  • One (or both)of the both new power boost modes is activated
  • There is energy left after the aforementioned normal weapon charging
  • The power boost sequence (which overloads the weapons with the full energy from the power bank) is not yet initiated

Power boost will cause the weapons to fire more quickly, at considerable danger to the ship.

Each tick a maximum amount of energy is calculated which CAN be added to the power bank. But to charge the powerbank by this amount you need 5 times the energy (Feeding the power bank wastes energy. 80% of the energy goes into void):

PL : Powerbank limit as seen in the hulls stats

PB : Current power bank enegy

E  : Energy left after normal chanrging

dE : Maximum increase of the power bank this tick

dE = (5 + PL / 100) * (0.5 + RND)

IF 5 * dE > E THEN PB = PB + E / 5 
ELSE               PB = PB + dE

Good to know:

  • The charge time of a big (~10,000) power bank is ~ 100 ticks. The carge time of a small (~100) is 20.
  • Only the surplus energy after normal charging is used. So consider using GF Tokamak 8080s as generators and Tylium Thrusters as engines or the charge times can even be greater.

[edit] Wings

[edit] Energy

Each single fighter type in a wing (not each fighter) has its own energy bank. So there are three energy banks if all there possible types in a wing are filled by fighters.

Each tick the following takes place for all three types:

New: EnergyBank = EnergyBank + fighterCount * fighterGenerator / g_fig(57)
IF EnergyBank > 1,000,000,000 THEN EnergyBank = 1,000,000,000

[edit] Good to know

  • "g_fig(57)" is the HConfig parameter "WingChargeDivisor". The default is 50. So a single fighter uses 1/50 of the fighter generator stat to charge the weapons.
  • 50 fighters with a generator value of 10 produce enough energy to fire a single beam (10GW) per tick (if the corresponding HConfig parameter "FighterBeamDrain" for the beams is 10 of course).
  • New: The + 0.99 in the charging formula from Host versions prior to 213 has been dropped.

Before this change the formula was Energy = Count * Generator / 400 + 0.99 which can be written as Energy = Count * (Generator + 396 / Count) / 400

So the old formula gave a fighter type a count depending generator bonus of 396/count. For example in a micro wing of ten fighters the fighter had a generator bonus of 39.6. This bonus vanished more and more as the type count became greater and geater. Micro wings therefore were too strong. And so at many places in the code penalties for the micro wings and bonuses for the bigger wings were introduced.

Instead of this now the + 0.99 was removed together with with a re-scaling, i.e. the /400 was replaced by /50. Also all the penalties and bonuses were removed.

[edit] ORD

New:

  • There is now a difference between the available ord in vcr and the displayed in the client

Here is the procedure how the wing's vcr-ord in space combat is calulated from the displayed ord in the client:

  • DO for all three types:
** MaxOrd = MaxOrd + OrdCapacity (from fighter stats) * type's count
  • DO for all three types
** Type's vcr-ord = Round(wing's ord (outside vcr) / MaxOrd * SQR(OrdCapacity) * type's count)

Simple spoken if a fighter can carry N ord outside vcr (like in it's stats) then in vcr it has SQR(N) ord.

Note: The SQR(OrdCapacity) is now replaced by

IFF[OrdCapacity<=4; 2 * OrdCapacity; 8 + SQR(OrdCapacity - 4)]

This gives a vcr ord bonus to all fighter types. The percentage increase decreases as the ord capacity grows. Fighter types with a ord capacity of 8 now have at least one missile shot.

There is also a hconfig parameter "Fighter Missile VCR Ord Usage" which by default 10. If one now thinks that this will lead to only a few missile shots for some types: Yes, this is true. But

1) A missles shot per type uses 100 energy. One fighter charges with generator/50 by default. So the the time to fire M missiles takes at least M x 5000/Generator. The mean generator stat is 13. The mean ord capacity 109.

2) Don't forget the "Return mode" for wings. Their carrier will load them with fresh ord.

3) One can adjust it with the aforementioned hconfig parameter.

[edit] Probable vcr ord change (host 213L)

As it has turned out that some types suffer too much from the reduced vcr ord the vcr ord will calculated with

IF OrdCapacity <= 4 THEN WingVCROrd = 2 * OrdCapacity
IF OrdCapacity > 4  THEN WingVCROrd = 8 + SQR(OrdCapacity - 4)

Here is a table to demonstrate the change:

Compare of old and new vcr ord formula
Ord capacity Vcr ord old Vcr ord new Factor of change
1 1.0 2.0 2.0
2 1.4 4.0 2.8
3 1.7 6.0 3.5
4 2.0 8.0 4.0
5 2.2 9.0 4.0
6 2.4 9.4 3.8
7 2.6 9.7 3.7
8 2.8 10.0 3.5 (Priv T3)
9 3.0 10.2 3.4
10 3.2 10.4 3.3 (Stormer T3)
11 3.3 10.6 3.2
12 3.5 10.8 3.1
13 3.6 11.0 3.1
14 3.7 11.2 3.0
15 3.9 11.3 2.9 (Bird T3)
20 4.5 12.0 2.7
50 7.1 14.8 2.1
100 10.0 17.8 1.8
250 15.8 23.7 1.5
500 22.4 30.3 1.4 (EE T3)

So for example the Priv T3 now has 3.5 vcr ord more than before. One Priv T3 can now fire one missile.

With this change missile type now should have enough missiles for at least one space combat.

[edit] Charging within a Carrier

If a wings runs out of ord, is set to "return home" and if the carrier is intact and if both are not under fire then a wing can re-dock.

A "carrier" is called intact for recharging wings if

  • Ship:
    • crew >= 1
    • system damage < 100%
    • hull damage < 50%
  • Base:
    • base incoming <= 50 % of max base incoming

If a wing is re-docked to its carrier then it depends on the carriers abilities how long it takes until the wing can be re-launched.

This ability is calculated as follows:

Step 1

  • Ship:
    • NeededCrew = HullCrewSize
    • Damage = ship's hull damage
    • IF Borg THEN Skillz = 390 * ship's HGs + ships's skill
    • IF non Borg THEN Skillz = ship's HGs / 10 + ship's skill
  • Base:
    • NeededCrew = 10 * wing's fighter count
    • Damage = 1000 * base incoming / max base incoming
    • IF Borg THEN Skillz = base HGs * 390
    • Skillz = Skillz + base HGs / 10 + training centers

Step 2

NeededCrewRatio = Min(1, Crew / NeededCrew) (maximum 1)
IntactLevel     = 1 - Damage / 500 (minimum 0)
Status          = (IntactLevel + NeededCrewRatio) / 3

Step 3

Luck = Sigmoid(Skillz, 500, Status, 0.01)
IF elapsed time (since re-docking) * Luck > RND * 100 THEN (evaluated each tick)
* Full vcr-ord load
* Full battery charge
* Skill = Skill + 1 (has only a meaning for ships)
* Set wing ready for re-launch
* If the carrier wasn't under fire for the last ten ticks then the wing re-launches 

Step 4

If the carrier is still intact then the wing re-launches. It appears where the carrier currently is and starts with the velocity vector of the carrier.

Good to know:

  • The less missiles a type can shot the faster it can re-dock.
  • A re-docked wing re-launches FULLY loaded (ord and battery)
  • Some types have too many ord to re-dock in finite time
  • Sigmoid(Skillz, 500, Status, 0.01) is a function with a sigmoid graph (curve) with respect to the argument Skillz.
    • If Skillz -> -oo then Sigmoid -> 0
    • If Skillz -> +oo then Sigmoid -> 1
    • Around Skillz ~ 500 the output changes from 0 to 1
    • Exactly at Skillz = 500 the output is Status
    • At Skillz = 0 the output is 0.08
  • Elapsed Time (since re-docking) * Luck / 100 is the chance per tick that the wing will be fully charged and marked as ready to re-launch

[edit] Bases

The charge formula for bases that is applied every tick is

baseE = baseE + baseGen * r

[edit] Damage Modifier

"r" is a modifier which reflects the damage state of a base. As only Base Shield, Anti-Aircraft Guns and Base Ion Cannons are directly destroyed due to incoming fire whereas the base generator value ("baseGen") depends on Colonists, Cities, Undercities and Factories, one has to take a measure of the damage of the base. This is the ratio of the damage potential of the received destructive incoming fire and the maximum a base can stand (which depends on all the ground structures a base has).

r = baseIncoming / baseMaxIncoming

[edit] Energy Generation

New: The "baseGen" (the amount of energy each tick can be added to the base energy for the weapons) depends on the number of "used" (under)cities and factories. The increase of "baseE" depends linear up to a certain base size and then grows more and more flatter:

v = baseColonists / 100000

IF v > 500 THEN v = 500

h = undercities + cities

IF h > v   THEN w = v 
ELSE            w = h

h = factories: h = h * h / 200000

IF h > w   THEN w = 2 * w 
ELSE            w = w + h

IF w > 200 THEN w = 200 + (w - 200) ^ 0.865

baseGen = w * 12

IF baseGen < 20 THEN baseGen = 20

In words: If M x 100k colonists live in (under)cities and if N x 100k can work in factories then M+N is a measure for the energy production of this base.

If you have more factories and/or cities than needed for your amount of colonists, then only the "used" part of the structures is taken into account for the calculation of the energy production.

Example:

You have 23M colonists 150 cities and 3000 factories. Then 150 x 100k colonists live in cites. In the 3000 factories can work 3000^2 * 2 = 45 x 100k colonists. So you take 150 + 45 = 195. This is smaller than 200, so the energy production is 200 * 12 = 2400GW per tick.

Good to know:

  • There is always a minimum energy production of 20GW per tick

[edit] Considering weapons as charged

The need to check if weapons are charged (sufficiently) comes mainly from the combat modes "Strike Through" ships and wings and "Return Home" for wings. So currently there is no need to consider bases here. For both modes the units should change their behavior with respect to the charge state of their weapons. If loaded then the enemy should be attacked and if not sufficiently charged the unit should hide at a safe place or return to the carrier or home base.

[edit] Ships

This is very easy. The condition is currently that all weapons have to be full. Point defense, weapons which are to badly damaged and super weapons are not considered.

What is left is to check if an ord weapon has enough ord, if the race is a Stormer, if there is at least one intact weapon and if the powerbank is full if the ship is in new power boost mode.

[edit] Wings

This is the more tricky one.

The following refers to this abbreviations:

fDiv = Firing fighter divisor
mOrd = Fighter missile vcr ord usage
bDrain = Fighter beam drain
mDrain = Fighter missile drain
cDiv = Wing Charge divisor
fG = fighter generator stat
fC = Fighter Count of the considered type in the wing

Wings are considered as charged if there is enough energy to fire a certain number of N salvos. The hconfig parameter FiringFighterDivisor is the maximum number of fighters per type which are allowed to fire per tick. This is one salvo. If missiles types have not enough ammo anymore to fire this number of salvos but enough energy to fire the remaining ammo then they are also regarded as charged. If the number of desired salvos needs more energy than the battery can hold then the type is also regarded as charged. If a type has not enough ammo to fire a missile then it is handled as missile less type.

The number of salvos N is derived from the an average generator value of 10 and the minimum peel off time in strike thru (50) under dafault hconfig parameters:

50 = [N * b|mDrain * (fCount / fDiv)] / [(fCount * (10 / cDiv))]
N = 500 * (fDiv / cDiv) / b|mDrain

So N is 50 for beams and 5 for missiles.

To determine the desired number of beam|missile shots, which a type should be able to fire when considered as charged, N is multiplied with the MeanShotLimit a type can fire per tick:

MeanShotLimit = fC / cDiv + 2 * OddsCompetition(fG - 10, 10)
IntendedShots = MeanShotLimit * N

If IntendedShots should be smaller than 1 then it is set to 1. Then the needed energy for the type is calculated

NeededEnergy = m|bDrain * IntentedShots

and is is compared with the actual energy in the type. If the NeededEnergy is available then the type is considered as charged. If all three types in the wing are charged then the wing is considered as charged. After the minimum time of 50 ticks in peel off mode has gone by this is then a signal for the wing to go into chase mode and to start its attack run.

Personal tools