All pages
Powered by GitBook
2 of 3

TweakDB: Game database

Summary

Last documented update: Mar 26 by mana vortex

This page will tell you what the game's weak database is, and how you can use it to change or create game items.

Wait, that's not what I want!

  • For the beginners' guide, check How to YAML: Tweak modding basics

  • For another example, see How to change an NPC's record with Redscript: TweakXL: Changing game records

  • Or check the second half of New Iconic Weapon: Step by Step for explanations of weapon properties

What is the Tweak DB?

Cyberpunk 2077 uses a single static database file, which registers and defines gameplay elements.

You can find it under \r6\cache\tweakdb.bin

This file is not meant to be human-readable.

To create a new gameplay item, mod developers must add to the Tweak DB.

Browsing the TweakDB

See the child page Browsing the tweak database

TweakDB entries

TweakDB is only a huge list of records - entries defining everything that you can interact with in the game, from NPCs over weapons to (perhaps most familiar to most) clothing items.

You can see existing entries by browsing the .tweak under Cyberpunk 2077tools\redmod\tweaks (use a text editor such as Notepad++).

Data type: Record

A record is a collection of key-value pairs. Its nature is defined by the property $type. You can browse existing records in Wolvenkit's Tweak Browser, or use CET's Tweak Editor to look at the values in-game.

Example: Jackie Welles
Character.Jackie:
  $type: gamedataCharacter_Record
  actionMap: Gang.Map
  affiliation: Factions.Valentinos
  archetypeData: Character.valentinos_grunt1_ranged1_nue_ma_inline0
  archetypeName: humanoid
  audioMeleeMaterial: Flesh
  baseAttitudeGroup: jackie
  bountyDrawTable: Character.Jackie_inline7
  canHaveGenericTalk: True
  characterType: NPCType.Human
  communitySquad: Squad_Basic
  contentAssignment: DeviceContentAssignment.Autoscaling
  cpoCharacterBuild: ''
  crowdMemberSettings: Crowds.DefaultCrowdPackage
  defaultCrosshair: Crosshairs.NoWeapon
  despawnChildCommunityWhenPlayerInVehicle: True
  devNotes: Puppet Base! All other character records should inherit in a way form this record!
  disableDefeatedState: False
  dropsAmmoOnDeathChance: 1
  dropsControlledLoot: True
  dropsMoneyOnDeath: False
  dropsWeaponOnDeath: False
  enableSensesOnStart: True
  forceCanHaveGenericTalk: False
  forcedTBHZOffset: 0
  hasDirectionalStarts: True
  hideUIDetection: False
  hideUIElements: False
  holocallInitializerPath: ''
  ignoreDetectionForAudioCue: False
  isBumpable: False
  isChild: False
  isCrowd: False
  isLightCrowd: False
  lootBagEntity: valentinosDropBag
  lootDrop: LootTables.Empty
  lootInjectionParams: LootInjection.DefaultLootInjectionSettings
  minigameInstance: minigame_v2.DefaultMinigame
  primaryEquipment: Character.Jackie_inline2
  rarity: NPCRarity.Elite
  reactionPreset: ReactionPresets.NoReaction
  scannerModulePreset: ScanningNPCPresets.ScannerPreset_QuestNPCNoLevel
  secondaryEquipment: Character.Jackie_inline5
  sensePreset: Senses.Relaxed
  skipDisplayArchetype: True
  squadParamsID: FactionSquads.ValentinosSquad
  staticCommunityAppearancesDistributionEnabled: False
  threatTrackingPreset: TargetTracking.DefaultPreset
  uiNameplate: UINameplate.CombatSettings
  useForcedTBHZOffset: True
  voiceTag: jackie
  entityTemplatePath: base\quest\secondary_characters\jackie.ent
  priority: SpawnableObjectPriority.Quest
  savable: True
  abilities:
    - Ability.CanCrouch
    - Ability.CanSprint
    - Ability.CanSwitchWeapon
    - Ability.CanShootWhileMoving
    - Ability.CanPreciseShoot
    - Ability.CanChargedShoot
    - Ability.CanSmartShoot
    - Ability.CanUseLeftHand
    - Ability.CanUseRightHand
    - Ability.CanUseLegs
    - Ability.CanTaunt
    - Ability.CanCloseCombat
    - Ability.CanUseIncendiaryGrenades
    - Ability.IsBalanced
    - Ability.DealsThermalDamage
    - Ability.HasChargeJump
  attachmentSlots:
    - AttachmentSlots.WeaponRight
    - AttachmentSlots.WeaponLeft
    - AttachmentSlots.GrenadeRight
    - AttachmentSlots.GrenadeLeft
    - AttachmentSlots.Head
    - AttachmentSlots.Eyes
    - AttachmentSlots.Chest
    - AttachmentSlots.RightArm
    - AttachmentSlots.LeftArm
    - AttachmentSlots.RightHand
    - AttachmentSlots.LeftHand
    - AttachmentSlots.Legs
    - AttachmentSlots.PersonalLink
    - AttachmentSlots.Consumable
    - AttachmentSlots.Feet
    - AttachmentSlots.TppHead
    - AttachmentSlots.Torso
    - AttachmentSlots.Outfit
    - AttachmentSlots.UnderwearTop
    - AttachmentSlots.UnderwearBottom
    - AttachmentSlots.ItemSlotSniperRifle
    - AttachmentSlots.ItemSlotSMG
    - AttachmentSlots.ItemSlotTechRifle
    - AttachmentSlots.ItemSlotHandgunLeftJackie
    - AttachmentSlots.ItemSlotHandgunRightJackie
    - AttachmentSlots.ItemSlotKatana
    - AttachmentSlots.ItemSlotGenericMelee
    - AttachmentSlots.ItemSlotHammer
    - AttachmentSlots.ItemSlotKnifeRight
    - AttachmentSlots.ItemSlotKnifeLeft
    - AttachmentSlots.ItemSlotGenericRanged
    - AttachmentSlots.ItemSlotHandgunRight
    - AttachmentSlots.ItemSlotHandgunLeft
  bossHealthBarThresholds: []
  crowdAppearanceNames: []
  displayName: LocKey#34477
  EquipmentAreas: []
  fullDisplayName: LocKey#34478
  genders: []
  itemGroups:
    - Character.Enemy_Items_Base
  items: []
  onSpawnGLPs: []
  multiplayerTemplatePaths: []
  tags:
    - Immortal
  visualTags:
    - Valentinos
    - Grunt
    - Lvl1
  effectors:
    - Effectors.HitReactionTBHIncrease
  objectActions:
    - GenericInteraction.PickUpBody
    - GenericInteraction.Talk
    - GenericInteraction.ReturnTalk
    - Takedown.Grapple
    - Takedown.LethalTakedown
    - Takedown.NonLethalTakedown
    - Takedown.AerialTakedown
    - Takedown.BlackwallTakedown
    - Takedown.NewPerkFinisher
    - Takedown.NewPerkFinisherBlunt
    - Takedown.NewPerkFinisherBluntHold
    - QuickHack.RemoteBreach
    - QuickHack.SuicideHackBase
    - QuickHack.GrenadeHackBase
    - QuickHack.SystemCollapseHackBase
    - QuickHack.MadnessHackBase
    - QuickHack.BaseBlackWallHack
    - QuickHack.BaseOverheatHack
    - QuickHack.BaseContagionHack
    - QuickHack.OverloadBaseHack
    - QuickHack.BrainMeltBaseHack
    - QuickHack.BaseBlindHack
    - QuickHack.BaseWeaponMalfunctionHack
    - QuickHack.BaseLocomotionMalfunctionHack
    - QuickHack.BaseCyberwareMalfunctionHack
    - QuickHack.BaseCommsCallInHack
    - QuickHack.BaseCommsNoiseHack
    - QuickHack.BasePingHack
    - QuickHack.BaseMemoryWipeHack
    - QuickHack.BaseWhistleHack
    - MinigameAction.NetworkSuicideHack
    - MinigameAction.NetworkJamWeaponHack
    - MinigameAction.NetworkPingHack
    - MinigameAction.NetworkAutoJamHack
    - MinigameAction.NetworkAutoBlindHack
    - MinigameAction.NetworkAutoLocomotionHack
    - MinigameAction.NetworkWeakNPCs
    - MinigameAction.NetworkVulnerableNPCs
    - MinigameAction.NetworkMadnessHack
    - MinigameAction.NetworkWeaponMalfunctionHack
    - MinigameAction.NetworkCyberwareMalfunctionHack
    - MinigameAction.NetworkLowerICEMinorFirst
    - MinigameAction.NetworkLowerICEMinorSecond
    - MinigameAction.NetworkLowerICEMinorThird
    - MinigameAction.NetworkLowerICEMedium
    - MinigameAction.NetworkLowerICETutorial
    - MinigameAction.NetworkLowerICEMajor
  statModifierGroups:
    - Character.NPC_Base_Primary_Stat_ModGroup
  statModifiers:
    - QuickHack.TargetResistance_DifficultyMult
    - QuickHack.TargetResistanceUltimate_DifficultyMult
    - Character.valentinos_base_inline0
    - Character.Jackie_inline0
    - Character.Jackie_inline1
  statPools:
    - BaseStatPools.Puppet_Health_Base
    - BaseStatPools.Puppet_Stamina_Base
    - BaseStatPools.Fear
    - BaseStatPools.Poise
    - BaseStatPools.CPO_NPC_Importance
  weakspots: []
  alertedSensesPreset: Alerted
  combatSensesPreset: Combat
  relaxedSensesPreset: Relaxed
  weaponSlot: AttachmentSlots.WeaponRight

Data type: Flat

A flat is a key-value pair used by records.

characterType: NPCType.Human

characterType is the name of the property, wheras NPCType.Human is the assigned value. In this case, the syntax indicates an enum.

The Tweak DB can be interacted with using Cyberpunk's official REDmod, or numerous community solutions such as TweakXL, CET, and redscript.

  • Via tweak file: TweakXL

  • Via script: Cyber Engine Tweaks / redscript / Cyberpunk's official REDmod

For an explanation of the TweakDB, browse this section, or check TweakXL's github documentation.

Player Garments/Equipment Graph

The following is a diagram which maps the relationship between game files for use with TweakXL and Archive XL:

Enough theory, how do I modify the Tweak DB?

Check the tutorials linked under Wait, that's not what I want!

Browsing the tweak database

How to read the game's tweak database

Summary

Published: Jan 13 2024 by mana vortex Last documented edit: Jan 13 2024 by mana vortex

This page tells you how to browse the TweakDB. If you don't know what that is, you might want to read TweakDB: Game database first.

If you're looking for all tweak database entries of the type XYZ, you might be lucky to find a list under Cheat Sheet: Tweaks. If there isn't one, please make one once you have found what you're looking for!

Introduction

By browsing the TweakDB, you can inspect the game's database and change properties in real time.

To inspect the TweakDB, you have three options. This page will document each of them.

  • To explore the game's existing records, check Browsing the .tweak files (requires the REDmod DLC)

  • To fuck around and find out, check Editing values with Cyber Engine Tweaks

  • To create new tweak files, read The Wolvenkit Tweak Browser

A big part of tweak modding is exploration — poking through tweaks until you find just the right thing to copy or change, or looking for something specific in hundreds of files.

Editing values with Cyber Engine Tweaks

You can do this directly in your game. Changes will not persist if you restart, and sometimes you may have to reload for them to become active, but this is the fastest and most comfortable way to fuck around and find out.

For documentation of the TweakDB Editor, please refer to the Cyber Engine Tweaks wiki.

The Wolvenkit Tweak Browser

The easiest way to create tweaks is to use the Wolvenkit Tweak Browser. This will generate tweak files for you which contain the current record's properties, whether they're directly defined or inherited from other records.

For an example on how to do this, check Step 2: Choose the weapon and create an override from the New Iconic Weapon: Step by Step guide.

Example: Using the Wolvenkit Tweak browser

If you search for WilsonWeaponModAbility in the Wolvenkit Tweak Browser, you will find something like this:

Items.WilsonWeaponModAbility:
  $type: gamedataGameplayLogicPackage_Record
  stackable: False
  UIData: Items.WilsonWeaponModAbility_inline0
  animationWrapperOverrides: []
  effectors:
    - Items.WilsonWeaponModAbility_inline1
    - Items.WilsonWeaponModAbility_inline2
  items: []
  statPools: []
  stats: []

As it's next to impossible to understand the item's structure like this, check the next section about Browsing the .tweak files and Example: browsing .tweak files.

Browsing the .tweak files

You need the REDmod DLC for this.

In your game directory , find the subfolder tools\redmod\tweaks ("tweak folder"):

If these folders are missing, make sure that you have a valid REDmod REDmod

These folders contain a bunch of .tweak files, which you can open with a text editor of your choice. If you don't have one yet, here are your options:

  1. Notepad++ (free) This is fastest, and you can use this text editor for a lot of Cyberpunk modding. Press the hotkey Ctrl+Shift+F (Edit -> Find in Files) and search under the tweak folder.

  2. An IDE (e.g. Visual Studio Code (free), IntelliJ): This is the most comfortable. Simply open the tweak folder and use the built-in search (hotkey for VSCode: Ctrl+Shift+F) to find your way along the files.

  3. Agent Ransack (free) A command line search interface

Searching .tweak files with powershell

If you're just looking for occurrences of a certain string (e.g. all vendors), you can run the following powershell script from the tweaks directory:

# Which file should your findings be written to?
$outfile = "Output.txt"

# adjust this too - what you're looking for. Treated as regular expression
$searchString = '"BaseStats\.'

Clear-Content -Path $outfile

$UniqueFindList = [Collections.Generic.HashSet[string]]::new( [StringComparer]::InvariantCultureIgnoreCase )

Get-ChildItem -Recurse -Filter *.tweak | ForEach-Object {
	Get-Content $_.FullName | Select-String "$searchString" | ForEach-Object {
		$_.Line.Trim() -replace '^[^"]+"' -replace '^"' -replace '";?$' -replace '",.*$'
	} | Where-Object { $UniqueFindList.Add($_) }
} | Sort-Object | Out-File -FilePath "$outfile"

Example: browsing .tweak files

The example uses IntelliJ to look up a weapon record — Visual Studio Code is functionally identical.

This was initially a part of New Iconic Weapon: Step by Step, where you can also find explanations of various weapon properties.

In this example, we want to learn about Wilson's iconic gun and the effects of its WeaponMod. Check Wilson's iconic iron for the integrated version, or start searching:

Press Ctrl + Shift + F to open up the search dialog box and search for Preset_Lexington_Wilson.

You will find it in the following path:

tweaks/base/gameplay/static_data/database/items/weapons/ranged/handguns/lexington/preset_base_lexington.tweak
Preset_Lexington_Wilson, but in .tweak format.

This is the same tweak you'd find in the Tweak Browser, but it's much easier to read and understand.

To follow this weapon's iconic weapon mod, find the section where it is defined:

{
    slot = "AttachmentSlots.IconicWeaponModLegendary";
    itemPartPreset = "Items.WilsonWeaponMod";
}

This will take us to iconic_mods.tweak. The file holds WilsonWeaponModAbility with a bunch of statModifiers:

iconic_mods.tweak -> WilsonWeaponMod
WilsonWeaponMod : IconicWeaponModBase
{
    OnAttach = 
    [
       "Items.WilsonWeaponModAbility"
    ];
    statModifiers += 
    [
       {
          statType = "BaseStats.ReloadTimeBonus";
          modifierType = "Additive";
          value = -0.1f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.RecoilKickMin";
          modifierType = "Multiplier";
          value = 0.8f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.RecoilKickMax";
          modifierType = "Multiplier";
          value = 0.8f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.SpreadDefaultX";
          modifierType = "Multiplier";
          value = 0.66f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.SpreadMaxX";
          modifierType = "Multiplier";
          value = 0.66f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.HitDismembermentFactor";
          modifierType = "Multiplier";
          value = 3f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.HitWoundsFactor";
          modifierType = "Multiplier";
          value = 3.f;
       } : ConstantStatModifier, 
       {
          statType = "BaseStats.EffectiveRange";
          modifierType = "Multiplier";
          value = 0.75;
       } : ConstantStatModifier
    ];
    buyPrice = [];
    sellPrice = [];
}

… which aren't too different from the weapon modifiers. Let's ignore them for now and focus on the interesting part:

    OnAttach = 
    [
       "Items.WilsonWeaponModAbility"
    ];

Searching for this will take us to mods_abilities.tweak, which holds the information we care about.

mods_abilities.tweak
WilsonWeaponModAbility : IconicWeaponModAbilityBase
{
    UIData = 
    {
       iconPath = "ability_offensive";
       localizedDescription = "LocKey#50743";
    };
    effectors = 
    [
       {
          prereqRecord = "Prereqs.ProcessHitTriggered";
          percentMult = 0.25f;
          unitThreshold = 10f;
       } : MultiplyDamageWithVelocity, 
       {
          prereqRecord = "Perks.IsHitQuickMelee";
          value = 1.5f;
       } : MultiplyDamage
    ];
}

For an explanation of these properties, refer to Types of tweak records -> Effector.

To see how this file would look in the Tweak Browser (and why browsing the .tweak files is superior), check Example: Using the Wolvenkit Tweak browser.

Types of tweak records

Which kinds of tweak records exist? How are they defined? What do they mean?

Summary

Created: Jan 13 2024 by mana vortex Last documented update: Jan 13 2024 by mana vortex

This page lists types of tweak records with their properties and lists of occurrences in the wild. They are grouped by type. If this wiki has more information, there will be a link at the start of the block.

This is a work in progress, as the tweak database is huge and barely-documented. If you have any information that needs to be in here, please don't hesitate to sign up as an editor and start contributing!

If you just want a quick overview of a certain type of tweak, you can check Cheat Sheet: Tweaks instead.

If you want to learn how to make tweaks instead, check How to YAML: Tweak modding basics

Adding content

Please keep entries in the following format (you can copy e.g. Effector below):

Entry explanation
Heading 1: Section - Group records by type(s)

Heading 2: Name of tweak type
A brief description of what it does, and a .tweak snippet (syntax: swift). 
If you know any guides or resources using this kind of tweak, add an info box with links.

Heading 3: Properties
A table: propertyName => explanation

Heading 3: Existing <name of tweak type>
A table with name of tweak type and a brief description of what it does

Conditionals

Condition

A wrapper of Prereq with additional finetuning.

For more information on this, check the New Iconic Weapon: Step by Step guide (Creating a custom condition)

# Condition to check if attack type is ranged
Conditions.Is_Attack_Ranged:
  $type: gamedataHitPrereqCondition_Record
  invert: False
  onlyOncePerShot: True
  type: Prereqs.AttackType
  attackType: Ranged

Properties

Property name
Property explanation

invert

trigger when the condition is not met?

onlyOncePerShot

Limit this to one procc per bullet?

type

A Prereq — not the same as $type!

attackType

finetuning of type

Existing conditions

Effector name
Effector explanation

Perks.IsHitTargetAlive_inline2

Is the current target alive?

Perks.HitIsBodyPartHead_inline0

Is the current hit a headshot?

Effector

An effector is the tweak version of an if-condition: it is using Conditions or Prereqs before triggering its effect.

mods_abilities.tweak
{
    prereqRecord = "Prereqs.ProcessHitTriggered";
    percentMult = 0.25f;
    unitThreshold = 10f;
} : MultiplyDamageWithVelocity, 
{
    prereqRecord = "Perks.IsHitQuickMelee";
    value = 1.5f;
} : MultiplyDamage

For more information on this, check the New Iconic Weapon: Step by Step guide: Wilson's iconic iron Designing effectors

Properties

Property name
Property explanation

prereqRecord

a Prereq to check if the effector should become active

unitThreshold

a lower bound for the condition

percentMult

for a multiplier: multiply by percentage (0.25 => 125%)

value

the numeric value (1.5 => 150%)

Existing effectors

Effector name
Effector explanation

MultiplyDamageWithVelocity

Will multiply damage by percentMult (if the velocity is > unitThreshold)

MultiplyDamage

Will multiply damage by value

Prereq

The prerequisite for e.g. an Effector.

You can find a full list under Cheat Sheet: Prereqs

For more information on this, check the New Iconic Weapon: Step by Step guide (Creating a custom prereq)

Item modifiers

StatModifier

This type of record adds a quality to an item, modifying its stats.

Qualities

Set an item's quality via statModifier. To

Quality.Random

Qualities in descending order:

Quality.IconicItem
Quality.LegendaryPlus
Quality.Legendary
Quality.EpicPlus
Quality.Epic
Quality.RarePlus
Quality.Rare
Quality.UncommonPlus
Quality.Uncommon
Quality.CommonPlus
Quality.Common

BaseStats

These entries will start with BaseStats., e.g. BaseStats.ReloadTimeBonus.

Unless specified otherwise, these are numeric (multipliers/additions).

You can find a full list under Cheat Sheet: Base Stats, and a list of weapon stats with explanations under Cheat Sheet: Weapon BaseStats