top of page

FILE AND FOLDER STRUCTURE

FILE ANd Folder Structure Crash Course

RPGB_MedievalWeapons

  • Root folder for the entire plugin

  • All assets are following asset naming conventions recommended by Epic Games

  • For larger folders (materials, textures), you can use the search bar on top of the content browser to filter for assets you are looking for.

Blueprints

  • Contains all if the logical elements of the plugin. Blueprint Actors, Components, Enumerators, Structures etc. Most notably BP_RPGB_WeaponMaster - the master blueprint all of the weapons inherit from.

Snip_FolderStructure0.jpeg

Curves

  • Contains curves that drive dynamic material parameter changes

Maps

  • Contains

    • MAP_RPGB_DemoMap - a level where you can preview the plugin's blueprint functionality

    • MAP_RPGB_PreviewMap - a level where you can preview all of the plugin's static meshes, ordered by weapon class and variation

Materials

  • Contains Master Material referenced by all derived material instances

  • Material functions used in the Master Material

  • Master material instances for each type of surface (iron, steel, wood etc.)

  • Material instances used by the individual static meshes

Meshes

  • All of the static meshes used by the weapons

MAKING WEAPONS

Snip_WeaponMaster00.jpeg

The master blueprint driving weapon generation is BP_RPGB_WeaponMaster (master blueprint), contained in the Blueprints folder. To temporarily preview it's functionality, drag a single instance into your level and work with the instance.

Snip_WeaponMasterClassDefaultsButton.jpeg

You can also make permanent changes in the class defaults tab inside blueprint editor. Changes made to the master BP class defaults inside blueprint editor will propagate to all of the child weapon blueprints, unless they expressly override these values.

RPGB_12_Greatsword_Detail.png

PUBLIC (instance editable) Variables

Runtime

  • Simulates Physics enables physics simulation

  • Runtime Dynamic Materials enables functions to dynamically change weapon's wear and tear at runtime

  • Runtime Dynamic Test sets up the weapon up in a way, so you can preview it's wear and grunge levels changing while in play-simulate mode

Construction

  • F_Contruct calls the main construction function that normally runs in construction script

  • New Random Seed

    • While set to true in the weapon's class defaults, the weapon will generate new random seed each time the construction script is executed (weapon gets spawned)

    • If the weapon is instanced within play level, clicking on the checkbox generates new random seed and reconstructs the weapon

  • Random Seed current random seed governing the weapon's attributes

    • Random seed can be input directly into this field

    • Random seed is only considered in those parts of construction, that have their value set to "Generated"

Weapon Naming

The plugin has the ability to generate appropriate, variable aware name for your weapon

  • Weapon Name string - can either be randomly generated or custom set in the class defaults

  • Use generated name if set to true, the Weapon Name will be overwritten by generated name on construction

 

  • Descriptor Usage

    • By max value will include description of weapon's wear and tear status based on it's most visually prominent value (wear or grunge)

    • Do not use will exclude this part of the naming logic

 

  • Weapon Class Usage

    • Random will choose from list of possible names based on the weapon's type (Longsword can be named "Longsword", "Broadsword" or "Bastard Sword")

    • First index only will only choose index 0 of said list (Longswords will only be named "Longsword")

Snip_DetailsWeaponName.jpeg
  • Material Part Usage

    • None will exclude weapon's material from naming logic

    • Any other option from the list will automatically pick relevant part based on the weapon's class (blades for swords, grips for staffs etc.)

 

  • Use Prefix/Suffix if set to true, it will include loot list based prefixes or suffixes in the naming logic (Soldier's, Knight's, Undead Lord's etc.)

Choosing weapon class

Snip_DetailsWeaponClass.jpeg
  • Weapon Class Inclusion List is an array of weapon classes that the generation logic has to pick

    • If populated, weapons classes not on this list will never be spawned.

    • Inclusion list is still governed by Weapon Class List weights - make sure that if you add entries to the array, weapons on this list have non-zero weights assigned in your selected loot list.

    • By default it should be blank

  • Weapon Class Exclusion List - weapon classes that can never be spawned

    • If you never intend to use certain types of weapons (your game doesn't have spears), populate this list in the class defaults of the master blueprint

    • You can use this in combination with the inclusion list to narrow the spread of weapon types without diving into the loot lists.

    • Exclusion list supersedes the inclusion list

  • Weapon Class List references Loot List Component that governs weighted weapon class generation (chance that weapons with certain classes will spawn)

 

 

  • Weapon Class Generation Rule

    • Generated will randomly pick weapon class based on used loot list, considering inclusion and exclusion list rules

    • Direct Set will let you override weapon class by changing Weapon Class directly

  • Weapon Class - current weapon class

    • if generation rule is set to Generated, this is set by the construction script

    • if generation rule is set to direct set, use this to change your weapon's class

  • Weapon Family is not currently used by anything, but it can be used to set family wide preferences for different types of weapons if you choose to implement it (e.g all swords doing slashing damage while all hammers do blunt)

PICKING WEAPON PARTS

Apart from randomly generating weapons, the plugin allows you to hand-pick their parts.

Weapons consist of these weapon parts:

  • Head (blade for swords)

  • Grip

  • Guard (swords only)

  • Grip Detailing (e.g. leather wrapping)

  • Head Detailing (Mauls and Mallets only)

At the core of this functionality is a dynamic, persistent array of structures - Weapon Part Prefs

  • On instanced weapons, the array only ever fills with references to relevant weapon parts based on the weapon's class (no empty indexes)

  • The array persists it's data across construction iterations (changes to other parameters)

Snip_DetailsWeaponParts.jpeg
  • Index corresponds with the order in which the parts are generated

  • Weapon part field is automatically filled by the construction script

  • Generation Rule

    • Generated will conform the weapon part's variation to the random generation rules

    • Direct Set allows you to pick this part's variation (static mesh) manually

  • VariationIndex

    • if Generation rule is set to Generated, this field is auto filled by the construction script

    • if Generation rule is set to Direct Set, you can use this field to map the weapon part variation directly

      • Variation index is clamped to the number of variations available for this weapon part based on the weapon's class

      • Setting variation index to -1 will remove this part's static mesh and mark the weapon component for deletion

Choosing Materials

Snip_DetailsMaterials.jpeg

Going a step deeper, the plugin also allows you to handpick material variations for individual weapon parts.

The plugin automatically assigns correct material instances  for these material types according to weapon parts:

  • Head, Guards, Grip detailing, Head detailing

    • Iron

  • Head

    • Weapon Steel

    • Weapon Steel_Gold

    • Damascus Steel

  • Guard, Grip Detailing

    • DecorSteel_Rough

    • DecorSteel_Polished

    • DecorSteel_RoughGold

    • DecorSteel_PolishedGold

  • Grip and Grip Detailing

    • DecorSteel_Brushed

    • DecorSteel_BrushedGold

    • Wood_White

    • Wood_Gray

    • Wood_Orange

    • Wood_Mahagony

    • Leather_DarkRed

    • Leather_Brown

    • Leather_Black

Material distribution is driven by a dynamic, persistent array of structures - Material Prefs

  • On instanced weapons, the array only ever fills with references to relevant weapon parts based on the weapon's class (no empty indexes)

  • The array persists it's data across construction iterations (changes to other parameters)

 

  • Generated materials conform to their own exclusion rule set:

    • Examples:

      • if iron is chosen as sword's blade, the generator will never pick steel for it's other metallic parts

      • weapons won't combine different kinds of leather together

    • material exclusion rule set can be changed by editing default entries in F_RPGB0_MaterialExclusionDatabase, located in the Blueprints folder.

    • Weapon parts with their material Generation Rule set to Direct Set do not conform to this rule set

  • Weapon part field is automatically filled by the construction script

  • Generation Rule

    • Generated will conform the weapon part's material type to the random generation rules

    • Direct Set allows you to pick this part's material type manually

  • Material type

    • if Generation rule is set to Generated, this field is auto filled by the construction script

    • if Generation rule is set to Direct Set, you can use this field to map the weapon part's material variation directly

      • If invalid material type is manually chosen for a weapon part (wood for sword blade), the material reverts to it's generated variation

  • Material Instance holds a reference to this part's assigned dynamic material instance

    • Double clicking the material instance will open it's material instance editor. Navigating to it's parent section will take you to the static material instance which can then be edited

Adding Wear and Tear

Weapon's Wear and Tear is driven by two separate controls:

  • Wear Alpha governs mechanical damage to the material's surface resulting from general use, such as scratches and dents.

    • Defined as a float in range 0-3

    • 0 - Brand New - never used

    • 1 - Lightly Worn - represents normal amount of wear resulting from daily use

    • 2 - Moderately Worn - fairly used with little to no maintenance (soldier on prolonged campaign)

    • 3 - Heavily Worn - unkempt with no maintenance

RPGB_36_MaterialDynamic_DetailHatchets.png
  • Grunge Alpha governs environmental damage such as rust for metals, mold for wooden parts and old vs new leather for leather parts

    • Defined as a float in range 0-4

    • 0 - Pristine - Nobles, some knights - no rust levels

    • 1 - Well Maintained - knights, some soldiers - some blackening on steel blades, very light dirt on wooden surfaces

    • 2 - Poorly maintained - peasants, some soldiers - rust starts to form up, wood is visibly grungy

    • 3 - Battered - brigands, some peasants - rust is plainly visible, wood and leather look worn out

    • 4 - Ancient - Undead variations - completely rusty, wood is either very dirty or moldy, leather is heavily damaged

Snip_WearTear.jpeg
  • Wear and Tear List references loot list class that holds information on how worn should the weapons appear

  • Material Interpolation Speed governs the speed at which the materials change their wear and grunge level at runtime. Lower number results in slower change, 0 sets the speed to instant

  • Wear and Tear Generation Rule

    • Generated lets the Wear and Tear List assign wear and grunge levels based on Random Seed

    • Range Set lets you pick Wear And Grunge level manually, but sets the actual value within the defined range according to random seed

    • Direct Set allows you to set Desired Alpha levels directly, and sets Wear and Grunge level according to their defined ranges.

The plugin is quite complex and writing understandable documentation takes considerable amount of time. I am adding to this daily, if i am not working on the plugin itself. please, bare with me :)

I look forward to seeing what you create with my assets! Want to keep in touch? Join our discord, and if you'd like to support my work and gain access to exclusive content, please consider supporting me on Patreon. Happy developing!

PATREON:
Patreon Logo
UNREAL MARKETPLACE:
Unreal Engine Logo
DISCORD:
Discord Logo
bottom of page