Working on an MMORPG automation project and need help with ability rotation logic
I’m building a game bot in C++ and having trouble with the spell casting sequence algorithm. The main challenge is executing character abilities in the optimal order based on their cooldowns and cast times.
Here’s what I’m working with:
struct Ability {
string abilityName;
int cooldownTime; // milliseconds
int castingTime; // milliseconds
bool isReady;
};
// Example character setup
Ability playerAbilities[3] = {
{"FireBolt", 800, 400, true},
{"IceSpear", 1200, 600, true},
{"Lightning", 1800, 750, true}
};
The bot needs to determine which ability to use next based on availability and timing. Right now I can randomly pick available spells, but I want to create a proper rotation system that maximizes efficiency.
The number of abilities varies per character (anywhere from 2 to 10 skills). I need an algorithm that considers both cooldown timers and casting durations to build an optimal sequence.
Any suggestions for implementing this kind of priority system? I’m interested in this as a programming challenge rather than actual gameplay.