THE MAN I INVENTED / Lead Programmer

Equipment framework

First-person sci-fi action survival · USC MFA thesis

Explore implementation and demos by engineering responsibility. Footage and captures show their recorded versions.

Equipment framework

Inheritance and extension

  1. Equipment base Equip / unequip · sockets
  2. Weapon base Shared weapon entry
  3. Firearm base Ammo · muzzle · abilities
  4. Concrete gun Extend unique behavior

AEquipmentBase owns equip/unequip, sockets and animation layers; AWeaponBase forms the weapon branch, and AFirearm adds ammo, muzzle and ability configuration. A subclass extends only its own behavior. For example, the Disintegration Gun adds its release effect after a shot while the same manager still handles equipment switching.

Equipment presentation and item data

Switchable equipment
  1. Character configures InitialEquipmentClasses
  2. Spawn AEquipmentBase actors
  3. Switch / hold / holster
Backpack items
  1. Character configures InitialInventoryItems
  2. Record item class and quantity
  3. HasItem permission check

The character configures InitialEquipmentClasses and InitialInventoryItems separately. The first holds AEquipmentBase subclasses: the equipment manager spawns actors and handles switching, holding and holstering. The second stores item classes and quantities without spawning held equipment actors. Access cards use the item path, take no weapon slot, and are checked by doors through HasItem.

Firearms and projectiles

  1. Firearm Ammo · muzzle · BulletClass
  2. Shared firing ability Launch current projectile
  3. Projectile Movement · collision · impact
  4. Target Own response

AFirearm holds ammo, fire interval, muzzle and BulletClass; GA_Shoot fires, while ABulletBase owns movement, collision and the hit entry point. A projectile extends the impact behavior. For example, the Explosion Gun reuses the shared firing path while its projectile handles attachment, delayed detonation and area damage.

Input, abilities and feedback

Left button · Fire and feedback
  1. PrimaryFire tag
  2. Primary ability invokes the firing path
  3. Projectile · muzzle · animation · shake · optional recoil
Right button
  1. SecondaryFire tag
  2. Current secondary ability
  3. Aim or another action

The character’s left and right buttons only send PrimaryFire and SecondaryFire tags to the ASC; the equipped gun grants its primary and secondary abilities. GA_Shoot reads that gun’s projectile and feedback settings, handling launch, muzzle effects, firing animation, sound, camera shake and optional view recoil within the same accepted shot. A new gun can configure its abilities, projectile and feedback to match its traits while reusing character input and the shared firing path; its projectile owns unique impact behavior.

Repair Gun · Left button fires repair rounds

The left button sends Input.Weapon.PrimaryFire. GA_Shoot reads the equipped Repair Gun’s projectile settings and fires a repair round. The same shot plays that gun’s configured muzzle effect, firing animation, sound and camera shake.

Explosion Gun · Left button fires explosive rounds

After switching to the Explosion Gun, the left button and GA_Shoot entry stay the same. The ability fires its configured projectile, while the explosive round handles attachment, delayed detonation and area damage.

Scoped rifle · Right button aims, left button fires

The right button sends Input.Weapon.SecondaryFire, activating the scoped rifle’s granted aim ability until release. The left button still fires through GA_Shoot. Aim and fire abilities can be configured separately without changing the character’s button bindings.

Granting and removing equipment abilities

The player ASC lives on PlayerState and persists across character switches. Equipment stores ability handles and a weak reference to the granting ASC when it grants primary fire, secondary fire, and reload. Unequip removes those abilities by handle and uses the saved ASC reference if the character can no longer provide one.

  1. 01

    Capture ownership on grant

    When equipment grants primary fire, secondary fire, and reload abilities, retain each ability handle and a weak reference to the granting ASC.

  2. 02

    Unequip before destruction

    EquipmentManager calls Unequip on the current item during EndPlay before destroying the inventory. If the character no longer supplies an ASC, removal falls back to the saved reference.

  3. 03

    Remove by handle & reset

    Remove the abilities granted by that item, cancelling secondary fire before clearing it. Reset the handles and cached ASC so the next equip starts a fresh grant cycle.

Design choices & limits

Keep the ASC persistent on PlayerState while each item manages the abilities it grants. Adding an EndPlay unequip call alone was insufficient because the character could already have lost its PlayerState; removal therefore needs the original grant reference. A weak reference does not extend ASC lifetime and is checked before use.