Skip to content

Match Kabokuri - #1982

Merged
ThatNintendoNerd merged 25 commits into
SMGCommunity:masterfrom
NextOp-Next:Kabokuri
Aug 19, 2026
Merged

Match Kabokuri#1982
ThatNintendoNerd merged 25 commits into
SMGCommunity:masterfrom
NextOp-Next:Kabokuri

Conversation

@NextOp-Next

@NextOp-Next NextOp-Next commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Draft PR to indicate I'm working on it. Currently matched but has a data swap.

PR includes incompatible changes in pf_entry, I assume it's due to an unfortunate pull during GitHub's outage today? I wouldn't know how to fix it.

Conflict has been resolved.

@decomp-dev

decomp-dev Bot commented Aug 17, 2026

Copy link
Copy Markdown

Report for RMGK01 (7dfccae - b3db674)

📈 Matched code: 66.29% (+0.09%, +5068 bytes)
📈 Matched data: 30.90% (+0.04%, +588 bytes)

✅ 54 new matches
Unit Item Bytes Before After
main/Game/Enemy/Kabokuri Kabokuri::init(const JMapInfoIter&) +728 0.00% 100.00%
main/Game/Enemy/Kabokuri .data +362 23.38% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::addVelocityToRailPoint(float) +332 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::updatePose() +280 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeHitAttacked() +272 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::attackSensor(HitSensor*, HitSensor*) +244 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::receiveMsgPlayerAttack(unsigned long, HitSensor*, HitSensor*) +208 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeBreak() +192 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::isEnableTrampled() const +188 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeWalk() +168 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::initSensor() +164 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::requestHitAttacked(HitSensor*, HitSensor*) +128 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeTrampled() +128 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeHipDropped() +128 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::isEnablePointBind() const +128 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeDropFire() +120 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::addVelocityBase() +112 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeWait() +108 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::isEnableAttack() const +108 0.00% 100.00%
main/Game/Enemy/Kabokuri __sinit_\Kabokuri_cpp +108 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeAttacksuccess() +104 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::exeStarPieceHitted() +104 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::calcAndSetBaseMtx() +96 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::requestHipDropped() +92 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::tryPointBind() +92 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::isEnablePush() const +88 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::control() +84 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::requestStarPieceHitted() +84 0.00% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::Kabokuri(const char*) +78 41.64% 100.00%
main/Game/Enemy/Kabokuri Kabokuri::requestTrampled() +76 0.00% 100.00%

...and 24 more new matches

📈 6 improvements in unmatched items
Unit Item Bytes Before After
main/RVL_SDK/vf/pf_fat16 VFiPFFAT16_ReadFATEntryPage +318 22.24% 93.26%
main/RVL_SDK/vf/pf_fat16 VFiPFFAT16_WriteFATEntryPage +44 76.53% 86.16%
main/RVL_SDK/vf/pf_fat16 VFiPFFAT16_WriteFATEntry +38 74.97% 99.74%
main/RVL_SDK/vf/pf_fat16 VFiPFFAT16_ReadFATEntry +12 83.81% 87.30%
main/RVL_SDK/vf/pf_fat32 VFiPFFAT32_WriteFATEntryPage +11 96.90% 99.03%
main/RVL_SDK/vf/pf_fat32 VFiPFFAT32_ReadFATEntryPage +8 97.72% 99.48%

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
Comment on lines +150 to +151
TVec3f* gravity = &mGravity;
mFrontVec.scaleAdd(-gravity->dot(mFrontVec), *gravity, mFrontVec);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern should be mFrontVec.orthogonalize(mGravity); ignore if not matching.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
MR::initDefaultPos(this, rIter);
initRailRider(rIter);
MR::moveCoordAndTransToNearestRailPos(this);
MR::makeQuatAndFrontFromRotate(&_9C, &mFrontVec, this);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_9C can be named mRotationQuat or similar

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
mKuribo->makeActorDead();

// "Broken model"
_90 = MR::createModelObjMapObjStrongLight("壊れモデル", "KabokuriBreak", getBaseMtx());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_90 can be named mBreakModel

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
Comment on lines +159 to +167
TVec3f* upVec;
if (MR::isBindedGround(this)) {
upVec = const_cast< TVec3f* >(MR::getGroundNormal(this));
} else {
TVec3f v2 = -mGravity;
upVec = &v2;
}

MR::blendQuatUpFront(&_9C, *upVec, mFrontVec, ::sUpVecBlendRate, ::sFrontVecBlendRate);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this logic be rewritten with an inline ternary? instead of *upVec, MR::isBindedGround(this) ? MR::getGroundNormal(this) : -mGravity

Comment thread include/Game/Enemy/Kabokuri.hpp Outdated
/* 0xAC */ TVec3f mFrontVec;
/* 0xB8 */ u32 _B8;
/* 0xBC */ bool mIsFloating;
/* 0xBD */ u8 _BD;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bool, and can be named mIsAttachedToRail or something similar. Make sure to update assignments to use boolean values

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
#include "Game/Util/RailUtil.hpp"
#include "Game/Util/SoundUtil.hpp"
#include "Game/Util/StarPointerUtil.hpp"
#include "revolution/types.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary include

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated

Kabokuri::Kabokuri(const char* pName)
: LiveActor(pName), mKuribo(nullptr), _90(nullptr), mAnimeScale(nullptr), _98(nullptr), _9C(0.0f, 0.0f, 0.0f, 1.0f), mFrontVec(0.0f, 0.0f, 1.0f),
_B8(-1), _BD(0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value arguments can be left blank (in this case _BD())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary, considering _BD (now mWillGenerateFire) is a bool (initialized to false)? Isn't being explicit better in ctors?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of it like invoking the default constructor for a class or struct. It's the same notation.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
mAnimeScale = new AnimScaleController(nullptr);
mAnimeScale->setParamTight();

_98 = new WalkerStateBindStarPointer(this, mAnimeScale);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_98 can be renamed to mStateBindStartPointer for consistency with other Kuribo files

Comment thread src/Game/Enemy/Kabokuri.cpp
Comment thread include/Game/Enemy/Kabokuri.hpp Outdated
/* 0x98 */ WalkerStateBindStarPointer* mStateBindStartPointer;
/* 0x9C */ TQuat4f mRotationQuat;
/* 0xAC */ TVec3f mFrontVec;
/* 0xB8 */ u32 _B8;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type should be s32 considering ctor default is -1

@NextOp-Next

Copy link
Copy Markdown
Contributor Author

Requested changes should be addressed.

@NextOp-Next
NextOp-Next marked this pull request as ready for review August 18, 2026 08:34
Comment thread include/Game/Enemy/Kabokuri.hpp Outdated
class Kabokuri : public LiveActor {
public:
Kabokuri(const char*);
virtual ~Kabokuri();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably remove the declaration and definition of the destructor in favor of the compiler-generated destructor, assuming the new order of the function matches the target object file.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
Comment on lines +121 to +124
return;
}

makeActorAppeared();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to just use an else if statement here.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
MR::reboundVelocityFromCollision(this, 0.0f, 0.0f, 1.0f);
}

void Kabokuri::addVelocityToRailPoint(f32 vel) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be clearer to name the parameter speed, since speed is a scalar, but velocity is a vector. The function uses speed to add to velocity.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated

Kabokuri::Kabokuri(const char* pName)
: LiveActor(pName), mKuribo(nullptr), _90(nullptr), mAnimeScale(nullptr), _98(nullptr), _9C(0.0f, 0.0f, 0.0f, 1.0f), mFrontVec(0.0f, 0.0f, 1.0f),
_B8(-1), _BD(0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think of it like invoking the default constructor for a class or struct. It's the same notation.

Comment thread include/Game/Enemy/Kabokuri.hpp Outdated
/* 0xBC */ bool mIsFloating;

/// @brief Generates fire on every point of the rail reached, except the first one.
/* 0xBD */ bool mWillGenerateFire;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mIsValidDropFire might be more in line with developer verbiage.

@NextOp-Next

Copy link
Copy Markdown
Contributor Author

Requested changes should be addressed.

@ThatNintendoNerd ThatNintendoNerd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor oversights from my initial pass. After correcting these two things, should be ready to merge.

Comment thread src/Game/Enemy/Kabokuri.cpp Outdated
static const f32 sNormalFreq = 0.9f;
static const f32 sNormalGravity = 0.2f;
static const f32 sRailCoordStepInterval = 50.0f;
static const u32 sWaitTime = 60;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be s32.

Comment on lines +5 to +8
class AnimScaleController;
class WalkerStateBindStarPointer;
class Kuribo;
class ModelObj;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Organize alphabetically.

@NextOp-Next

Copy link
Copy Markdown
Contributor Author

Should be good to go!

@ThatNintendoNerd
ThatNintendoNerd merged commit c6367aa into SMGCommunity:master Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants