Todd Nelling
  • Projects
    • Skylanders: SWAP Force
    • Hex Game
    • Chroma
    • Monster Munchies
  • Individual Levels
    • Night of Fear
    • Battle for Genosha
    • Morph Ball Madness
    • Unreal Kart
  • Scripting
    • UnrealScript
    • Lua
    • Hammer I/O
    • Unreal Kismet
    • TESScript
  • About Me/Resume
  • Downloads

Hammer I/O for Morph Ball Madness


Picture
Outputs from the game_ui, which remaps the controls to accommodate the unique gameplay of Morph Ball Madness



Example: UI/Controls

Morph Ball Madness required a major overhaul of the controls in Half-Life 2.  This game_ui detects various inputs from the player and fires relays that correspond to the numerous events that the different inputs require. 

Picture
Outputs from the logic_relay that controls the primary fire function
Picture
Outputs from the logic_relay that controls the alternate fire function
Picture
Dropping a bomb







UI/Controls: Bombs

The player has two different types of bombs in Morph Ball Madness.  The primary fire (left click) drops a bomb that detonates immediately, while the alternate fire (right click) drops a bomb on a 1 second timer.

The player moves in a separate plane from the visual portion of the level, consisting of invisible clip brushes.  Since the player's collision is taller than the spherical remote, this allows the player to move through the level without getting stuck on small passages.

However, this means that the player can't use grenades normally in order to drop a bomb, since they would not spawn in the correct location.  Instead, these relays spawn npc_grenade_frags from templates.

Since grenades spawned from templates (instead of thrown as normal weapons) are not "live", these relays set their timers immediately after spawning them in order to activate them.

The relays also disable themselves, while enabling countdown timers, in order to throttle the rate at which the player can drop bombs.  

UI/Controls: Movement

Movement in Morph Ball Madness includes rotating the remote in the correct direction, jumping, using magnetic rails (ladders), and boosting off the magnetic rails.

The spherical remote prop_dynamic is parented to a func_rotating that allows it to spin.  The game_ui detects what direction the player is moving, and tells the func_rotating to rotate either forwards or backwards, depending on whether the remote is going to the right or the left.

A set of trigger_pushes enable boosting off of magnetic rails (ladders), since the player cannot normally jump off of ladders in Half-Life 2.  These triggers are parented to the player, so that they can be activated no matter where the player is.

Since the game_ui does not detect the spacebar, the configuration files included with the level remap the spacebar to fire a relay that controls the jumping/boosting functionality.  When the player jumps, several logical tests are run:

  • If the player is on a ladder, and is pushing left or right, the corresponding directional trigger_push is briefly enabled
  • If the player is on a ladder, and is not pushing to the left or right, the vertical trigger_push is briefly enabled
  • If the player is not on a ladder, the "+jump" console command is fired, causing the player to jump normally

The combination of a 2D camera and ladders presents an additional problem.  In order for the player to descend a ladder in Half-Life 2, they must look down.  Since the player cannot pan the camera in Morph Ball Madness, they cannot look down.  Thus, all movement directions, including down (back), are interpreted as moving UP the ladder.

To solve this, when the player presses down, a trigger_push is briefly enabled that pushes the player down.  This is why the remote 'hops' off of a ladder when the player presses down: the player briefly climbs the ladder before the trigger pushes them downward, knocking them off the ladder.

Picture
Outputs from the logic_relay that controls what happens when the player moves to the left
Picture
Outputs from the logic_relay that controls what happens when the player stops moving to the left
Video clip showing the movement mechanics in Morph Ball Madness, including rotation, jumping, attaching to rails, and boosting off rails

Picture
Inputs to the math_counter used for tracking the remote's health
Picture
Energy tanks are automatically consumed when the remote has 0 health and a status of "Critical"


Example: Health System

Morph Ball Madness uses a special camera to create a fixed side-view perspective.  However, camera entities in Half-Life 2 disable the player's ability to take damage.  Thus, Morph Ball Madness has a substitute health system.

This math_counter acts as a substitute for normal player health.  The PlayerCollision trigger is parented to the remote, and detects incoming Combine fire.  Triggers parented to the sparks and Rollermines, but located in the player's movement plane, tell the counter when the player has touched a damaging element.

Morph Ball Madness has a bracketed, regenerating health system.  The player regenerates health within a bracket, but cannot return to a higher bracket.  When the health counter reaches 0, it tells the health bracket tracker to subtract 1, and resets itself to 25 (its maximum value).

There are 4 brackets: "Operational", "Weakened", "Damaged", and "Critical".  If the health counter reaches 0 while the bracket counter is at "Critical", the remote explodes.  If the player has collected an energy tank, the player's health is instead reset to full, and the bracket returns to "Operational".

A logic_timer fires every .1 seconds to check the value of the health bracket counter, and refreshes the text displaying the remote's shield status. 

Powered by Create your own unique website with customizable templates.