-
-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: creatures revision #3263
base: main
Are you sure you want to change the base?
fix: creatures revision #3263
Conversation
Currently, creature attacks ignore group cooldowns. The changes implement spell grouping, and if multiple spells from the same group are selected, one will be chosen at random.
src/creatures/monsters/monster.cpp
Outdated
const Position &myPos = getPosition(); | ||
const Position &targetPos = attackedCreature->getPosition(); | ||
|
||
std::map<uint32_t, std::vector<const spellBlock_t*>> groupSpells; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you do this "grouping" when inserting in mType->info.attackSpells, just order the spells at the end of the insertion. Well, I believe that would be it, I analyzed it superficially.
This suggestion is to mitigate the cost of always creating a map with a vector every time doAttacking is executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you do this "grouping" when inserting in mType->info.attackSpells, just order the spells at the end of the insertion. Well, I believe that would be it, I analyzed it superficially.
This suggestion is to mitigate the cost of always creating a map with a vector every time doAttacking is executed.
The isLifeless functionality has been reintroduced, along with a new flag to ensure that spells cast using the old method remain unaffected. My optimization expertise is limited, so any assistance or suggestions for improvement would be greatly appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, you just need to check if you have the hasGroupedSpells flag and sort the attackSpells by group.
I think it would be here:
registerMonsterType.attacks = function(mtype, mask)
if type(mask.attacks) == "table" then
// maybe
if mask.hasGroupedSpells then
// order by spell group logic
end
for _, attack in pairs(mask.attacks) do
mtype:addAttack(readSpell(attack, mtype))
end
end
end
It's better to ask for help from someone who understands this part, I'm not very familiar with Canary.
or even do it directly in c++, it's better to look for the best approach with someone who understands this part that registers monsters through lua.
src/creatures/monsters/monster.cpp
Outdated
attackTicks = 0; | ||
} | ||
const auto &attackedCreature = getAttackedCreature(); | ||
if (!attackedCreature || (isSummon() && attackedCreature.get() == this)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove isLifeless?
#3186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing lifeless in simultaneous attacks can be make a multiple dies of creatures ... its cannot be remmoved or nedded remake this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove isLifeless? #3186
Oops, I'll fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it will take some time to be ready, considering that all creatures will be reviewed, I will create a new flag for the creatures
hasGroupedSpells = true,
We check it in the cpp, if it is not there we will continue with the old damage logic. I am making these adjustments and at the same time publishing the changes to the creatures on my live server, this way people can already take advantage of the changes and give the necessary feedback.
But what's the problem with this? In Tibia RL, they usually always cast 2 spells together. I'm leveling hours in rl and I noticed this when I wanted to copy spells to put them in my ot. |
Currently, the damage system feels inconsistent, as there’s a possibility for a creature to cast all its spells simultaneously. For example, a Soul War boss could potentially one-shot a player. At the moment, spells are designed based on interval and chance, but with this new solution, we can increase the spell chances while ensuring turns are properly organized. This adjustment will make hunts more balanced and enjoyable. |
…tion The combat logic has been updated to a functional state, though not fully optimized yet. A flag was also introduced for creatures using the new spell system: monster.flags = { hasGroupedSpells = true, } This ensures that existing creatures will continue to attack using the original logic.
…tibia/canary into creatures-revision-project
Bro, it cannot be solved using mana in the monsters, or limiting the number of spells to be casted together? Just thinking about it.. |
That's the idea, the limitation of attacks per turn. Creatures that have the new flag hasGroupedSpells = true in this PR will respect the turns |
…tibia/canary into creatures-revision-project
Bashmu Juvenile Bashmu Girtablilu Warrior Venerable Girtablilu Skeleton Elite Warrior Undead Elite Gladiator
…tibia/canary into creatures-revision-project
Falcon Paladin Falcon Knight
…tibia/canary into creatures-revision-project
Quality Gate passedIssues Measures |
Flimsy Lost Soul Freakish Lost Soul Mean Lost Soul
…tibia/canary into creatures-revision-project
Quality Gate passedIssues Measures |
Is that right, after the demons get updated with this they cannot use the spells in the attackgroup at the same time? But I did read Falcon Paladin can use only 1 ranged attack at a time, so that creature needs spell groups for example. |
Description
EN: The goal of this project is to fix creature behavior to ensure compliance with ability grouping (spell groups) and to conduct a complete review of all creature aspects: experience (XP), health points (HP), corpses and decay, abilities, damage, loot, dialogues, resistances, and more. The aim is to deliver a more balanced, coherent, and engaging experience for players.
PT: O objetivo do projeto é corrigir o comportamento das criaturas para que respeitem o agrupamento de habilidades (spell groups) e realizar uma revisão completa de todos os aspectos das criaturas: experiência (XP), pontos de vida (HP), corpos e decaimentos (corpse/decay), habilidades, danos, loots, falas, resistências, entre outros. A proposta é oferecer um conteúdo mais balanceado, coerente e envolvente para os jogadores.
Behaviour
Actual
EN: Currently, in Canary, creature spells have individual intervals and chances, which can result in multiple spells (e.g., 4 or 5) being executed simultaneously without respecting group logic. This creates inconsistencies compared to the correct behavior, where spells within the same group should compete against each other. Additionally, aspects of creatures such as loot, spells, damage, HP, XP, dialogues, resistances, corpses, and decay times have not been thoroughly reviewed, leading to imbalances.
PT: Atualmente, no Canary, as magias das criaturas possuem intervalos e chances individuais, o que pode resultar na execução simultânea de várias magias (ex.: 4 ou 5), sem respeitar um agrupamento. Isso gera inconsistências em relação ao comportamento correto, onde magias do mesmo grupo devem competir entre si. Além disso, aspectos das criaturas, como loot, magias, danos, HP, XP, falas, resistências, corpos e tempos de decaimento, não foram completamente revisados, levando a desequilíbrios.
Expected
EN: The goal is to fix creature behavior so that their spells are grouped, ensuring only one spell from each group is executed based on group rules. Furthermore, a comprehensive review of all creature aspects will be conducted, including loot, spells, damage, HP, XP, dialogues, resistances, corpses, and decay times, ensuring consistent balancing aligned with the intended gameplay.
PT: O objetivo é corrigir o comportamento das criaturas para que suas magias sejam agrupadas e apenas uma magia de cada grupo seja executada com base nas regras do agrupamento. Além disso, realizar uma revisão abrangente de todos os aspectos das criaturas, incluindo loot, magias, danos, HP, XP, falas, resistências, corpos e tempos de decaimento, garantindo um balanceamento consistente e alinhado com a proposta de jogo.
Type of change
Please delete options that are not relevant.
How Has This Been Tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist