Skip to content

Visuals

Roman Chistokhodov edited this page Sep 26, 2024 · 4 revisions

Overview and reasoning

Originally in Half-Life the sprites, models and the parameters they're drawn with (like color, alpha value, etc.) are explicitly defined in the game code. This means that without changing the code the mod author can't, for example, change the color of alien controller's projectiles or parameters of vortigaunt's beams.

Featureful SDK introduces a concept of visuals which allows to modify some parameters without digging into the game code. Entities refer to visuals that can be defined in the outer file - templates/visuals.json. Each visual has a name that entities use to refer to them. Visuals define a set of properties related to rendering like the sprite/model in use, the render mode, the color and others.

Example:

{
    "Vortigaunt.ZapBeam": {
        "color": [242, 0, 213],
        "alpha": 200,
        "sprite": "sprites/xsmoke3.spr",
        "noise": 40,
        "width": 60
    },
    "Bullsquid.Spit": {
        "sprite": "sprites/e-tele1.spr",
        "scale": 0.25,
        "rendermode": "Additive",
        "alpha": 180,
        "renderfx": "Constant Glow",
        "framerate": 15.0
    }
}

This redefines the look of vortigaunts's zap beams and bullsquid's spit sprite. If some parameters are omitted, the default ones are used. This allows to configure only certain aspects of the visuals without a need for providing all parameters.

Format of visuals.json

The document is an object where each property presents a visual. Each entry in the document may have the following properties:

  • model - the model or sprite used by a visual.
  • sprite - a synonym for model.
  • rendermode - a render mode. Possible values: "Normal", "Color", "Texture", "Glow", "Solid", "Additive". As a mapper you should be familiar with render modes.
  • color - a render color.
  • alpha - render amount (opacity/brightness).
  • renderfx - a render special effect. Possible values: "Normal", "Constant Glow" (can be used with "Glow" render mode).
  • scale - a scale of model/sprite. 1.0 is normal scale.
  • framerate - the animation framerate. 0 means no animation. Animated sprites usually use 10.0 as framerate.
  • width - how wide the beam is. The integer number between 1 and 255. Used by beams only.
  • noise - the amplitude of the beam. The integer number between 0 and 255. Used by beams only.
  • scrollrate - the scroll rate of the beam. The integer number between 0 and 255. Used by beams only.
  • life - the life (in seconds) of beams, dynamic/entity lights and some temporary sprites.
  • radius - the dynamic/entity light radius. Used by some dynamic or entity lights.

Some parameters are applied only to certain types of visuals (e.g. beam specific parameters are used by beams only). Defining these parameters has no effect if the visual doesn't use them.

Debugging

If you're unsure about applied visual properties, you can check them by the dump_visuals command in the console (the developer mode must be enabled and some map should be loaded).

  • Type dump_visuals to get all currently registered visuals and their properties (so e.g. if there were no Garg on a map, his visuals won't be shown).
  • Provide arguments to get only the visuals you're interested in, e.g. dump_visuals Vortigaunt.ZapBeam Vortigaunt.PowerupBeam.
  • If the provided argument ends with . the command will show all visuals starting with this string. E.g. dump_visuals Vortigaunt. Bullsquid. prints all registered visuals which names start with Vortigaunt. and Bullsquid..

Shared visuals

Some visuals act as a base for others. It means that through customization of the base visual you provide customized parameters for those visuals that depend on the base one. E.g Houndeye.WaveBase defines beam parameters (except the color) for Houndeye.Wave1, Houndeye.Wave2, Houndeye.Wave3 and Houndeye.Wave4 which define their own color on top of the base parameters. This is done to ease the configuration of some visuals. The developer still has the right to decide to configure parameters of each derived visual separately, e.g. provide a different sprite for each kind of houndeye's wave.

The list of entity visuals

All names are case-insensitive. For example Houndeye.WaveBase and houndeye.wavebase refer to the same visual.

NPC

monster_alien_slave

  • Vortigaunt.PowerupBeam - beams produced on attack powerup.
  • Vortigaunt.PowerupLight - dynamic light emitted on attack powerup.
  • Vortigaunt.ZapBeam - attack zap beam.
  • Vortigaunt.RevivalBeam - revival beam.
  • Vortigaunt.IdleBeam - temporary beams occasionally played when vortigaunt is idle.
  • Vortigaunt.IdleLight - dynamic light occasionally emitted when vortigaunt is idle.
  • Vortigaunt.CoilBeam - ring beam produced on the coil attack.
  • Vortigaunt.HandGlow - sprites appearing on vortigaunt's hands when he uses range attacks or boosted melee attack.
  • Vortigaunt.MeleeTrailBeam - beam trail emitted from arms when vortigaunt uses a melee attack and has some spare energy.
  • Vortigaunt.SummonBeam - beams produced on summon animation.
  • Vortigaunt.SummonSprite - sprite of the summoning effect.
  • Vortigaunt.SummonLight - dynamic light emitted on summoning effect.
  • Vortigaunt.ChargeToken - charge token sprite.
  • Vortigaunt.ChargeTokenLight - entity light emitted from the charge token sprite.

Shared visuals:

  • Vortigaunt.ZapBeamColor - color shared by Vortigaunt.ZapBeam, Vortigaunt.RevivalBeam, Vortigaunt.SummonBeam, Vortigaunt.CoilBeam and Vortigaunt.HandGlow.
  • Vortigaunt.ArmBeamColor - color shared by Vortigaunt.PowerupBeam, Vortigaunt.IdleBeam and Vortigaunt.MeleeTrailBeam.
  • Vortigaunt.BeamLightColor - color shared by Vortigaunt.PowerupLight, Vortigaunt.IdleLight and Vortigaunt.SummonLight.

monster_alien_controller

  • Controller.EnergyBall - energy balls attached to arms of the controller.
  • Controller.HeadOpenLight - entity light emitted when the controller's head gets open before the headball attack.
  • Controller.HeadShootLight - entity light emitted when a controller shoots its headball projectile.
  • Controller.EnergyBallLight - entity light emitted from the controller's arms when it changes/resets its energy ball brightness.
  • Controller.ZapBall - energy balls coming from arms.
  • Controller.HeadBall - big energy ball from the controller's head.
  • Controller.HeadBallBeam - a temporary beam produced when the headball hits the target.
  • Controller.HeadBallLight - entity light emitted from the headball as it travels.

Shared visuals:

  • Controller.EnergyBallBase - sprite, color and alpha shared by Controller.EnergyBall, Controller.HeadBall and Controller.ZapBall.
  • Controller.EnergyBallLightBase - color shared by Controller.HeadOpenLight, Controller.HeadShootLight and Controller.EnergyBallLight.

Notes:

  • Controller.ZapBall customizations are also applied to projectiles spawned by env_energy_ball_trap.

monster_alien_grunt

Uses visuals of hornet.

monster_apache

  • Apache.RocketTrail - apache rocket trailing beam.

monster_babygarg

  • BabyGarg.Eye - eye sprite. Note: as brightness of the eye dynamically changes, the alpha of the visual means the maximum brightness.
  • BabyGarg.FlameBig - wider part of the flame (reddish by default). Derived from Garg.FlameBig with the smaller beam width.
  • BabyGarg.FlameSmall - narrower part of the flame (bluish by default). Derived from Garg.FlameSmall with the smaller beam width.
  • BabyGarg.FlameLight - entity light emitted on each flame update. Derived from Garg.FlameLight without changes.
  • BabyGarg.Stomp - sprites emitted by the stomp attack.

monster_bigmomma

  • BigMomma.Mortar - the spit projectile.
  • BigMomma.MortarSpray - sprite spray that comes from Big Momma when launching the spit projectile and when this projectile touches the wall.

monster_bullchicken

  • Bullsquid.TinySpit - sprites sprayed out of bullsquid mouth on spit attack.
  • Bullsquid.Spit - the spit projectile sprite.
  • Bullsquid.Fleck - sprites sprayed on the spit projectile impact with the wall.
  • Bullsquid.ToxicTinySpit - sprites sprayed out of bullsquid mouth on toxic spit attack.
  • Bullsquid.ToxicSpit - the toxic spit projectile sprite.
  • Bullsquid.ToxicFleck - sprites sprayed on the toxic spit projectile impact with the wall.
  • Bullsquid.ToxicParticle - sprites emitted from the toxic spit projectile as it flies. Note: currently can't be animated.

Shared visuals:

  • Bullsquid.TinySpitBase - defines a sprite used by Bullsquid.TinySpit, Bullsquid.ToxicTinySpit, Bullsquid.Fleck and Bullsquid.ToxicFleck.

Notes:

  • Spit customizations are also applied to env_blowercannon.

monster_gargantua

  • Garg.Eye - eye sprite. Note: as brightness of the eye dynamically changes, the alpha of the visual means the maximum brightness.
  • Garg.FlameWide - wider part of the flame (reddish by default).
  • Garg.FlameNarrow - narrower part of the flame (bluish by default).
  • Garg.FlameLight - entity light emitted on each flame update.
  • Garg.Stomp - sprites emitted by the stomp attack.

Shared visuals:

  • Garg.FlameBase - alpha and beam scrollrate used by Garg.FlameBig and Garg.FlameSmall.

monster_houndeye

  • Houndeye.Wave1 - wave visual used when houndeye is not in squad.
  • Houndeye.Wave2 - wave visual used when houndeye is in squad of 2.
  • Houndeye.Wave3 - wave visual used when houndeye is in squad of 3.
  • Houndeye.Wave4 - wave visual used when houndeye is in squad of 4 or more.

Shared visuals:

  • Houndeye.WaveBase - sprite, life, beam parameters and alpha used by Houndeye.Wave1, Houndeye.Wave2, Houndeye.Wave3 and Houndeye.Wave4.

Note: when customizing the wave color you usually want to configure it for each wave, for the consistent looks.

monster_turret

  • Turret.Glow - the turret sprite (red by default).

Projectiles

hornet

  • Hornet.Trail - trail beam of the projectile (red by default).
  • Hornet.TrailAlt - trail beam of the alternative a bit faster projectile (orange by default).
  • Hornet.Puff - sprite that appears sometimes when hornet is close to the enemy.

Shared visuals:

  • Hornet.TrailBase - sprite, alpha, beam parameters and life used by Hornet.Trail and Hornet.TrailAlt.

rpg_rocket

  • RPG.Trail - trailing beam.

World objects

env_energy_ball_trap

  • ZapTrap.EnergyBall - the sprite of the trap. Derived from Controller.HeadBall.