[engine] Support for daze UtBS, new keys

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
adisae
Posts: 1
Joined: October 12th, 2020, 2:51 pm

[engine] Support for daze UtBS, new keys

Post by adisae »

Hello guys,

It surprise me that a lot of changes in Wesnoth mainline, :shock:, may be because I playing and modifying add-ons too much :oops: :mrgreen:

Recently I try to play UtBS again in 1.14.14 and out of curiosity try to peek under the hood WML code. Long story short, I stumble upon daze implementation that feel like hardcore WML code that have to replace any unit with marksman and make me wondering why on earth this daze code not implemented at engine level?

That question come into my mind because I think I got an idea how implement it as simple as possible at engine level..

We only need to add 2 keys under unit tag,
  • base_accuracy
    default value is 0, this value will be added to chance to hit on all attacks, so daze implementation just reduce this key value to -10
    this key also can be implemented under attack tag edit: turns out accuracy key already exist, sorry
  • base_defense
    default value is 0, this value will be added to defense from movement type, daze implementation just reduce this key value to -10

so in this schema, formula for change to hit value before any modification is

Code: Select all

base_accuracy + accuracy (attack) + base_defense + defense (movement type) - parry (attack)
With those 2 keys, daze is easier to be implemented.. and may be also for other ability(s)/weapon specials somewhere in the mainline or add-ons and hopefully inspiring new unique and awesome ones.

notes
After seeing UtBS daze implemented in 1.15.5 using chance_to_hit tag under ability tag and adding hidden ability to some units, it much simpler than 1.14.14 implementation, still I will argue engine implementation using new keys much simpler and robust, because in hidden ability implementation if there any new ability / weapon specials related to change to hit, that code has to be modified and that also the case with any ability like daze. Code modification can be cumbersome and increase likelihood of bugs. New keys implementation remove that burden.

What do you think guys?

side notes
I already uninstalled 1.14.14, but if I am not mistaken, daze in 1.14.14 has slightly different mechanic compared to daze in 1.15.5.
Post Reply