Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SMGCommunity/Petari/llms.txt

Use this file to discover all available pages before exploring further.

The player subsystem is the largest and most complex subsystem in Petari. It is split across roughly sixty headers under include/Game/Player/ and covers everything from raw physics integration to animation blending, power-up transformations, wall climbing, swimming, tornado spinning, and camera interaction. The central class is MarioActor, which extends LiveActor and owns a Mario object that handles moment-to-moment physics and state transitions.
MarioActor is about 0xFD0 bytes in size and aggregates multiple sub-modules. When reading decompiled code, check Mario.hpp for low-level physics state and MarioActor.hpp for the top-level lifecycle and draw methods.

Core classes

MarioActor inherits LiveActor and is the object registered with the scene graph. It manages health, player mode (normal, bee, ice, fire, etc.), model switching, effect playback, and the game-over state machine.
class MarioActor : public LiveActor {
public:
    MarioActor(const char*);

    virtual const TVec3f& getLastMove() const;
    virtual void getFrontVec(TVec3f*) const;

    void init(const JMapInfoIter&);
    void control();
    void movement();

    // Health management
    void decLife(u16);
    void incLife(u32);
    void changeMaxLife(s32);

    // Power-up state
    void initBeeMario();
    void initIceMario();
    void initFireBall();
    void initTornadoMario();
    void shootFireBall();
    void doFreezeAttack();
    bool trySpinPunch();
    bool isEnableSpinPunch();

    // Spin / rush attack
    bool doRush();
    void endRush(const RushEndInfo*);

    // Gravity helpers
    TVec3f& getGravityVec() const;
    void updateGravityVec(bool, bool);
    bool isInZeroGravitySpot() const;
    f32 getGravityRatio() const;

    // State query
    bool isJumping() const;
    bool isPunching() const;
    bool isDamaging() const;
    bool isStaggering() const;
    bool isRequestSpin() const;

    u32 mHealth;       // 0x380
    u32 mWaterLife;    // 0x384
    u32 mMaxHealth;    // 0x3E0
    u16 mPlayerMode;   // 0x3D4
    Mario* mMario;     // 0x230
    MarioAnimator* mMarioAnim;  // 0x234
    MarioEffect* mMarioEffect;  // 0x238
    MarioConst* mConst;         // 0x23C
    TornadoMario* mTornadoMario;// 0x98C
    bool mSuperKinokoCollected; // 0xEE8
    bool mPowerupCollected;     // 0xEE9
    bool mTransforming;         // 0xEEA
    BlackHole* mBlackHole;      // (member near 0xF4C)
};
Mario extends MarioModule and is the physics brain of the player. It holds position, velocity, movement direction vectors, all wall/ground collision state, and every movement sub-module as a pointer member. The MovementStates bitfield tracks boolean physics flags such as jumping and digitalJump.
class Mario : public MarioModule {
public:
    Mario(MarioActor*);

    virtual bool postureCtrl(MtxPtr);

    void update();
    void actionMain();
    void mainMove();
    void checkGround();
    void updateGroundInfo();

    // Jump variants
    void tryJump();
    void tryTurnJump();
    void trySquatJump();
    void tryBackJump();
    void tryTornadoJump();
    void trySpinJump(u8);
    void tryWallJump(const TVec3f&, bool);
    void tryStickJump(const TVec3f&);

    // Damage / hazard reactions
    void damage(const TVec3f&);
    void damageLarge(const TVec3f&);
    void doFireDance();
    void doParalyze();
    void doFreeze();
    void doAbyssDamage();

    // State management
    void changeStatus(MarioState*);
    u32 getCurrentStatus() const;

    struct MovementStates {
        unsigned jumping    : 1;  // bit 0
        unsigned turning    : 1;  // bit 3
        unsigned debugMode  : 1;  // bit 22
        unsigned digitalJump: 1;  // bit 30
        // ... additional reserved bits
    };

    /* 0x130 */ TVec3f mPosition;
    /* 0x160 */ TVec3f mVelocity;
    /* 0x1C0 */ TVec3f mStickPos;
    /* 0x1D8 */ TVec3f mAirGravityVec;
    /* 0x1F0 */ TVec3f mHeadVec;
    /* 0x208 */ TVec3f mFrontVec;
    /* 0x310 */ TVec3f mSideVec;
    /* 0x488 */ f32 mVerticalSpeed;
    /* 0x758 */ MarioWall* mWall;
    /* 0x768 */ MarioStick* mStick;
    /* 0x8A0 */ MarioMove* mMove;
    /* 0x884 */ MarioSwim* mSwim;
    /* 0x7C0 */ MarioDamage* mDamage;
};
Every discrete movement mode (walk, swim, hang, slide, etc.) is a MarioState. Each state reports whether it is active and can react to wall hits, polygon contacts, and ring passes.
class MarioState : public MarioModule {
public:
    MarioState(MarioActor*, u32);

    virtual void init();
    virtual bool proc(u32);
    virtual bool start();
    virtual bool close();
    virtual bool update();
    virtual bool notice();
    virtual bool keep();
    virtual bool postureCtrl(MtxPtr);
    virtual void hitWall(const TVec3f&, HitSensor*);
    virtual void hitPoly(u8, const TVec3f&, HitSensor*);
    virtual bool passRing(const HitSensor*);
    virtual f32 getBlurOffset() const;

    u32 getNoticedStatus() const;

    MarioState* _8;
    u32 mStatusId;  // 0xC
};
MarioMove specializes MarioState to handle running and walking on surfaces.
class MarioMove : public MarioState {
public:
    MarioMove(MarioActor*);
    void initAfter();
};

Movement sub-modules

The Mario object aggregates a large set of specialized sub-modules, each responsible for one movement mode. All inherit MarioModule.

MarioSwim

Underwater swimming physics, water entry/exit detection, and water-damage timer.

MarioSlider

Slide mechanics activated on slope surfaces flagged with the slider floor code.

MarioHang

Hanging from ledges and ceiling grips, including back-hang and side-hang checks.

MarioClimb

Wall-climbing on climbable surfaces, vertical movement, and jump-off transitions.

MarioWall

Wall-stick detection, wall-run state, and position correction against wall geometry.

MarioDamage

Normal damage reaction: stagger animation, invincibility timer, and life decrement.

MarioFireDamage / MarioFireDance

Fire-based hazard reactions: catching fire, running in panic, and the fire dance anim.

MarioFreeze

Ice freeze encasement state with thaw animation and break-out timing.

Player sub-module list

The full Player/ directory includes the following headers (selected):
HeaderPurpose
MarioActor.hppTop-level player LiveActor
Mario.hppPhysics core and state dispatch
MarioState.hppAbstract base for all movement states
MarioMove.hppGround movement
MarioSwim.hppSwimming
MarioHang.hppHanging from ledges
MarioClimb.hppClimbable wall movement
MarioSlider.hppSlide on slopes
MarioSkate.hppIce skating
MarioWall.hppWall-stick and wall-run
MarioDamage.hppStandard damage reaction
MarioFireDamage.hppFire hazard reaction
MarioFireDance.hppOn-fire animation state
MarioFreeze.hppIce encasement
MarioCrush.hppCrush / press-down death
MarioParalyze.hppElectric paralysis
MarioStun.hppStun reaction
MarioBlown.hppBlow-back from explosion
MarioFaint.hppFaint / flip reaction
MarioAbyssDamage.hppAbyss / fall-out-of-bounds death
MarioDarkDamage.hppShadow / dark matter damage
MarioWarp.hppWarp pipe and cube-warp transitions
MarioRecovery.hppRecovery bubble warp-back
MarioFlip.hppFlip / back-roll reaction
MarioSideStep.hppSide-step dodge
MarioFrontStep.hppFront-step reaction
MarioStick.hppStar-pointer sticky bind
MarioRabbit.hppRabbit / Boo-ray mode
MarioTeresa.hppBoo Mario transformation
MarioFoo.hppBee Mario state
MarioSukekiyo.hppSpecial movement variant
TornadoMario.hppTornado spin move
FireMarioBall.hppFireball projectile owned by Mario
MarioAnimator.hppAnimation controller
MarioEffect.hppParticle effect manager
MarioConst.hppTuning constants (speeds, timers)
MarioMessenger.hppCross-system message dispatch
GhostPlayer.hppLuigi ghost playback
MarioConst centralizes all tunable numeric parameters such as walk speed, jump velocity, and gravity ratio. When analysing decompiled movement code, cross-reference member reads against MarioConst offsets to understand what each scalar controls.

Build docs developers (and LLMs) love