Mod : Advance Wesnoth Wars

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Mod : Advance Wesnoth Wars

Post by Ruvaak »

I just published on the Addons Manager the mod I worked on since some weekends : Advance Wesnoth Wars, for BfW 1.14.

I know a lot of you are not fond of RNG system, that mod should be for you ! I'm not saying I don't like the actual system, but you can try the mod to compare which mechanic you prefer (maybe it will make you understanding why RNG combats is not as bad as many think).

So it's a mod purposing different gameplay, not critisizing developpers choices.

I inspired myself from the code of some others mods for that : mainly Heal XP, No Randomless. I made some fixes and lot of tests. Made them also working properly on Campaigns and also for AI. I will contact the mod authors to purpose them my corrections once I finish completely what I want to do and made some more tests.

You can see the code on GitHub, including the ReadMe and the changelog.

EDIT 2019-04-14 : Version 1.14.14.2 released today ! The mod is now stable and finished, I did all the features I wanted, optimisations and even french translations. I don't plan to add features for now, just maintain it and fix reported bugs.


Description


A collection of the most-requested options to make the mechanics more realistic and tactic, for people curious to experiment a new gameplay.
It changes the combat approach, making it easier for good tacticians, harder for the others.
All theses features works for vanilla Campaigns & Scenarios, Single or Multiplayer, for all sides (including AI).

It also includes some options give interest to level-up units after level 3, or to make some abilities more attractives (berserk, ambush..)

The features which keep the game balanced even in Campaign are enabled by default. The others features are more aimed for PvP multiplayer, or being played on campaign in a lesser difficulty. Each one combines with each others very well (or, at least, *should*).

Features list :

- No Random Combats : attacks never miss, terrain bonus is instead used as damage reducer.

- Increased Damage : To compensate the high terrains defenses. Only applies for 'No Random Combats'.

- Squad Mode (HP-related strikes) : Units lacking lot of HP do proportionally less attack strikes (or less damage for single-strike attacks). Swarm is a worse ratio (-1 strike if you miss just 1 HP), but native, so considered by AI. In both cases, minimum strikes will be 1, and will not apply for berserk.

For theses features, will be have access to damage/strikes estimation displayed on unit weapons section.

- Level-Up : Relative Healing : When an unit advance a level, instead of a full healing and being cured, it keep the missing HP, but statuses are cured. The special case when post-advancement Max-HP is smaller than pre-advanced is also handled.

- Level-Up : Random Bonuses After Max Level Advancement : Units already AMLA (purple XP bar) gain an extra random ability or increased stat each time they level-up again.

- Level-Up : Promoted Leaders After Max Level Advancement : Post-level 3 standard units reaching their first AMLA level-up will be able to recruit the same units as the original leader, recall, and be prefixed 'Chief' with a bronze crown icon (keeping the Loyal icon in case). Excluded for special Heroes.

- *Updated* Epic Heroes : The Leaders and Heroes (gold & silver crowns) gain an increase of 20% of their attributes and a small regeneration ability, making them harder to kill. Excluded for Promoted Leaders.

- Learning from battlefield (Passive XP) : Extra XP for all units each turn (except for the ones not recalled).

- Learning from healing (Max XP/turn for Healing) : Each turn, Healers will earn 1 XP for each adjacent wounded (but not-poisoned) ally, but you can limit the max/turn.

- *Updated* Berserk tweak - Fury + Drain : Replace 'berserk' by a new 'Fury' weapon special, way more interesting. Come also with 'Bloodthirsty', an offensive drain. A warcry related to the fury level with also be displayed.

- *Updated* Ambushed tweak - Surprise Attacks : An ambush will trigger a quick combat in which the ambushed unit can't counter-attack. Awesome combined with NINJA WARS!

- *NEW* Ninja Wars (Stealthy units) : Most of units will melee back-stabs, poison arrows, distract from ZoC, be faster and invisible/ambushers in villages, forests, deep water, or everywhere at night. For funny PvP with fog-of-war focused on ambushes / hide&seek.

- *NEW* Level-Up After Max Level Advancement : Increase Level Number (The unit level will continue growing with the AMLA level-ups)

- Also includes a PvPvE scenario : '4p - Ruvaak Mirage Atoll' optimized to be combined with all features.


For modders


You can reuse the code of this mod in your own creations, without asking my authorization, only if you share it with the same License, freely.
But I will really appreciate to know my code is used on your project, and that you credit my work somewhere in your code.



Thanks


Some of theses features are inspired from existing code, saving me lot of times.
A big thanks particularly to Eagle 11, Ravana, Bob_The_Mighty, Dugi for their creation.
And a huge thanks for all Wesnoth developers and WML wiki contributors !



How To Enable/Disable Mod Options during a Scenario/Campaign


The mod works when features options are changed during a game.
When you disable an option, *MOST* of the changes made on units by the features are removed. But it's experimental.

1) 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 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 :
```lua
aww_status.update_feature_01(0) -- NoRandomCombats
aww_status.update_feature_02(0) -- Squad Mode 1 = custom, 2 = swarm
aww_status.update_feature_03(0) -- L-Up AMLA Promoted Leader
aww_status.update_feature_04(0) -- passive xp, 0 to 6
aww_status.update_feature_05(0) -- healing xp 0 to 6
aww_status.update_feature_06(0) -- L-Up relative healing
aww_status.update_feature_07(0) -- verbose
aww_status.update_feature_08(0) -- NoRandomCombats Damages Adjustment, to -20 to 40
aww_status.update_feature_09(0) -- AMLA Random Bonuses
aww_status.update_feature_10(0) -- Epic Leaders
aww_status.update_feature_11(0) -- Ninja Wars
aww_status.update_feature_12(0) -- Berserk tweak
aww_status.update_feature_13(0) -- Ambush tweak
aww_status.update_feature_14(0) -- L-Up Notif
aww_status.update_feature_15(0) -- L-Up AMLA number

If you want to display all currently enabled features (and the associated number), copy/paste/execute this line the lua console :
```lua
aww_status.message_info_all()
```


How To Migrate a Savegame from a previous version of the mod


It will do it automatically on next scenario. If you want to try to migrate the current scenario, copy/paste in lua console the following line :
```lua
wesnoth.fire_event('aww_event_reload_lua')
```
If you see some bugs on a feature, (see previous section) disable it on re-enable it (replace XX by feature number):
```lua
aww_status.update_feature_XX(0)
aww_status.update_feature_XX(1)
```
See previous section to know how to open console or when the changes will applies.



Developer Mode


This is useful only for development/test purpose on the addon lua scripts.

- Do not do that play a big campaign, as it can create issue with your savegame when you update the addon.

- Effect : the LUA scripts will be loaded externally (means you can edit them, and the effect will apply when you reload a savegame, no need to re-create a game or a scenario like for WML scripts).

- To enable it, just place a empty file named :
```
aww.dev
```
in the addon base directory (where the _main.cfg is).

- To disable it, just remove the file, and restart the game.



Feel free to contribute !
I'll be more than happy to get some feedbacks, issues reporting or even code contribution :eng:

If you experiment a bug, please report it to me on the forum, then try to disable the feature (see previous section).


Thanks
Last edited by Ruvaak on December 6th, 2020, 1:15 am, edited 51 times in total.
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

Version 1.0.0 just released.

I did the point number 2, by diminishing attack damage instead of damage strike (more easy and more fair compare to units have one single big strike.

Of courses there is lot of possible improvments, but everything code should works as it is. I will take time for bug hunts.
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

Version 1.14.4 released (1.14.x stands BfW 1.14 compatibility checked)

I fixed some things and found a way to decrease number of strikes on units HP ratio. Except if that unit have a single big strike, in that case, I decrease the damage of that strikes.
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

New version released, allowing an extra option :

6. Differential Healing on Level-up : when an unit advance a level, its missing HP and status (poisoned, petrified, slowed) are maintained.

Concretely, an unit have 31/41 at level 2, and is poisoned, until passing to level 2.
It will substract the 10 missing HP from its new HP bar (like 45/55), and kept poisoned.

It's a very good combination with the 2 first options, and make the level-up
Creator of Advance Wesnoth Wars mod
User avatar
Ravana
Forum Moderator
Posts: 2933
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Mod : Advance Wesnoth Wars

Post by Ravana »

And if next level has less max hp, will low hp unit die when leveling?
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

I though about this case, but I didn't implemented yet because I didn't found any concrete units who do that. There is a lot of units from default era who decreases their hp ?
Last edited by Ruvaak on March 17th, 2019, 1:29 pm, edited 1 time in total.
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

Ah nevermind, I made a fix to multiply a ratio, and uploaded it :)
Thanks for the tip ^^
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

I made a new release, including some new features, this week-end, to celebrate the 123th download ;)

Everything is well tested now, I even played some solo campaigns with the mod options by default, and it keep relatively balanced (even if option 2 give a clear advantage to outnumbering camp, usually AI)

But I will recommend to disable the option "Health-based strikes number" for hard/expert level, because this option will increase the difficulty a lot when you are outnumbered (which is the case for almost all campaign).

I will strop writing about new release in this topic, given how few people are frequenting the forum theses days. I will use the thread only for discussions with you guys.

You can check if new version is available from the game Extension manager, and read the changelog here or directly in your downloaded files (data/add-ons/Advance_Wesnoth_Wars/CHANGELOG.md).
Last edited by Ruvaak on April 12th, 2019, 5:54 pm, edited 1 time in total.
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advance Wesnoth Wars

Post by Ruvaak »

I made some new features (see first post, just updated), including a very fun "Stealth mode", and did a lot of tests.

Most of the popular ideas/requests for the game are in that mod, and *almost* everthing I wanted to implement.

I want to want :

- add "can't attack when ambushed" mod (will be spectacular on PvP, or some campaigns ambishing the player, or my Stealth Mode), but from what I saw, all the actions (cutting the movements) are done in C++ part, and I don't see what event I can use with that (given it's triggered in the middle of the turn, during movement),

- a screen to display the exact damage for the 2 first options (by the combat simulation window, or select a unit + right-click on the target ennemy)

so if you have the answer or can help with that, you're welcome !
Creator of Advance Wesnoth Wars mod
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advanced Wesnoth Wars

Post by Ruvaak »

I just released a major update, 1.14.12.0, doing the "no-random combats" and "HP-related strikes" in a better way, more conventional. The last option is now renamed "Squad mode", and you have 2 alternatives : using my custom calculations, or using the "swarm" ability (native, and better handled by AI).

It also contains optional tweaks for Berserkers (limit rounds, not triggered when attacked) and ambush (ambushed units take also an attack without being able to defend).

Have fun !
Creator of Advance Wesnoth Wars mod
Trossknecht
Posts: 31
Joined: January 29th, 2016, 11:10 pm

Re: Mod : Advanced Wesnoth Wars

Post by Trossknecht »

I have been having a grand time playing one of the mainline campaigns (The Rise of Wesnoth) modified by the "Advanced Wesnoth Wars" modification.

In the course of doing this, however, something interesting happened. Between two scenarios ("Rough Landing" and "A New Land"), all of the "chiefs" created in the course of the campaign disappeared from my recall list. In addition to this, the two "heroes" that used to appear automatically at the start of each scenario (Lady Jessine and Burin the Lost), both of whom had also achieved "chief" status, also ceased to appear.

Here are saved versions of the first turn of the scenarios in question:

TRoW-Rough Landing-Auto-Save1.gz
(233.53 KiB) Downloaded 673 times
TRoW-A New Land-Auto-Save1.gz
(197.01 KiB) Downloaded 599 times
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advanced Wesnoth Wars

Post by Ruvaak »

Hi Trossknecht , thanks for the report and the savegame !

And sorry you had that bug :( I will analyze that this weekend, if I find the time for :)

Until recently I put a warning on the tooltip for that feature, because its the only one I don't recommend for campaigns, as it can do weird things depending how the campaign script is done. I cut it because text description was too long, and I made lots of test (not on that campaign, unfortunately) who was ok. I think I will re-add it on the feature tooltip on the next version

Also, *normally*, units defined as "Hero" should anyway not be able to be "chief". The thing is, there is lot of ways to define a hero, depends how the campaign script is done. It's another bug for me.

I have some questions for you :
- Did you had others "Chiefs" before reaching "Rough Landing", and did they also disapears on previous scenario, or just this one ?
- If you want I can edit your savegame (of Rough Island) without units defines as "chiefs" (and even disable the option of the savegame, so they will not disappears after that). So maybe you prefer to give me a savefile closer the end, to not redo the scenario ?
Creator of Advance Wesnoth Wars mod
Trossknecht
Posts: 31
Joined: January 29th, 2016, 11:10 pm

Re: Mod : Advanced Wesnoth Wars

Post by Trossknecht »

Hello, Ruvaak!

Thank you for your quick reply and, most especially, for building such a fine mod.

You are very kind to offer to edit my saved game. However, as I have finished the campaign, there is no need to do it

I did, indeed, have chiefs in several games that preceded "A New Land." Those that were heroes appeared in the usual places. Those that were ordinary remained in my recall list.

This suggests that the cause of the disappearance of the chiefs may be related "A New Land" itself. Indeed, I wonder if the cause is somehow related to the first event in the game, which is delivery of the leader (Prince Haldric) to his keep by a boat. Normally, the two heroes arrive with him. However, in the case of the game that I played with the "Advanced Wesnoth Wars" mod, the two heroes (both of whom had achieved chief status) did not arrive.
User avatar
Ruvaak
Posts: 47
Joined: February 3rd, 2019, 2:53 pm

Re: Mod : Advanced Wesnoth Wars

Post by Ruvaak »

Yes, I came at the same conclusion, but quickly looking the code of "15_A_New_Land.cfg", I didn't find what mess up. I guess this case can also happens when in a scenario, you take temporary control of others leaders, then on next scenarios they withdraw all the leaders (including the one promoted with the mod, so) except your real one. In theses cases there is not so much I can do except modifying the campaign itself :)

When I will take time to dig on it, maybe I will do a suggestion to improve that on the campaign. Every mainline campaigns can be coded very differently, so it can do differents bugs :D

I anyway put a warning on this feature, handled correctly Heroes of this campaign (they are not really declared as "Heroes"), and just released a new version (was quite quick to fix) on the Extension Manager.

I saw you also enabled "Random Bonus after AMLA level-up", you find the bonuses cool ? :)
Creator of Advance Wesnoth Wars mod
User avatar
Hammerfritz
Posts: 22
Joined: September 1st, 2016, 10:09 pm

Re: Mod : Advanced Wesnoth Wars

Post by Hammerfritz »

Hello Ruvaak!
First of all, thank you so much for all the work you put into these mods! I haven't had the time to try all features yet, but since I myself played around with the concept of giving all attacks the swarm special, I wondered how your custom version of Squad Mode would work, and started testing. I though I had noticed a problem in version 12.4 of your mod, and before I continued testing today, I updated to 12.6. Now it seems custom squad mode has no effect anymore. Adjusted damage and attack number values are displayed, but when the unit actually fights, it just uses its base attack. I can't find the corresponding file in your mod folder, maybe that's the problem? "02_squad_swarm.cfg" is still there. Furthermore, it seems that "No Random Combats" is always active, regardless whether it is turned on or not.
Anyway, I'm looking forward to seeing more of your works!

Greez,
Hammerfritz

PS:
Do you still look for a way to reduce damage instead of attack number if a unit has only one hit?
So the following event is probably super-inelegant and maybe you've thought of it already, but placing it into your squad mod might help. Just a proof of concept, it only applies to the attacking unit and the second attack (tried it with dragonguards).

Code: Select all

	[event]
		name=attack,attack end,post advance
		#everything but "attack" is not strictly needed for the actual accuracy to be applied during the fight, but for displaying the correct value afterwards
		id=refresherrrr
		first_time_only=no
					[set_variable]
						name=hp_multiply
						value=$unit.hitpoints|
						divide=$unit.max_hitpoints|
					[/set_variable]	
					[remove_object]
						id=$unit.id		
						object_id=damagemodifier
					[/remove_object]
					[store_unit]
						[filter]
							id=$unit.id
						[/filter]							
						variable=unit
					[/store_unit]					
					[set_variable]
						#needed because swarm is not considered when querying attack number
						name=realattacknumber
						value=$unit.attack[1].number|
						multiply=$hp_multiply|
						round=ceil
					[/set_variable]					
					[if]
						[variable]
							#less than 2 instead of equals 1 because of minimum attack number defined in swarm weapon special
							name=realattacknumber
							less_than=2
						[/variable]									
						[then]
							#dunno why the following 3 set variable tags don't allow themselves to be merged into one, but if you do, they always return dmg being 1
							[set_variable]
								name=dmg
								value=$unit.attack[1].number|
							[/set_variable]
							[set_variable]
								name=dmg
								multiply=$unit.attack[1].damage|
							[/set_variable]	
							[set_variable]
								name=dmg
								multiply=$hp_multiply|
							[/set_variable]								
							[set_variable]
								name=wanted_attack_name
								value=$unit.attack[1].name|
							[/set_variable]								
							[modify_unit]
								[filter]
									id=$unit.id
								[/filter]									
								[object]
									id=damagemodifier
									take_only_once=no
									[effect]
										apply_to=attack
										name=$wanted_attack_name|
										set_damage=$dmg|
									[/effect]									
								[/object]								
							[/modify_unit]								
						[/then]
					[/if]	
	[/event]
Last edited by Hammerfritz on April 4th, 2019, 6:43 pm, edited 3 times in total.
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)
Post Reply