API – Iridar's Gaming Blog https://iridar-mirror.knyazev.io Fri, 31 Aug 2018 01:27:27 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.3 https://iridar-mirror.knyazev.io/wp-content/uploads/2017/12/cropped-ava_100x100-32x32.jpg API – Iridar's Gaming Blog https://iridar-mirror.knyazev.io 32 32 How to use Daybreak Census API https://iridar-mirror.knyazev.io/how-to-use-daybreak-census-api/ https://iridar-mirror.knyazev.io/how-to-use-daybreak-census-api/#comments Tue, 04 Jul 2017 08:58:24 +0000 https://iridar-mirror.knyazev.io/?p=4127 Continue reading How to use Daybreak Census API ]]> You can find pre-made queries here. This article explains how they work, so you can make your own queries, if need be.

How to make an API Query

Information in the API is distributed between many collections. Each collection contains entries with typical structure for that collection. Each entry contains fields with information.

Usually, information about in-game objects is distributed between many different collections. For example, to pull full stats of one weapon, you have to access as many as 17 (!) different collections.

Fortunately, you can access several collections at once by joining several queries together.

Before you proceed, It is highly recommended you get a JSON formatter plugin for your browser. Google it.

List of collections: https://census.daybreakgames.com/get/ps2/

Census website: https://census.daybreakgames.com/

Some queries pull a lot of info at once, and if you intend to make several queries in a short time frame, you may be required to register a Service ID.

Basic Queries

To query a collection, you simply write its name in the link. For example, let’s query the “item” collection, which is basically a huge list of all items in game:

https://census.daybreakgames.com/get/ps2/item

This will return a JSON string with the first entry of the “item” collection. In this case, it contains information about Mag-Cutter.

To query a collection for multiple entries, you have to specify the amount using a c:limit modifier. One does not simply access ALL entries in a collection.

https://census.daybreakgames.com/get/ps2/item?c:limit=5

This will give you first five “items”. However, there is an overall limit to query size, and querying for several thousand of items will get hard and messy, so it’s a method best kept to “small” collections of several hundred members.

To query specific entries, you can search entries with a field containing a certain value. For example, you can query a weapon by a name, or by an item_id.

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5

https://census.daybreakgames.com/get/ps2/item?item_id=43

Weapon name has to be written exactly as it appears in game, it is sensitive to letter case and spaces. Notice how we also specified the language of the name field. Collections with localized fields, such as names and descriptions, will contain all languages at the same time, which can get cluttering. You can specify a language like this:

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5&c:lang=en

You can search for multiple entries with a certain value in a field. For example:

https://census.daybreakgames.com/get/ps2/item?item_category_id=8

This query will display the first entry in the “item” collection with the item_category_id of 8, which is the Carbines’ category ID. To show all entries with that item_category_id, you have to again use the c:limit:

https://census.daybreakgames.com/get/ps2/item?item_category_id=8&c:limit=400

Joining Collections

Joining several collections in one query makes it easier to access full information about something. For example:

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5&c:lang=en&c:join=item_category^on:item_category_id^to:item_category_id

This query will join item and item_category collections, so you can access a weapon by a name, and see its category right away.

“On” is the name of the field in parent collection, “to” is the name of the field in child collection. In some cases you can forego specifying the “on” and “to” parts of the joining. In this case, you can simply write: 

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5&c:lang=en&c:join=item_category

Sometimes on and to can be omitted and the join will still work. That’s because if you don’t specify them it will use item_id by default.

Most times using only on to specify which field from the parent collection to use is enough. For example instead of item_id you might want to use item_category_id or there is no item_id in the collection so there is no default.

But there are times when you have to use to as well. That’s when the joining field from the parent collection has a different name from the identifying field of the child collection.

For example joining attachment item info to the attachment list of a weapon. The attachments list collection uses attachment_item_id to identify the attachment, but the attachment info collection uses item_id.

-/u/H_Q_

You can also specify the name of the join:

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5&c:lang=en&c:join=item_category^on:item_category_id^to:item_category_id^inject_at:Category

This can make large queries more readable. If the child collection contains several entries with that identifier, you need to specify that you want to join all of them.

https://census.daybreakgames.com/get/ps2/item_category?name.en=Carbine&c:lang=en&c:join=item^on:item_category_id^to:item_category_id^list:1

This query will show all weapons in the “Carbine” category.

Multi Join

You can string several joins together by separating them with commas:

https://census.daybreakgames.com/s:iridar/get/ps2/item?name.en=M77-B&c:lang=en&c:join=item_to_weapon,weapon_datasheet

This identical to using several join commands in one query:

https://census.daybreakgames.com/s:iridar/get/ps2/item?name.en=M77-B&c:lang=en&c:join=item_to_weapon&c:join=weapon_datasheet

Multi-Level Join

You can create multi level joins by using round brackets: ( and ).

https://census.daybreakgames.com/s:iridar/get/ps2/item?name.en=M77-B&c:lang=en&c:join=item_to_weapon(weapon)

This query will display some of the weapon’s stats, stored in the “weapon” collection. It has the following structure and query response:

JSON Multi Level Query

Collections

You may find this map of the API useful. All credit goes to /u/Arklur.

item

This collection contains meta information about an item, such as its localized name and description. This is the starting point for queries of weapon stats.

Fields

Category: item_category_id

You can figure out item’s category by searching for the specified item_category_id in the item_category collection, or joining it.

Description: description

Contains all languages by default, but you can access specific language by writing the language’s two-letter code after a dot, for example: description.en, or using a &c:lang=en modifier.

Faction: faction_id

These field will specify which factions can use the weapon. Faction IDs can be accessed in faction collection.

Item’s Image: image_path

This can be used to access item’s in game icon. Simply paste the path after the basic census link: 

https://census.daybreakgames.com/files/ps2/images/static/963.png

Some images are missing from the API, and will give a page_not_found error when you try to access them. There is nothing to be done about it, but you can datamine weapons’ icons from client files by using PS2LS tool. Images are stored in .dds format, and you can use any free converter to convert them into .png.

Image Set: image_set_id

The API usually stores several icons of different sizes. The image_path contains the address of the largest image, you can access smaller images by searching or joining the image_set collection.

weapon_datasheet

Parent collection: item

Join key: item_id

Magazine Size: clip_size

Ammo Pool: capacity

It’s worth noting that Ammo Pool includes the ammunition already loaded into the weapon, so 40/240 in the API will appear as 40/200 in game.

The rest of the fields in weapon_datasheet collection are misleading and should not be used, as they refer to the old format of displaying weapon stats in game, basically somehow correlating with the number of bars in certain categories.

fire_mode

Parent collection: item

Join key: item_id

This collection contains some of the weapon stats, related to Damage and Reload times. However, the fire_mode_2 collection contains the same information and much more, so it is preferable to use that when possible.

It is important to understand that in-game firemodes, such as “semi-auto” and “fully-automatic”, and the API “firemodes” are different.

As far as API is concerned, “semi auto” and “full auto” are fire groups, and “fire modes” make the distinction between hip firing and ADSing.

Attachments like Underbarrel Grenade Launcher function by attaching an additional fire_group to a weapon. 

Each API firemode contains a complete set of parameters and keys to entries in other collections that define how a weapon functions. So it is technically possible to give a weapon completely different functions in different firemodes; that’s how NSX Amaterasu works.

The fire_mode collection will usually have multiple entries for each weapon, all using the same item_id key. So when joining the item_id collection, remember to use ^list:1 modifier, or when searching the fire_mode collection manually, remember to use &c:limit=400 modifier.

Cone of Fire Bloom: cof_recoil
Short Reload: reload_time_ms
Reload Chamber Time: reload_chamber_time_ms
Pellets Per Shot: pellets_per_shot
Pellet Spread: pellet_spread
Magnification: default_zoom
Projectile Speed: muzzle_velocity
Minimum Damage: damage_min
Maximum Damage: damage_max
Minimum Damage Range: damage_min_range
Maximum Damage Range: damage_max_range

Resistances: damage_target_typedamage_resist_type

 

weapon

Parent Collections: item -> item_to_weapon

Key: weapon_id – required to join fire_group collection.

Sprint Recovery Time: sprint_recovery_ms

A delay before a weapon can be fired after you stop sprinting.

Equip Time: equip_ms
Unequip Time: unequip_ms
Scope In Time: to_iron_sights_ms
Scope Out Time: from_iron_sights_ms

Unused or unknown fields

weapon_group_id, turn_modifier, move_modifier

fire_group

Parent Collections:  item -> item_to_weapon -> weapon_to_fire_group (list)

For each weapon_id there are one or several corresponding entries in fire_group collection.

Each fire_group entry refers to weapon’s in game firemode, such as 3x Burst, Semi Auto, etc. 

Each fire_group entry has an index, which refers to the order of in-game firemodes. Index of 0 corresponds with weapon’s first firemode. 

Most fire_group entries have two firemode_ids. The first defines how the weapon behaves while hip firing, the second – ADSing. 

Example

Link to example query. First, we have to access TRAC-5’s weapon_id by joining the item_to_weapon collectionTRAC-5 has two in-game firemodes, semi auto and auto. This is represented in the API by fact that there are two entries in weapon_to_fire_group collection with TRAC-5’s weapon_id. But first you have to join the item_to_weapon collection to access TRA

Each weapon_to_fire_group entry contain a fire_group_id and index

The entry with index of 0 refers to TRAC-5’s default in-game firemode – the full auto one. Pressing the in-game Change Firemode key basically increases weapon’s current Fire Group index by 1.

For each fire_group_id, there are two entries in fire_group_to_fire_mode collection.

Again, each fire_group_to_fire_mode entry contains a fire_mode_id and index.

The entry with index of 0 refers to hip fire stats of the weapon, index of 0 refers to ADS stats.

Click to enlarge

Each fire_mode_2 entry completely describes how a weapon performs, so in theory, a weapon can have completely different performance between hip firing and ADSing. Same goes for different in-game firemodes. This is why it’s possible for Spiker to have a secondary charge up mode.

Additional Fields

For some specific weapons, fire_group entries also contain some crucial stats:

transition_duration_ms – how long does it take a weapon to switch to this fire group.

chamber_duration_ms – how long does it take to cycle a Bolt Action or Pump Action weapon between shots. To calculate actual time between shots, you need to add together the chamber_duration_ms and refire_ms.

can_chamber_ironsights – whether a Bolt Action or Pump Action weapon can be cycled between shots while the user Aims Down Sights.

spool_up_ms – how long does it take for a spool-up weapon to reach its maximum Rate of Fire. Ex. T7 Mini-Chaingun

spool_up_initial_refire_ms – initial Refire Time of a spool-up weapon.

fire_group_to_fire_mode

A pass-through collection between fire_group and fire_mode_2. In addition to fire_mode_ids, also contains indexes of relevant fire_modes.

fire_mode_2

This collection is much trickier to access than fire_mode, and requires a multi-level join. However, in return it provides a much clearer structure and more stats.

Collection: fire_mode_2

Parent collections: item -> item_to_weapon -> weapon_to_fire_group (list) ->
fire_group_to_fire_mode (list) -> fire_mode_2

Check this example to see which keys you need to specify for each join.

Join key: fire_mode_id

Contains keys: player_state_group_id, damage_direct_effect_id, damage_indirect_effect_id

Step by step

item -> item_to_weapon

To learn weapon’s weapon_id.

 item_to_weapon -> weapon_to_fire_group (list)

Here you get a list of weapon’s in-game firemodes, such as “3x burst” and “semi-auto”. Each fire group has an index. Index of 0 refers to weapon’s default firemode.

weapon_to_fire_group (list) -> fire_group_to_fire_mode (list)

Here you get a list of fire modes for each fire group. Usually this will be hip firing and ADSing. Each mentioned firemode will also have an index. Usually, index of 0 usually refers to hip firing, and index of 1 to ADSing.

fire_group_to_fire_mode (list) -> fire_mode_2

Finally, you get to weapon stats for each firemode.

Fields

fire_mode_2 collection has the same fields as fire_mode collection, and more:

automatic – defines whether the weapon will continuously fire if you hold the “fire” key.

move_modifier – a multiplicative modifier to player’s movement speed in this firemode. This is how you access weapon’s ADS Movement Speed Modifier.

cof_scalar, cof_scalar_moving – multiplicative multipliers to Cone of Fire values written in Player State Group entries. For example, Laser Sight functions by reducing cof_scalar of hip fire fire_modes. Moving CoFs are already affected by cof_scalar, so cof_scalar_moving is an additional variable. 

Projectile Velocity aka Muzzle Velocity: projectile_speed_override

Each projectile in PS2 has a pre-defined velocity. This field will override projectile’s pre-defined velocity. This is a convenient way for developers to set different velocities for different weapons that use the same projectile (e.g. bullet).

Magnification: zoom_default

This is the field that gets overridden by optics attachments.

Pellet Spread: cof_pellet_spread

For non-shotgun weapons, this will be equal to 0. 

Cone of Fire Bloom: cof_recoil

Headshot Damage Multiplier: damage_head_multiplier

Increase this is by 1 to get a total multiplier. E.g., damage_head_multiplier of 1 means the weapon deals 2x damage on headshots.

Legshot Damage Multiplier: damage_legs_multiplier

Subtract this value from 1 to get the total multiplier. E.g. damage_legs_multiplier of -0.1 means the weapon deals 0.9x damage on legshots.

fire_ammo_per_shot – determines how many rounds a weapon spends with each shot. E.g., shotguns fires multiple pellets per shot, but spend only one round per shot. While NSX Masamune fires all 4 rockets at the same time from the hip.

fire_auto_fire_ms – sets the weapon’s Refire Rate in fixed burst firemodes.

fire_burst_count – sets the weapon’s burst length in fixed burst firemodes.

fire_charge_up_ms – determines for how long can you hold the fire key before releasing to fire. E.g. Lancer. It is unclear where the information about different charge levels is stored.

fire_delay_ms – determines the amount of time that passes between you clicking to fire, and the weapon firing. E.g. NSX Yumi, RailJack.

Minimap Fire Detect Range: fire_detect_range

Refire Time: fire_refire_ms

The amount of time that must pass between shots. Refire Time also plays an important role in CoF Recovery and Recoil Recovery processes. Can be used to calculate weapon’s Rate of Fire:

Rate of Fire = 60 / Refire Time.

Pellets Per Shot: fire_pellets_per_shot

How many projectiles a weapon fires with each shot. Important for shotguns and other similar weapons.

Maximum Indirect Damage: max_damage_ind
Maximum Indirect Damage Radius: max_damage_ind_radius
Minimum Indirect Damage: min_damage_ind
Minimum Indirect Damage Radius: min_damage_ind_radius

Go here to learn about Indirect Damage Mechanics.

Recoil Statistics

Maximum Recoil Angle: recoil_angle_max
Minimum Recoil Angle: recoil_angle_min
First Shot Recoil Multiplier: recoil_first_shot_modifier

This is the total multiplier, no need to add or subtract anything.

Maximum Horizontal Recoil: recoil_horizontal_max
Minimum Horizontal Recoil: recoil_horizontal_min
Horizontal Recoil Tolerance: recoil_horizontal_tolerance

Maximum Vertical Recoil: recoil_magnitude_max
Minimum Vertical Recoil: recoil_magnitude_min
Recoil Scaling Stats: recoil_increase, recoil_increase_crouched, 
recoil_horizontal_max_increase, recoil_horizontal_min_increase

Recoil Recovery Delay: recoil_recovery_delay_ms
Recoil Recovery Rate aka Recoil Decrease: recoil_recovery_rate

recoil_recovery_acceleration – no solid information on how it functions, presumably the value of 1000 means there is no acceleration. 

 

Unused or unknown fields

grief_immune, sprint_fire, turn_modifier, use_in_water, cof_override, cof_range, armor_penetration, shield_bypass_pct

effect

Parent Collection: fire_mode_2

Join keys: damage_direct_effect_id, damage_indirect_effect_id

This collection’s entries contain effects caused by weapons. Usually, they just repeat the weapon’s damage values, but there are exceptions.

For example, accessing Rocket Launchers’ Indirect Damage Effect allowed to discover the Hidden Scaling of Indirect Damage based on Rocket Flight Distance.

Similarly to zone_effect collection, you can join the effect_type collection to get textual description of what effect’s parameters do.

player_state_group

Contains some information about weapon’s Cone of Fire properties, but less than player_state_group_2.

Parent Collection: fire_mode_2

Each fire_mode_2 entry contains a player_state_group_id. The player_state_group collection contains multiple entries with the same player_state_group_id.

Each entry contains the textual description of the player state, like “Standing” or “CrouchWalking”, and weapon’s Minimum Cone of Fire in that state.

Fields: player_state, min_cone_of_fire

player_state_group_2

Basically the same as player_state_group collection, but with more stats.

Parent Collection: fire_mode_2

player_state_id – determines which player stance is being described in this entry.

Player State ID Stance
0 Standing Still
1 Crouching Still
2 Standing Moving
3 Sprinting
4 Falling Long
5 Crouching Moving

can_iron_sight – whether the user can Aim Down Sights in this state. This is likely the field that was changed when players lost the ability to Aim Down Sights while jumping and falling.

cof_grow_rate – degrees per second, the speed of Cone of Fire expansion when it blooms or when the player moves to a stance with larger Minimum CoF.

cof_recovery_rate – degrees per second, the speed at of Cone of Fire reduction when the user stops firing or moves to a stance with lower Minimum Cone of Fire.

Maximum Cone of Fire: cof_max
Minimum Cone of Fire: cof_min
Cone of Fire Recovery Delay: cof_recovery_delay_ms

I assume this functions by the same principles as Recoil Recovery Delay.

Unused or unknown fields

cof_shots_before_penalty, cof_recovery_delay_threshold, cof_turn_penalty

fire_mode_to_projectile

A pass-through collection between fire_mode or fire_mode_2 and projectile collections.

projectile

Contains information about the projectile used by a weapon in specific fire_mode

Parent Collection: fire_mode_2 -> fire_mode_to_projectile -> projectile

Projectile Speed aka Muzzle Velocity: speed

Keep in mind that this field will be usually overridden by projectile_speed_override in fire_mode_2 entry.

Projectile Lifespan: lifespan
Dumbfire Rocket Acceleration: acceleration
Dumbfire Rocket Maximum Speed: speed_max
Projectile Gravity: gravity

drag – unknown field. Possibly a delay between weapon “firing” and projectile appearing. It seems to be greater than zero only for grenade-like weapons. Drag > 0 query.

Projectile Flight Type: projectile_flight_type_id 

This field can be used to search or join the projectile_flight_type collection. This is a small collection with only a few entries:

  • Ballistic
  • True Ballstic – Uses Real Gravity
  • Dynamic
  • Proximity Detonate

These descriptions can be used to speculate how the projectile will behave in game.

  • Ballistic type is likely to “detonate” and disappear upon hitting anything. 
  • Dynamic type is assigned to grenade-like projectiles, so it means it will bounce around until the lifespan is over, and then it will “detonate”.
  • Proximity Detonate type likely means the projectile will “detonate” when near an eligible enemy object. E.g. flak weapons.

By “detonate” I mean the projectile will apply its effects. E.g. a bullet will deal direct damage, a rocket will explode and deal direct and indirect damage, a Smoke Grenade will puff out smoke.

Lock-on Turn Rate: turn_rate 
Lock-on Lose Angle: lockon_lose_angle
Lock-on Lifespan: lockon_lifespan
Lock-on Acceleration: lockon_acceleration

Still no idea how it works.

item_attachment

PlanetSide 2 weapon attachments are also a part of the item collection. The item_attachment collection contains entries with item_ids of attachments, available to a weapon with a certain item_id.

Example query. Example response.

Parent Collection: item

Then you can join the item collection to get the item entries for all attachments, available to a weapon.

zone_effect

Among other things, this collection contains effects of all weapon attachments

Parent Collection: item

Most attachment item entries have a passive_ability_id field. You can use this to join it with ability_id of zone_effect entries. 

Example query.

zone_effect_type

This collection contains textual descriptions of values stored in zone_effect entries.

Each zone_effect entry has a zone_effect_type_id field. It can be used to create a join with zone_effect_type collection.

Example query.

Attachment Effects Examples

Figuring out attachment effects can get kinda messy, so let’s go over a few examples so you get the general idea of how it works.

Scope

Query. Here we are interested in four things.

  1. The attachment affects all fire_groups.
  2. The attachment affects only fire_modes with index of 1 (usually, ADSing).
  3. The attachment changes weapon’s default zoom in affected firemodes.
  4. The value is changed by adding “1” to it.

M-77B has Default Zoom of “6”, so the 7x Scope Attachment simply adds “1” to that value.

Forward Grip

The “string1” description tells us the affected weapon statistic is Maximum Recoil Angle.

“param1” and “param2” are set to “-1”, which means that all weapon’s Fire Modes are affected by the attachment, i.e. regardless if you hip fire or ADS and from which stance.

“param3” is not set for this effect.

“param4” is set to “-25”. Description of param4 is “PcntAddend”, where “pcnt” stands for “percent”. So this effect of the Forward Grip reduces Maximum Recoil Angle by 25%.

But there are other effects of the Forward Grip.

For example, here we can see that for TRAC 5 Forward Grip also increases Equip Time by 150ms.

Suppressor

Here we can see that Suppressor for TRAC 5 reduces Max Damage Range by 5m and Min Damage Range by 20m.

HS/NV Scope

Increases the time it takes to ADS by 150ms.

For comparison, by default it takes TRAC 5 another 150ms to ADS:

Underbarrel Grenade Launcher

Example query. We can see that Underbarrel Grenade Launcher attachment adds a Fire Group to a weapon. Let’s query that Fire Group. Here’s what we get:

This way we can access exact stats of the Grenade Launcher, and learn that it takes 0.8 seconds to switch to it.

Ability Effects Examples

zone_effect collection also contains effects of passive and active abilities, such as Zealot Overdrive Engine of VS MAXes. Example query.

We can query the armor_info collection and learn that ZOE 1 increases incoming damage  by 20% from all sides except Bottom. 

Armor and Resistances

You can learn about Armor and Resistance interactions here.

profile_2 – contains unit names and their profile_ids.

profile_armor_map, profile_resist_map – contains armor_info_ids and resist_info_ids for built-in armor and resistance values for all profiles, using profile_id as key.

armor_facing – contains descriptions for different armor_facing_ids. You need those to learn which armor_info is applied to which unit’s projection.

armor_info – contains the actual information about units’ armor, both built-in and acquired from items and abilities, using armor_info_id as key.

resist_info – same as armor_info, but for resistances. resist_info_id is key.

resist_type – contains textual descriptions for different resist_type_ids. Incomplete and sometimes not exactly accurate. 

For example, it doesn’t contain Damage Type 9 – Tank Mine and Damage Type 11 – C4. It also won’t tell you that AV Grenades use Damage Type 34 – Infantry Rockets.

All of these collections are utilized in the “Resistances” and “Built In Resistances” pages of the Toolbox, which calculates weapon damage to vehicles. 

This multi-join query will show you built-in Armor and Resistance values for the Lightning.

Credits

Huge thanks to /u/L33-the-3rd, /u/shaql, /u/fisu_, /u/Wrel and /u/nehylen for teaching me how to use the API. You guys are awesome, wouldn’t be here without y’all.

]]>
https://iridar-mirror.knyazev.io/how-to-use-daybreak-census-api/feed/ 2
Weapon Stats https://iridar-mirror.knyazev.io/weapon-stats/ https://iridar-mirror.knyazev.io/weapon-stats/#respond Tue, 03 Jan 2017 23:51:36 +0000 https://iridar-mirror.knyazev.io/?p=2503 PlanetSide 2 weapons have a lot of statistics that define how they function in-game. But only a portion of those statistics is shown in-game. This is how you can access the rest:

PlanetStats

This should be your go-to resource. Lists all weapons in a convenient, sortable form. You can also select and compare several weapons. This source would be ideal, if not for a few issues:

  • Sometimes weapon stats take too long to load. 
  • Some numbers are rounded too roughly. For example, it will show 0.225 as 0.23.
  • Some stats, like Recoil Recovery Delay, are not shown, and Equip Time is incorrect for some weapons.

Daybreak Census API

This online database is owned and controlled by Daybreak – PlanetSide 2 developers. It contains information about player characters and weapon statistics. This is where PS2 informational sites pull data from.

To pull information from the API, you have to put a query into browser’s address bar. Here is an example of the simplest request:

https://census.daybreakgames.com/get/ps2/item?name.en=TRAC-5&c:lang=en

You will receive a JSON string. I highly recommend you use a browser plugin that formats JSON strings to make them more readable, or at least use a JSON formatting site.

Normally, you can view JSON strings right in the browser, but some browsers prompt a download of the .json file instead. In that case, you can open it with any text editor, such as Notepad.

However, that simplest query does not give you any useful information about the weapon. This is because Census database is fairly complex, and weapon data is stored in several different tables, with different key fields. So if you want to pull all available information about a weapon, you have  to pull information from several places at once, and the query becomes much bigger.

Full Query

Go here if you’d like to learn how to put together your own queries.

These versions of the query pull all information about the weapon, including what cannot be accessed in-game, such as Recoil, Equip Time, Projectile Lifespan and exact effects of attachments.

By Item ID 

By weapon name 

Implant Effects 

Vehicle Attachments

Nanoweave Armor

Built-in Armor and Resistances

These queries pull a lot of info at once, and if you intend to make several queries in a short time frame, you may be required to register a Service ID.

Both queries above pull information in English. If you want to pull all languages, simply remove &c:lang=en from the query.

Or you can specify another language: de, en, es, fr, it, tr

There are other queries you can make to the Census, as explained here and here.

How to find out weapon’s Item ID?

You can make a query using weapon’s name: 

https://census.daybreakgames.com/get/ps2:v2/item?name.en=Force-Blade

Make sure to type the name exactly as it appears in game, including blank spaces, if there are any. The Item ID will be listed in one of the first fields, e.g: “item_id“: “19”

If you’re having trouble typing the weapon name properly, or if you don’t know the name, then another way is to make a query of all weapons of certain category.

Or query for a list of categories:

https://census.daybreakgames.com/s:iridar/get/ps2/item_category?c:limit=500&c:lang=en

Examples of queries for all weapons in “Carbine” category:

https://census.daybreakgames.com/s:iridar/get/ps2/item_category?c:limit=500&c:lang=en&name.en=Carbine&c:join=item^list:1

https://census.daybreakgames.com/s:iridar/get/ps2/item?item_category_id=8&c:limit=500&c:lang=en&c:show=item_id,name

Weapon Analysis Toolbox

This Excel Sheet can:

  • download weapon stats from Census API and display them in formatted form, including information about weapon’s projectile
  • make manual query to Census API about a weapon with a simple double click
  • analyze and calculate weapon mechanics, such as Bullets to Kill, Time to Kill, bullet damage at certain range, analyze weapon’s Cone of Fire and Recoil properties.

DasAnfall

An alternative to PlanetStats. It displays more weapon stats, but can potentially be outdated, and you still have to know weapon’s Item ID. DasAnfall may be necessary to find out such weapon stats as:

  • Equip and Unequip Times
  • Projectile Lifespan
  • Projectile Gravity
  • Weapon’s Fire Modes

For example, you can use PlanetStats to find out that TRAC 5 has ID of 43.

Then link to the DasAnfall page of TRAC 5 will look like this: 

https://stats.dasanfall.com/ps2/civ/index.php?id=43

As you may notice, DasAnfall lists weapon stats several times. This is done because PS2 weapons have separate stats for each fire mode.

For example, TRAC 5 has 4 modes: single shot, full auto, single shot while ADS, full auto while ADS.

Most weapon stats are identical in different fire modes, but it’s important to understand that as far as game engine is concerned, those are all completely different weapons. 

It is theoretically possible to make a weapon that will function like a full auto grenade launcher while firing from the hip, and like a sniper rifle while ADSing, and could also switch into a Flak Turret fire mode.

FISU

An alternative to PlanetStats.

]]>
https://iridar-mirror.knyazev.io/weapon-stats/feed/ 0
Iridar’s Weapon Analysis Toolbox https://iridar-mirror.knyazev.io/toolbox/ https://iridar-mirror.knyazev.io/toolbox/#respond Wed, 07 Dec 2016 12:37:22 +0000 https://iridar-mirror.knyazev.io/?p=2304 Continue reading Iridar’s Weapon Analysis Toolbox ]]>

This video is outdated and doesn’t include many new features, but it explains the general purpose and spirit behind this tool.

This Excel Spreadsheet is a culmination of years of work on theorycrafting PlanetSide 2 weapon mechanics. It uses Visual Basic macros to pull weapon stats from DBG API, to calculate damage and recoil statistics and draw graphs to visualize them.

This toolbox arms you with all necessary tools for comprehensive weapon analysis.

Current version: v6h

Attention! When you first open the toolbox, you will see a yellow bar with a security warning about macros. Click “Enable content” to allow the use of macros, or the Toolbox will not function. 

Structure

The Excel file has 9 pages:

Each page fulfills its own, clearly defined function, but some of the pages can transfer data to each other.

Pages contain cells of different color:

soft-orange  Soft orange cells. These cells store automatically imported weapons stats, and they also accept manual input. You can edit them without fear of breaking anything.

light-greyLight grey cells contain calculations and references to other cells, do not edit grey cells, or you will break the tool’s functionality.

pale-yellow Pale yellow cells store values for configuration, and you may need to edit them in specific situations.

Toolbox chosen cell Light green filling indicates that this cell’s value has been selected, likely by double clicking.

Toolbox tooltipSmall red triangles in the corner of a cell indicate a tooltip. Put your mouse over the cell to display the tooltip.


Note: Toolbox’s calculations always assume worst case scenario: weapon damage is rounded down and target health is rounded up.

Stats Page

Toolbox stats page

This huge table has stats of all known primary and secondary infantry weapons. Normally you don’t work with this table itself, and only use it to export stats into other pages:

Double click or right click on any weapon to copy its stats into soft orange cells on other pages.

Other functions:

Double click on Item ID of the weapon to open a API query for that weapon in your default browser.

The Toolbox is not perfect, and may sometimes pull wrong stats, or fail to pull stats at all. There is no substitute for looking at a query with your own eyes. 

Select a weapon and click “Export 1” button. A window with exported weapon’s stats  and attachment list will show.

Pulling stats and adding new weapons

The Pull Stats button will initiate a download of weapon stats from DBG API, using API queries for each Item ID in the first column. When a new weapon is released, simply insert its Item ID to the end of the list, and its stats will be downloaded as well. 

If you don’t know weapon’s Item ID, you can find it out this way,  or simply copy-paste it from Attachments Page.

add-new-weapons

Keep in mind that “Name” column is not downloaded, and you will have to fill it manually for any new weapon releases.

The “Date” field near the “pull stats” button stores the date when stats were last downloaded. Normally, you should re-download stats only after a patch that changed something.

Damage Page

damage toolbox page

This page serves to analyze weapon damage at different ranges and/or with different attachments. You can compare two weapons at the same time.

On “Stats” page, double click on a weapon to export its stats for the first weapon, and right click for the second weapon.

You can add attachments to weapons by clicking corresponding Check Boxes. If the weapon doesn’t have a certain attachment, you will be informed with a pop up window, but you can’t see whether weapon has access to an attachment on this page without clicking the Check Box.

The calculations for Minimum and Maximum damage ranges are self-explanatory. To calculate weapon’s damage stats at certain range, enter it into soft orange Range cell.

Both weapons are analyzed against the same target, which you can configure this way:

Target Settings

 

Below the Health block, there are reference tables for Health, Nanoweave Armor and Kinetic Armor. Double click on Health or Damage Multiplier value to automatically apply it.

Both weapons have Headshot Damage Multiplier listed. You can double click on its value to apply it to the Damage Multiplier. 

Since both weapons fire at the same target, and damage multiplier is tied to the target, it may be inconvenient to compare headshot properties of two weapons with different headshot multipliers. 


The most common way to analyze a weapon is to look at its performance against the default target with 1000 HP and against a Full Nanoweave target with 1250 Effective HP, so these are the default parameters, and statistics for standard Full Nano target are calculated automatically.

BTK Thresholds

Toolbox BTK Thresholds

The “Calculate Thresholds” button will calculate BTK Thresholds for both weapons.

For example, the results on the picture above read as:

Gauss Rifle kills in 6 shots at 0m to 10m, and in 7 shots at 11m+.

“Draw Graph” button will also recalculate Thresholds and then draw a comparative graph.

Recoil Page

This page serves to analyze weapons’ recoil properties.

On the “Stats” page, double click on the weapon’s name will import its stats to the left position, and the right click to the right position. 

Click Calculate Stability to calculate Average and Maximum horizontal Deviations and to update Probability Distribution Graph.

The Visual Basic macro fires a virtual gun in bursts with listed “Burst Length” for the amount of times, listed in “Simulations” cell, and then averages out the results. 

“Average Deviation” is the average distance of the crosshair from the burst’s starting crosshair position. The lower it is, the better is the weapon’s horizontal recoil.

“Graph Scale H” refers to the maximum Horizontal Recoil value, visible on the graph. The default value of 0.7 is fine for most cases, but depending on how good / bad the weapon’s horizontal recoil is, you may need to increase or decrease this value to see the graph in necessary detail.

Vertical Recoil module is self explanatory, you’re mostly interested in Vertical Recoil per Second. For the purposes of vertical recoil, it’s better to have high RoF and low vertical recoil per shot, to ensure nice and soft, consistent pull.

FSRM value is listed mostly for your reference, it doesn’t participate in any calculations.

The Average Deviations listed in Recoil Angle block show how much a weapon is affected by Recoil Angle Variance. They basically show you the size of the yellow area:

Serpent Recoil Pattern
Serpent’s recoil pattern – not included with the Toolbox

Cone of Fire Page

This page displays weapon’s Cone of Fire in different stances and shows how it is affected by various attachments.

For now, this page has limited functionality due to Angular Size research fiasco. At this moment, the CoF Page will calculate weapon’s CoF Size after a certain amount of shots, necessary to kill the specified target at different ranges. 

However, without a way to calculate weapon’s accuracy at that range, it is more or less pointless. 

The CoF Page will also calculate a more useful statistic: Cone of Fire Bloom per Point of Damage Done. This statistic with an extra long name ties weapon’s damage output to accuracy loss, which allows you to objectively determine which weapon requires more burst firing, even with perfect accuracy, and regardless of weapon’s RoF or DPS.

You can combine weapon’s starting CoFs and CoF Bloom PPD to make an educated guess which weapon will be more accurate at range, and which weapon will require more burst firing.

Built In Resistances Page

Most units have built-in resistances and weaknesses to some of the Damage Types. This page can download these values from DBG API. To do so, double click on the Profile Name of the unit in the left list. 

Keep in mind that this page is also used for inner calculations of the Resistances Page, so the values you pull may be automatically overridden. 

At the top left, you can click “Pull Profiles” button to pull Profile IDs and Profile Names for all units in PS2. You may need to do this if a new vehicle or class is added to the game. You can also scrub the API for deployable items, such as Spitfire Turrets and Hardlight Barriers, as well as misc items, such as Infantry Terminals.

Resistances Page

This page allows you to calculate weapon damage against vehicles, taking into account their Health, Armor and Resistances to specific damage types. 

It also lets you apply additional defensive certifications to the vehicle. The damage is calculated for all different directions.

This is one of the more complicated pages, and it requires a connection to the Internet in order to function. A video demonstration with a couple of examples.

1) Select the weapon category, and then the weapon from the lists on the upper left. Weapon’s stats for its default firemode will be automatically imported from the API. You can change the weapon’s firemode in the respective listbox. This can be necessary for some of the weapons, like the GODSAW

Each weapon has fields for Direct and Indirect Damage. You can specify the distance to the target for Direct Damage, and distance to the explosion for Indirect Damage in the orange Range boxes on the lower left:

resistances range

2) Select the target unit from the list in the middle by double clicking on its name. Unit’s Health will be copy pasted from the listed, and unit’s Armor and Resistance to the selected weapon will be imported from the API.

Keep in mind that API does not contain unit health values. Health values in the toolbox were acquired by in-game testing, and in case of a patch that affects vehicle health values, values in the Toolbox will have to be adjusted manually.

Direct Damage, Indirect Damage, as well as hits to kill will be automatically calculated and displayed on the target’s “doll”.

Each side of the target has five values associated with it:

  • Armor reduces all incoming damage from this direction by a certain percent. In game, only vehicle’s orientation relative to the damage source is important. It doesn’t matter which part of the vehicle you’re hitting, only your position relative to the vehicle. 
  • Direct Damage is dealt on direct hits.
  • Indirect Damage is dealt on direct and indirect hits, though most of armored vehicles are immune to most Indirect Damage sources. 
  • The amount of hits required to destroy the vehicle with specified Direct OR Indirect Damage is also listed. Keep in mind that these damage sources are not added together. So if the unit takes damage from both Direct and Indirect Damage, you will have to calculate the required amount of hits manually.

When you import the target unit by double clicking on its name, the list on the upper right will update with some of the vehicle’s defensive certifications. Double click on the certification name to add it to the vehicle. 

When a defensive certification has several ranks, you only have to click on the rank you wish to add. E.g. when you wish to make calculations for Composite Armor 4, you don’t have to double click on Composite Armor 1-2-3 before that. 

Weapon-Target Resistance values will update from the API whenever you change the weapon or the target unit.

You can also manually edit all values in orange boxes to analyze theoretical scenarios. Do not edit the grey boxes, or you will break the tool’s functionality. 

Additional Functions:

For both Direct and Indirect Damage, you can double click the cell with damage value to apply it to the target and subtract it from target’s health. This is convenient when you wish to calculate damage from several sources. 

Example: you want to find out how much Rocklet Rifle hits it takes to destroy a Lightning in the rear armor after one brick of C4. Video demonstration.

For both Direct and Indirect Damage Types, you can click a “Find Weapons with that Damage Type” button. The toolbox will find all weapons that use that Damage Type, and put them into Weapon Name listbox. 

Keep in mind that not everything is perfectly represented in the API. For example, AV Grenades use the same Damage Resist Type as Rocket Launchers, but you will not see AV Grenades in the list if you search for that Damage Type.

You can click “Export List“, and a pop-up window will show, and you will be able to copy from it.

Note there are two “Find Weapons with that Damage Type” buttons,  one for Direct Damage, and one for Indirect Damage.

There are also two self-descriptive buttons “Find Units with Resistances to that Damage Type”. When clicked, the toolbox will provide you with a list of units, with the amount or resistance specified in brackets. You can export that list in a similar fashion.

If you have doubts whether the Toolbox correctly displays the Resistance relationship between your current target and weapon, you can click “Refresh Resistances” to make sure. You may want to do this if you manually change weapon’s Damage Resist Type for an experiment’s sake. 

Sometimes, the listboxes on this page will bug out, and won’t let you scroll down to the final element in the list. Blame Excel. You can temporarily fix this issue by clicking the “Fix Listboxes” button.

toolbox damage per minute DPM

For both Direct and Indirect Damage, the Toolbox will calculate Damage Per Minute (DPM). It will take Reload speed and Refire Time into account.

To get correct DPM numbers, you often have to manually edit some of the orange cells:

  • For tank cannons and other vehicle weapons, you should apply a Reload Speed Upgrade. Maximum value is usually 10%, but check in-game descriptions to be sure.
  • For Rocket Launchers, Lock-on Time and Charge Time (Lancer) are not calculated, so you’ll have to manually add them into Reload Time. Lancer’s charge damage is not available in the API either, so you’ll have to change Direct Damage manually as well.
  • DPM calculations don’t yet take into account “shotgun” weapons, such as NSX Masamune. Speaking of Masamune, it has an edgy reload mechanic in ADS mode.

Implants Page

This page will perform calculations for Implants. In order to function it requires statistical data on implant drop chances, such as this spreadsheet by RegulusMagnus. It is normally acquired by purchasing a ton of Deluxe Packs and Recycler on the Public Test Server, and writing down how many of each thing have you gotten.

Enter the data in orange boxes. Group Size column refers to number of implants in each rarity group. E.g. how many exceptional implants are there in total.

Then enter how many of Deluxe Packs and/or Recyclers you “buy”, and the spreadsheet will calculate how much will it cost, how many implants you will receive, what is their ISO-4 value, what are the chances that at least one of the dropped implants will belong to a certain rarity group, and what are the chances of getting a specific implant you want.


 

Known issues:

  • Sometimes an error pops up when reaching out to the API. Just try again whatever you were doing.
  • Resist Shield does not work yet. If you wish to make an analysis for the Resist Shield, simply add 35% Resistance to orange cells on the lower left.
  • The tool does not fully support charge up weapons, such as Lancer. You have to manually multiply the damage.
  • It will not calculate weapon’s TTK. 
  • It will not take into account rocket launcher indirect damage scaling.
  • Weapons’ faction isn’t always determined correctly. 
  • Damage values of Explosive Bolts, Typhoon Rocklets, Anti-Vehicle Grenades, C4 and Tank Mines are not accessible in the API. I have discovered their more or less precise damage values by in-game testing, and then hardcoded those values in the Toolbox. They will have to be manually updated if a patch changes them.
  • Damage for the Underbarrel Grenade Launcher is available in the API, but it’s formatted differently, so it was easier to hardcode its damage as well.
  • Other explosives, like Frag Grenades and Sticky Grenades simply do not work (yet). They could potentially get hardcoded as well.

Attachments Page

attachments toolbox page

This page stores a table with known effects of known attachments on all weapons. When you add attachments to weapons on other pages, this is where their effects are taken from.

To update the table, click “Pull Attachments“. A VBA Script will pull Names and Item IDs for all weapons from weapon categories on Categories Page, and then pull attachment data for them.

You can also double click on weapon’s name to open a JSON query for that weapon’s attachment list. This may be necessary if a weapon has access to atypical attachment, since the table is formatted only for known effects of known attachments.

Categories Page

This page has two functions. On the left, there is a list of weapon categories. The “Attachments” page will use this list to pull attachments for all weapons in these categories.

You can click “Pull Categories” to download a full list of Item Categories from the API, but then you will have to manually clean it up, and remove everything except infantry weapons, so the Attachments Page doesn’t get overloaded.

On the right, there is a similar list of weapon categories. For each weapon category there is a list of weapons in that category. This list is used by the “Resistances” page. To update this list, click “Pull Categories”, clean up the downloaded list, then copy paste it to the right and click “Pull Weapons”. Save, close and reopen the Toolbox so that changes take effect on the Resistances Page.

Temp Page

This is a temporary page for storing calculations results. You don’t need to interact with this page at all.

Changelog and To-Do

v1 – initial release.

v2 – added CoF import functionality and reworked Cone of Fire page. Special thanks to FISU. Weapon names also update when you add attachments.

v2a – added the ability to double click on weapon’s Item ID to open JSON queries. 

v2b – Pull Stats will also pull Falling CoF (for flying / jumping with Carbines). Falling CoF will also be imported into Cone of Fire page. Also fixed a bug that any value of 1 character long was not pulled from the API. 

v3 – The toolbox will now also pull ADS movespeed multiplier and other missing stats. Fixed several issues, minor improvements. 

v3a – Fixed a Reload Time export.

v3b – Added the button to pull  information about weapon’s projectiles.

v4a – Added functionality to download exact effects of weapon attachments and apply them to weapons. 

v4c – Cleaned up unnecessary code in order for the Toolbox to work with 64 bit version of Excel. Also fixed a minor bug with HVA on Damage page.

v4d – Downloaded weapon and attachment stats for latest patch, including NSX Tanto. 

v4c – Cleaned up unnecessary code in order for the Toolbox to work with 64 bit version of Excel. Again.

v4f – Stripped most of the functionality of the CoF Page, because it was based on the wrong Angular Size research. Added “CoF Bloom Per Point of Damage Done” instead. Also updated weapon stats for the latest patch. 

v5 – Added a second weapon to the Recoil Page. Added brand new “Resistances” page to calculate weapon damage to vehicles.

v5a – Resistance Page will now correctly display and apply Composite Armor to air units. 

v5b – added infantry and MAX defensive certifications.

v6 – added Built In Resistances Page. Reworked Resistances page, now it has increased performance and works completely differently behind the scenes, with more precision.

v6b – fixed a minor bug, removed remnants of unused code causing errors on some PCs.

v6c – fixed a minor bug related to resistances not updating properly. Fixed Blockade Armor not adding bonus HP.

v6d – hardcoded a few more weapons: UBGL, Explosive Bolts, Typhoon Rocklets. Added Engineer’s turrets. Added some more functionality to the Resistances page.

v6e – added damage-per-minute calculations to Resistances page. This feature was not thoroughly tested, so treat it as a beta.

v6f – added new weapons.

v6g – added new weapons (Flash / Doku BRs)

To Do

Determine if BASR time between shots = chamber time. Done.

Overall weapon rating based on multigon square calculations.

CoF / RoF probability distribution to determine weapon consistency (done in alpha)

Reword the horizontal recoil probability distribution graph to be more accurate

]]>
https://iridar-mirror.knyazev.io/toolbox/feed/ 0