Mod : Advance Wesnoth Wars
Moderator: Forum Moderators
Re: Mod : Advanced Wesnoth Wars
Hello Hammerfritz !
I just checked the code, and it was because the attacks special was cumulative = true.
I changed it with cumulative = false, and it seems to works. Check the 13.0 I just released. Tell me if still have the issue (or you spot others)
I don't really understand why, but with "No Random Combats" enabled, it works well, that why I didn't see the issue (lot of combinations of options to test...)
I will figure a way to deal with a multiplier instead of an absolute value and keep the effect cumulative (to combine properly with others special attacks), but wesnoth round down strikes, and I want a rounding on 0.5 (that why I used an absolute value instead of multiplier) to not get the same problem as "swarm" where an unit lose a strikes if it miss a single HP.
About how it was designed :
The code is in mods\01_02_duel.cfg and lua\aww_duel.lua - search for "get_new_strikes_number(" and special_strikes_value("
The "squad mode" is about reducing the "strikes" of units, related to its own HP.
In "swarm" mode, I just apply "swarm mode" on each unit so the game deal with that native feature (I just put a minimum of 1 strikes)
For the "custom" mode, I just put a temporary weapon effect to change the numbers of strikes, the time of the attack, and then when attack end I delete the weapon special.
HOWEVER, to balance a little more the things, if an unit have only 1 base strike (ex : dwarf gunners), I reduce the damage related to HP ratio, instead (only in Custom mode for now).
The "attack damage" are reduced also if the 1st feature is enabled "No Random Combats" (attack don't miss, so terrain / specials bonus related to miss ratio is instead of applied has damage ratio).
To help understanding the calculations, you can enabled my "developer mode"
By creating an empty file named aww.dev in the data/addons (of you user directory where there is the downloaded addon, not the core wesnoth).
Then when you create a game, you will see a last "Verbosity" option in Advanced Wesnoth Wars option. Enable it. It will display messages when you attack.
If you don't delete the aww.dev file, the lua scripts will be loaded externally. It's nice for tests (you can change a lua file, and just reload a save to see the changes, instead of having to recreate a game), but don't do that for playing a real campaign or multiplayer against humans, it also can create issues on your saved game when you update the addon. delete the aww.dev file once you finished your tests.
I just checked the code, and it was because the attacks special was cumulative = true.
I changed it with cumulative = false, and it seems to works. Check the 13.0 I just released. Tell me if still have the issue (or you spot others)
I don't really understand why, but with "No Random Combats" enabled, it works well, that why I didn't see the issue (lot of combinations of options to test...)
I will figure a way to deal with a multiplier instead of an absolute value and keep the effect cumulative (to combine properly with others special attacks), but wesnoth round down strikes, and I want a rounding on 0.5 (that why I used an absolute value instead of multiplier) to not get the same problem as "swarm" where an unit lose a strikes if it miss a single HP.
About how it was designed :
The code is in mods\01_02_duel.cfg and lua\aww_duel.lua - search for "get_new_strikes_number(" and special_strikes_value("
The "squad mode" is about reducing the "strikes" of units, related to its own HP.
In "swarm" mode, I just apply "swarm mode" on each unit so the game deal with that native feature (I just put a minimum of 1 strikes)
For the "custom" mode, I just put a temporary weapon effect to change the numbers of strikes, the time of the attack, and then when attack end I delete the weapon special.
HOWEVER, to balance a little more the things, if an unit have only 1 base strike (ex : dwarf gunners), I reduce the damage related to HP ratio, instead (only in Custom mode for now).
The "attack damage" are reduced also if the 1st feature is enabled "No Random Combats" (attack don't miss, so terrain / specials bonus related to miss ratio is instead of applied has damage ratio).
To help understanding the calculations, you can enabled my "developer mode"
By creating an empty file named aww.dev in the data/addons (of you user directory where there is the downloaded addon, not the core wesnoth).
Then when you create a game, you will see a last "Verbosity" option in Advanced Wesnoth Wars option. Enable it. It will display messages when you attack.
If you don't delete the aww.dev file, the lua scripts will be loaded externally. It's nice for tests (you can change a lua file, and just reload a save to see the changes, instead of having to recreate a game), but don't do that for playing a real campaign or multiplayer against humans, it also can create issues on your saved game when you update the addon. delete the aww.dev file once you finished your tests.
Last edited by Ruvaak on April 4th, 2019, 7:37 pm, edited 2 times in total.
Creator of Advance Wesnoth Wars mod
- Hammerfritz
- Posts: 22
- Joined: September 1st, 2016, 10:09 pm
Re: Mod : Advanced Wesnoth Wars
Hi again!
Also, thanks for explaining, I'll try to look behind the scenes a bit more later.
Byes!
I tried it, works smoothly and doesn't even have the issue I thought it had at 12.4 =)I changed it with cumulative = false, and it seems to works. Check the 13.0 I just released. Tell me if still have the issue (or you spot others)
Have you seen the snippet I edited into my last post? Maybe that could help with adding that feature to the swarm version. Also applies to units that have more than 1 base strike, but were reduced to having just one. Hope it's not way too bloaty though xDHOWEVER, to balance a little more the things, if an unit have only 1 base strike (ex : dwarf gunners), I reduce the damage related to HP ratio, instead (only in Custom mode for now)
Also, thanks for explaining, I'll try to look behind the scenes a bit more later.
Byes!
In general, speaking is a free action that you can perform even when it isn’t your turn.
(Wizards of the Coast: Dungeons and Dragons Player's Handbook)
(Wizards of the Coast: Dungeons and Dragons Player's Handbook)
Re: Mod : Advanced Wesnoth Wars
Yep, it's a good idea. I wil check that this weekend if I find time ^^ . I didn't know how to get the base weapon strikes (And i didn't wanted to reduce damage didn't had initially 1 strike).Hammerfritz wrote: ↑April 4th, 2019, 7:11 pm Have you seen the snippet I edited into my last post? Maybe that could help with adding that feature to the swarm version. Also applies to units that have more than 1 base strike, but were reduced to having just one. Hope it's not way too bloaty though xD
Creator of Advance Wesnoth Wars mod
-
- Posts: 164
- Joined: April 26th, 2014, 4:44 pm
Re: Mod : Advanced Wesnoth Wars
Feature suggestion: you can choose your units' traits. Good with No Random Combat!
There are very much electrochemical currents in my brain.
Re: Mod : Advanced Wesnoth Wars
Yep, it's a good suggestion. I already thought about that, and then, first it's boring to code (interactive menu in wml or lua... uff), it can also be boring and break the rythm to always have to choose on every recruit. And in the end, keeping some randomness for minor things (things that you will know before a combats) it's not that bad. One of my features in fact use randomness : Level-up AMLA random bonus, and I find this more fun than having to choose it.
Creator of Advance Wesnoth Wars mod
Re: Mod : Advanced Wesnoth Wars
@Hammerfritz I quickly tried you WML code and did a 0 damage on all units
in the end I did the reduced damage for single-strikes on swarm mode the same way I did it in Custom mode, in LUA scripts. Because making a loop on each attack in WML in incredibely slow ^^
in the end I did the reduced damage for single-strikes on swarm mode the same way I did it in Custom mode, in LUA scripts. Because making a loop on each attack in WML in incredibely slow ^^
Creator of Advance Wesnoth Wars mod
- Hammerfritz
- Posts: 22
- Joined: September 1st, 2016, 10:09 pm
Re: Mod : Advanced Wesnoth Wars
Oh my...It still works for me, but since you found a better solution anyway, there's probably no purpose to exploring that I just quickly tested your latest version it and it works great. However....I'm somehow back to "No Random Combats" being always enabled in both custom and swarm mode (despite not being indicated as turned on by lua message at game start).did a 0 damage on all units
Greez,
Hammerfritz
In general, speaking is a free action that you can perform even when it isn’t your turn.
(Wizards of the Coast: Dungeons and Dragons Player's Handbook)
(Wizards of the Coast: Dungeons and Dragons Player's Handbook)
Re: Mod : Advanced Wesnoth Wars
Hammerfritz wrote: ↑April 15th, 2019, 2:23 pm However....I'm somehow back to "No Random Combats" being always enabled in both custom and swarm mode (despite not being indicated as turned on by lua message at game start).
Greez,
Hammerfritz
I saw the issue, just uploaded the 1.14.14.3 who fix it. But tell me if you still see problems. thanks again for taking time reporting it !
Creator of Advance Wesnoth Wars mod
Re: Mod : Advanced Wesnoth Wars
Hello,
I'm trying your mod while playing "The Ravagers" campaign and i get some problems with special weapons (magical and marskman)
They do 1 damages and have -5% base
In the following picture you can see that the magical attack goes from 8x6 to 1x6
Next is the details of the attack which show the base : -5%. (for reference, the sword attack of the units is base:35%.
Is it the intended behaviour?
If no, what should i change to correct it.
If yes, could you explain to me what i'm missing about thoses attacks to make them work better?
PS: I'm using the following options Zakimoto.
I'm trying your mod while playing "The Ravagers" campaign and i get some problems with special weapons (magical and marskman)
They do 1 damages and have -5% base
In the following picture you can see that the magical attack goes from 8x6 to 1x6
Next is the details of the attack which show the base : -5%. (for reference, the sword attack of the units is base:35%.
Is it the intended behaviour?
If no, what should i change to correct it.
If yes, could you explain to me what i'm missing about thoses attacks to make them work better?
PS: I'm using the following options Zakimoto.
Re: Mod : Advanced Wesnoth Wars
Hello Zakimoto
Thanks for reporting me, it's clearly a bug. Magickal and Marksman are managed in a special way in my code , they ignore the terrain defenses and always hit at 60-70% : so on No-Random option enabled, with hit ratio is converted in damage reduction, and 12x5 on 60% hit should be 7x5.
Can you see if the damage is really 1 ? maybe it's just a bug on the display informations but not the damages.
Il will take a look, but i'm quite busy theses day, can take some times. I will notify you when it's corrected
In the meanwhile, you can disable the "No Random Combat" option to continue the campaign without :
During a game, type :
```
:debug
```
(except if you launched the game with --debug argument)
2) Then open Lua Console(default : `, but you can see it in Menu > Settings > Shortcuts > Display lua console)
3) Copy/paste/execute one of the following lines related to mod features.
- Change the number in parentheses : 0 (zero) means disabled, 1 enabled.
- When specified, you can replace it by another number. (like in feature 02, 04, 05, 08...)
- Most of the changes will be operational immediately, or next turn, or next scenario. But units already modified will keep theirs changes.
The commands to edit each feature and remove/re-enable changes on units :
aww_status.update_feature_01(0) -- NoRandomCombats
To re-enable it : aww_status.update_feature_01(1)
The modifications will be taken on next scenario.
Thanks for reporting me, it's clearly a bug. Magickal and Marksman are managed in a special way in my code , they ignore the terrain defenses and always hit at 60-70% : so on No-Random option enabled, with hit ratio is converted in damage reduction, and 12x5 on 60% hit should be 7x5.
Can you see if the damage is really 1 ? maybe it's just a bug on the display informations but not the damages.
Il will take a look, but i'm quite busy theses day, can take some times. I will notify you when it's corrected
In the meanwhile, you can disable the "No Random Combat" option to continue the campaign without :
During a game, type :
```
:debug
```
(except if you launched the game with --debug argument)
2) Then open Lua Console(default : `, but you can see it in Menu > Settings > Shortcuts > Display lua console)
3) Copy/paste/execute one of the following lines related to mod features.
- Change the number in parentheses : 0 (zero) means disabled, 1 enabled.
- When specified, you can replace it by another number. (like in feature 02, 04, 05, 08...)
- Most of the changes will be operational immediately, or next turn, or next scenario. But units already modified will keep theirs changes.
The commands to edit each feature and remove/re-enable changes on units :
aww_status.update_feature_01(0) -- NoRandomCombats
To re-enable it : aww_status.update_feature_01(1)
The modifications will be taken on next scenario.
Creator of Advance Wesnoth Wars mod
Re: Mod : Advanced Wesnoth Wars
Hello,
Yes the damage was always 1.
Thank you for the fast answer.
Yes the damage was always 1.
Thank you for the fast answer.
Re: Mod : Advanced Wesnoth Wars
Hello Zakimoto
After checking things, it appears there is a problem on this Ravager campaign because it uses lot of "chances_to_hit", depending on some conditions (see screenshot)
My code don't interpret the conditions and filters, so it's just basing the damage on the combination of all chances_to_hit (or the terrain if there is no special chance to hit). Actually, all the combination do a -5%.
So I did something more simple and more logic about this "chance to hit" : if the chance to hit with specials is less than the terrain defense, the terrain defence will be used as damage modifier.
It's fixed in the version I just uploaded : 1.14.15.1
After checking things, it appears there is a problem on this Ravager campaign because it uses lot of "chances_to_hit", depending on some conditions (see screenshot)
My code don't interpret the conditions and filters, so it's just basing the damage on the combination of all chances_to_hit (or the terrain if there is no special chance to hit). Actually, all the combination do a -5%.
So I did something more simple and more logic about this "chance to hit" : if the chance to hit with specials is less than the terrain defense, the terrain defence will be used as damage modifier.
It's fixed in the version I just uploaded : 1.14.15.1
Creator of Advance Wesnoth Wars mod
Re: Mod : Advanced Wesnoth Wars
Hi Ruvaak,
the icon of your addon seems to be about as big as your addon and takes up a significant amount of the addon list everyone downloads when connecting to the addon server. Please reduce the icon size or use a path to a mainline image instead of a data URI. The image seems to be a mainline portrait anyway.
PS: Nice to see someone put serious effort into a no-randomness mod!
the icon of your addon seems to be about as big as your addon and takes up a significant amount of the addon list everyone downloads when connecting to the addon server. Please reduce the icon size or use a path to a mainline image instead of a data URI. The image seems to be a mainline portrait anyway.
PS: Nice to see someone put serious effort into a no-randomness mod!
"If gameplay requires it, they can be made to live on Venus." -- scott
Re: Mod : Advanced Wesnoth Wars
Shouldn't the add-ons server (and perhaps the client) validate the size of an image in a data URI, when the add-on is uploaded? It should always be exactly 72 x 72 pixels, right?Soliton wrote: ↑October 29th, 2019, 7:57 pm the icon of your addon seems to be about as big as your addon and takes up a significant amount of the addon list everyone downloads when connecting to the addon server. Please reduce the icon size or use a path to a mainline image instead of a data URI. The image seems to be a mainline portrait anyway.