Skip to content

Added 'instance unbind' command to bots#2146

Draft
trolloks wants to merge 3 commits intomod-playerbots:test-stagingfrom
trolloks:feature/instance-unbind
Draft

Added 'instance unbind' command to bots#2146
trolloks wants to merge 3 commits intomod-playerbots:test-stagingfrom
trolloks:feature/instance-unbind

Conversation

@trolloks
Copy link
Copy Markdown
Contributor

@trolloks trolloks commented Feb 16, 2026

Pull Request

While testing raid strategies i found it cumbersome to keep manually clearing instance locks for every one of my altbots.

I checked the codebase and found two things:

  • There is an undocumented command called refresh=raid, but this seems to be only single target.
  • I found the factory function called UnbindInstance, which gets called on rndbots quite often.

I added a command that just directly calls UnbindInstance via a whisper or party/raid chat to streamline this requirement.


Design Philosophy

We prioritize stability, performance, and predictability over behavioral realism.
Complex player-mimicking logic is intentionally limited due to its negative impact on scalability, maintainability, and
long-term robustness.

Excessive processing overhead can lead to server hiccups, increased CPU usage, and degraded performance for all
participants. Because every action and
decision tree is executed per bot and per trigger, even small increases in logic complexity can scale poorly and
negatively affect both players and
world (random) bots. Bots are not expected to behave perfectly, and perfect simulation of human decision-making is not a
project goal. Increased behavioral
realism often introduces disproportionate cost, reduced predictability, and significantly higher maintenance overhead.

Every additional branch of logic increases long-term responsibility. All decision paths must be tested, validated, and
maintained continuously as the system evolves.
If advanced or AI-intensive behavior is introduced, the default configuration must remain the lightweight decision
model
. More complex behavior should only be
available as an explicit opt-in option, clearly documented as having a measurable performance cost.

Principles:

  • Stability before intelligence
    A stable system is always preferred over a smarter one.

  • Performance is a shared resource
    Any increase in bot cost affects all players and all bots.

  • Simple logic scales better than smart logic
    Predictable behavior under load is more valuable than perfect decisions.

  • Complexity must justify itself
    If a feature cannot clearly explain its cost, it should not exist.

  • Defaults must be cheap
    Expensive behavior must always be optional and clearly communicated.

  • Bots should look reasonable, not perfect
    The goal is believable behavior, not human simulation.

Before submitting, confirm that this change aligns with those principles.


Feature Evaluation

Please answer the following:

  • Describe the minimum logic required to achieve the intended behavior?
  • Describe the cheapest implementation that produces an acceptable result?
  • Describe the runtime cost when this logic executes across many bots?

How to Test the Changes

  • Step-by-step instructions to test the change
  • Any required setup (e.g. multiple players, bots, specific configuration)
  • Expected behavior and how to verify it

Complexity & Impact

Does this change add new decision branches?

    • No
    • Yes (explain below)

Does this change increase per-bot or per-tick processing?

    • No
    • Yes (describe and justify impact)

Could this logic scale poorly under load?

    • No
    • Yes (explain why)

Defaults & Configuration

Does this change modify default bot behavior?

    • No
    • Yes (explain why)

Bots respond to 'instance unbind' command

If this introduces more advanced or AI-heavy logic:

    • Lightweight mode remains the default
    • More complex behavior is optional and thereby configurable

AI Assistance

Was AI assistance (e.g. ChatGPT or similar tools) used while working on this change?

    • No
    • Yes (explain below)

If yes, please specify:

  • AI tool or model used (e.g. ChatGPT, GPT-4, Claude, etc.)
    Copilot

  • Purpose of usage (e.g. brainstorming, refactoring, documentation, code generation)
    Translation

  • Which parts of the change were influenced or generated
    The translations for bot messages added to the db script

  • Whether the result was manually reviewed and adapted
    Unable to review, since i don't speak those languages

AI assistance is allowed, but all submitted code must be fully understood, reviewed, and owned by the contributor.
Any AI-influenced changes must be verified against existing CORE and PB logic. We expect contributors to be honest
about what they do and do not understand.


Final Checklist

    • Stability is not compromised
    • Performance impact is understood, tested, and acceptable
    • Added logic complexity is justified and explained
    • Documentation updated if needed

Notes for Reviewers

Anything that significantly improves realism at the cost of stability or performance should be carefully discussed
before merging.

@trolloks trolloks marked this pull request as ready for review February 16, 2026 07:18
@Wishmaster117
Copy link
Copy Markdown
Contributor

Hi, thanks for the PR, if merged please add MultiBot Need Update tag

@Dreathean Dreathean added Requires WIKI update The wiki documentation needs to updated the changes in the PR Multibot requires update labels Feb 16, 2026
@Dreathean
Copy link
Copy Markdown
Collaborator

Very nice and convenient

Comment thread src/Ai/Base/Actions/TrainerAction.cpp Outdated
public:
InstanceUnbindAction(PlayerbotAI* botAI) : Action(botAI, "instance unbind") {}
bool Execute(Event event) override;
};
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.

I think such commands should be executable only by GM

@trolloks trolloks requested a review from kadeshar February 19, 2026 07:06
@trolloks
Copy link
Copy Markdown
Contributor Author

NOTE: Hold off on this PR until securiy level change is merged

INSERT INTO `ai_playerbot_texts`
(`name`, `text`, `say_type`, `reply_type`,
`text_loc1`, `text_loc2`, `text_loc3`, `text_loc4`,
`text_loc5`, `text_loc6`, `text_loc7`, `text_loc8`)
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.

Check file 2026_01_31_00_ai_playerbot_multi_pvp_text_variables.sql
Script require DELETE + INSERT should have id
Also missing INSERT to ai_playerbot_texts_chance

Comment on lines +270 to +279
Player* master = GetMaster();
if (!master || master->GetSession()->GetSecurity() < SEC_GAMEMASTER)
{
std::string error = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"instance_unbind_gm_error", "You must be a GM to use instance unbind", {});
botAI->TellError(error);
return false;
}
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"instance_unbind_response", "I'm unbinding instances", {});
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.

Im not sure about that. Such checks should be in isPossible or isUseful not in Execute

return true;
}

bool InstanceUnbindAction::Execute(Event event)
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.

mark unused event parameter with /event/

@kadeshar kadeshar marked this pull request as draft March 24, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Multibot requires update Requires WIKI update The wiki documentation needs to updated the changes in the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants