Files
TeslaRel410/restoration/source410/BT/MYOMERS.HPP
T
CydandClaude Fable 5 02b78eadc7 BT410 5.3.111: the myomers drive -- and runSpeedMax's writer is found in the muscles
Myomers::MyomersSimulation (@004b8d18) reconstructed, five blocks in the
binary's order, and it answers a question left open since 5.3.94:

  runSpeedMax (+0x7a0) IS WRITTEN BY THE MYOMERS.  Each myomer's
  RegisterMaxOutput (@004b8ef0) raises the mech's run-cycle cap to its
  full-throttle AvailableOutput -- so the mech's true top speed is a
  property of its MUSCLE ASSEMBLY, and it degrades live as heat crosses the
  degradation band and as the myomer's own zone accumulates damage.  The
  1e9 ctor sentinel now stands only until the first myomer registers.

The drive computation (@004b8ac0): base = the mech base speed
(reverseStrideLength, mech+0x34C) scaled by the gear ratio -- input voltage
over the RECOMMENDED gear -- with a quadratic thermal bleed across the
degradation band, zero past failure, and the subsystem's wear taken off the
top.  speedEffect republishes per frame as a 0..1 fraction of full drive:
input clamped to the SELECTED gear then the top gear, through
AvailableOutput, normalised by the base speed.

AND THE MUSCLES HEAL: while a myomer has NO VOLTAGE and its zone is not
destroyed, it hands its own zone a NEGATIVE explosive tick (-0.011,
0xbc343958) -- unloaded muscle knits itself back together.  The donor's
history records this block as the fix for "torso twist dead after respawn"
(the Torso mirrors this subsystem's electrical level; with the base machine
never running, a myomer that lost power in the death window sat at
NoVoltage forever) -- and our runs respawn now, so the fix is live where it
matters.

Registered on the master (the sibling gate); the base electrical machine
runs FIRST and unconditionally, per the donor's hard-learned ordering note.
Not carried over: the port's BT_FORCE_SEEK / repair-test bench scaffolding.

Live run clean; the gait's speed sequence is unchanged (7.31972, 26.6726,
...) -- the muscle cap sits above the demanded 26.9 on a healthy Mad Cat,
exactly as it should.

Stub census: 18 across 12 files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 22:27:00 -05:00

131 lines
4.2 KiB
C++

//===========================================================================//
// File: myomers.hpp //
// Project: BattleTech Brick: Mech subsystems //
// Contents: Myomers -- the artificial-muscle (locomotion power) subsystem //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(MYOMERS_HPP)
# define MYOMERS_HPP
# if !defined(POWERSUB_HPP)
# include <powersub.hpp>
# endif
//##################### Forward Class Declarations #######################
class Mech;
//###########################################################################
//#################### Myomers Model Resource ##########################
//###########################################################################
struct Myomers__SubsystemResource:
public PoweredSubsystem::SubsystemResource
{
Scalar velocityEfficiency;
Scalar accelerationEfficiency;
Scalar seekVoltage[5];
int seekVoltageRecommendedIndex;
};
//###########################################################################
//############################## Myomers ###############################
//###########################################################################
class Myomers:
public PoweredSubsystem
{
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
typedef void
(Myomers::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
static Logical
TestClass(Mech &);
Logical
TestInstance() const;
void
MyomersSimulation(Scalar time_slice);
public:
typedef Myomers__SubsystemResource SubsystemResource;
Myomers(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data = DefaultData
);
~Myomers();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute publication. The shipped binary's string pool lists this
// class's attribute names contiguously, immediately after the class name
// "Myomers" and its ToggleSeekVoltage message:
//
// SpeedEffect CurrentSeekVoltageIndex RecommendedSeekVoltageIndex
// MinSeekVoltageIndex MaxSeekVoltageIndex SeekVoltage
//
// -- which is EXACTLY the order of the members below, so the
// reconstruction's layout matches the original and the ids can be
// pinned faithfully rather than guessed. SpeedEffect is the one an
// authored AttributeWatcher in BTL4.RES binds (the myomer whine).
//
public:
enum {
SpeedEffectAttributeID = PoweredSubsystem::NextAttributeID,
CurrentSeekVoltageIndexAttributeID,
RecommendedSeekVoltageIndexAttributeID,
MinSeekVoltageIndexAttributeID,
MaxSeekVoltageIndexAttributeID,
SeekVoltageAttributeID,
NextAttributeID
};
static const IndexEntry AttributePointers[];
static AttributeIndexSet AttributeIndex;
public:
//
// The drive computation (@004b8ac0): the locomotion output available
// for an input voltage -- the mech base speed scaled by the gear
// ratio, degraded by heat past the degradation band and by the
// subsystem's own accumulated zone damage.
//
Scalar
AvailableOutput(Scalar input_voltage);
//
// Raise the owner mech's run-speed cap to this myomer's full-throttle
// output (@004b8ef0) -- idempotent max(), the binary calls it from
// the assembly loop.
//
void
RegisterMaxOutput();
protected:
Scalar speedEffect;
int currentSeekVoltageIndex;
int recommendedSeekVoltageIndex;
int minSeekVoltageIndex;
int maxSeekVoltageIndex;
Scalar seekVoltage[5];
Scalar heatRange;
Scalar heatRangeSquared;
Scalar velocityEfficiency;
Scalar accelerationEfficiency;
};
#endif