Macromanagement possibilities

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Macromanagement possibilities

Post by Krzysztof-H »

Dear fellow Wesnothians,

Thank you for all the effort put into developing and maintaining this game, for free. It is truly wonderful and one of the best games I've played.

I wish to ask about one aspect of the game, because over time, it really puts me off it. It's micromanagement, or in other words, the dozens of clicks necessary to start and progress through a scenario. I really wish there was an option to automate the deployment and movement of my army when I want it. Of course, there absolutely are moments when I need the fine control to execute a tactic. I imagine an expert player who knows how the AI works will want to micromanage most or all movements. For an average player like me though, I wish I could focus more on the strategy with some macro gameplay, saving some real life time. Especially when there are several turns before I get in contact with the enemy.

I searched the forums and add-ons, but haven't found anything relevant. So my question is, do you know of anything like I'm describing?


EDIT: I realized I haven't mentioned an important caveat. I do know there is an auto-move feature in Battle for Wesnoth. However, this feature can easily break down when it is used with more than 1 unit. Two scenarios I remember:
  1. Your units have different movement calculations. All it takes is for one unit to have the "quick" trait.
  2. The units do not account for blocking each other. Especially frustrating in narrow pathways or caves.
The situation gets even more tricky when facing ambushes or scripted events. Since the units move one after another, and not in formation, they can get totally cut-off.

So essentially, BfW has auto-move for individual units. My request is auto-move for groups of units. I see two possibilities how this could work:
  1. Literally "group" units, like you can do in RTS games with control groups. Then they would move in the same formation they were originally grouped in.
  2. Paint a formation on the map, optionally select which unit should take which place in it. In an ideal world, you could select whether they should enter this formation immediately or focus on getting there faster.
Units in those formations would move one tile at a time, so as to minimize the damage caused by enemy ambushes.

Best regards,
Christopher
gnombat
Posts: 1076
Joined: June 10th, 2010, 8:49 pm

Re: Macromanagement possibilities

Post by gnombat »

Well, you could type :droid 1 on when you want to hand over control to the AI, and then type :droid 1 off when you want to re-take command.

However, this is mostly intended as a debugging tool rather than an aid for the player - I'm not sure how well this would work in practice.
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Re: Macromanagement possibilities

Post by Krzysztof-H »

gnombat wrote: January 4th, 2025, 4:19 pm Well, you could type :droid 1 on when you want to hand over control to the AI, and then type :droid 1 off when you want to re-take command.

However, this is mostly intended as a debugging tool rather than an aid for the player - I'm not sure how well this would work in practice.
Sounds like a great workaround! Thanks for the tip, I'll give it a try.
User avatar
Atreides
Posts: 1252
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village in Merwuerdigliebe turning the lights on and off

Re: Macromanagement possibilities

Post by Atreides »

One add on that you might like is called Advanced Order Cancelling. It automatically cancels orders for units that have been given long treks if they are attacked on the way. I know, it's not exactly what you're looking for but it sounds like it might help a little.
User avatar
Ravana
Forum Moderator
Posts: 3563
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Macromanagement possibilities

Post by Ravana »

Some ideas that are easy to implement

1) select hex, command all your units to move towards it in unspecified order
2) select start hex and end hex, command all your units move from their position with that vector at same pace, so slowest unit will slow everyone

With some effort it can be adjusted to request selection of units instead of all.

3) select line of units, by moving first unit in line, entire line follows
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Re: Macromanagement possibilities

Post by Krzysztof-H »

Atreides wrote: January 4th, 2025, 5:12 pm One add on that you might like is called Advanced Order Cancelling. It automatically cancels orders for units that have been given long treks if they are attacked on the way. I know, it's not exactly what you're looking for but it sounds like it might help a little.
That's a start :)
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Re: Macromanagement possibilities

Post by Krzysztof-H »

Ravana wrote: January 4th, 2025, 8:00 pm Some ideas that are easy to implement

1) select hex, command all your units to move towards it in unspecified order
2) select start hex and end hex, command all your units move from their position with that vector at same pace, so slowest unit will slow everyone

With some effort it can be adjusted to request selection of units instead of all.

3) select line of units, by moving first unit in line, entire line follows
Does sound easy indeed. I might try to program it. Can you recommend any WML examples to get me started?
User avatar
Ravana
Forum Moderator
Posts: 3563
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Macromanagement possibilities

Post by Ravana »

It was interesting idea so I tried 3)

Code: Select all

# alias e=lua wesnoth.require("wml-utils").handle_event_commands(wml.load("~add-ons/EventLoader/event.cfg"))
[remove_event]
	id=Rav_EventLoader_Event_1
[/remove_event]
[remove_event]
	id=Rav_EventLoader_Event_2
[/remove_event]
[unit]
	side=1
	type=Horseman
	x=10
	y=10
	id=leader
	canrecruit=yes
[/unit]
[unit]
	side=1
	type=Blood Bat
	x=10
	y=9
	id=follower
	canrecruit=yes
[/unit]
[unit]
	side=1
	type=Vampire Bat
	x=10
	y=8
	id=follower2
	canrecruit=yes
[/unit]
[modify_unit]
	[filter]
		id=leader
	[/filter]
	x=10
	y=10
	[set_variable]
		name=follower_id
		value=follower
	[/set_variable]
[/modify_unit]
[modify_unit]
	[filter]
		id=follower
	[/filter]
	x=10
	y=9
	[set_variable]
		name=follower_id
		value=follower2
	[/set_variable]
[/modify_unit]
[modify_unit]
	[filter]
		id=follower2
	[/filter]
	x=10
	y=8
[/modify_unit]

[event]
    name=moveto
    first_time_only=no
	# id is needed to not load multiple versions of event at once and to be able to remove it
	id=Rav_EventLoader_Event_1
    [filter]
		[not]
			[filter_wml]
				[variables]
					name=follower_id
					equals=$empty
				[/variables]
			[/filter_wml]
		[/not]
    [/filter]
	[store_unit]
		[filter]
			id=$unit.variables.follower_id
		[/filter]
		variable=follower
	[/store_unit]
	[do_command]
		[move]
			x="$follower.x,$unit.variables.follower_to_x"
			y="$follower.y,$unit.variables.follower_to_y"
		[/move]
	[/do_command]
	[modify_unit]
		[filter]
			id=$unit.id
		[/filter]
		[set_variable]
			name=follower_to_x
			value=-999
		[/set_variable]
		[set_variable]
			name=follower_to_y
			value=-999
		[/set_variable]
	[/modify_unit]
[/event]
[event]
    name=enter_hex
    first_time_only=no
	# id is needed to not load multiple versions of event at once and to be able to remove it
	id=Rav_EventLoader_Event_2
    [filter]
		[not]
			[filter_wml]
				[variables]
					name=follower_id
					equals=$empty
				[/variables]
			[/filter_wml]
		[/not]
    [/filter]
	[modify_unit]
		[filter]
			id=$unit.id
		[/filter]
		[set_variable]
			name=follower_to_x
			value=$x2
		[/set_variable]
		[set_variable]
			name=follower_to_y
			value=$y2
		[/set_variable]
	[/modify_unit]
[/event]
Seems that path should be specified with middle locations as well. Currently follower2 falls behind when leader moves multiple hexes at once. Created https://github.com/wesnoth/wesnoth/issues/9699
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Re: Macromanagement possibilities

Post by Krzysztof-H »

Ravana wrote: January 4th, 2025, 9:11 pm It was interesting idea so I tried 3)

Code: Select all

# alias e=lua wesnoth.require("wml-utils").handle_event_commands(wml.load("~add-ons/EventLoader/event.cfg"))
[remove_event]
	id=Rav_EventLoader_Event_1
[/remove_event]
[remove_event]
	id=Rav_EventLoader_Event_2
[/remove_event]
[unit]
	side=1
	type=Horseman
	x=10
	y=10
	id=leader
	canrecruit=yes
[/unit]
[unit]
	side=1
	type=Blood Bat
	x=10
	y=9
	id=follower
	canrecruit=yes
[/unit]
[unit]
	side=1
	type=Vampire Bat
	x=10
	y=8
	id=follower2
	canrecruit=yes
[/unit]
[modify_unit]
	[filter]
		id=leader
	[/filter]
	x=10
	y=10
	[set_variable]
		name=follower_id
		value=follower
	[/set_variable]
[/modify_unit]
[modify_unit]
	[filter]
		id=follower
	[/filter]
	x=10
	y=9
	[set_variable]
		name=follower_id
		value=follower2
	[/set_variable]
[/modify_unit]
[modify_unit]
	[filter]
		id=follower2
	[/filter]
	x=10
	y=8
[/modify_unit]

[event]
    name=moveto
    first_time_only=no
	# id is needed to not load multiple versions of event at once and to be able to remove it
	id=Rav_EventLoader_Event_1
    [filter]
		[not]
			[filter_wml]
				[variables]
					name=follower_id
					equals=$empty
				[/variables]
			[/filter_wml]
		[/not]
    [/filter]
	[store_unit]
		[filter]
			id=$unit.variables.follower_id
		[/filter]
		variable=follower
	[/store_unit]
	[do_command]
		[move]
			x="$follower.x,$unit.variables.follower_to_x"
			y="$follower.y,$unit.variables.follower_to_y"
		[/move]
	[/do_command]
	[modify_unit]
		[filter]
			id=$unit.id
		[/filter]
		[set_variable]
			name=follower_to_x
			value=-999
		[/set_variable]
		[set_variable]
			name=follower_to_y
			value=-999
		[/set_variable]
	[/modify_unit]
[/event]
[event]
    name=enter_hex
    first_time_only=no
	# id is needed to not load multiple versions of event at once and to be able to remove it
	id=Rav_EventLoader_Event_2
    [filter]
		[not]
			[filter_wml]
				[variables]
					name=follower_id
					equals=$empty
				[/variables]
			[/filter_wml]
		[/not]
    [/filter]
	[modify_unit]
		[filter]
			id=$unit.id
		[/filter]
		[set_variable]
			name=follower_to_x
			value=$x2
		[/set_variable]
		[set_variable]
			name=follower_to_y
			value=$y2
		[/set_variable]
	[/modify_unit]
[/event]
Seems that path should be specified with middle locations as well. Currently follower2 falls behind when leader moves multiple hexes at once. Created https://github.com/wesnoth/wesnoth/issues/9699
Thanks for the effort! WML looks quite convoluted to me, but I get the gist of it.
Krzysztof-H
Posts: 16
Joined: January 20th, 2024, 11:05 pm

Re: Macromanagement possibilities

Post by Krzysztof-H »

gnombat wrote: January 4th, 2025, 4:19 pm Well, you could type :droid 1 on when you want to hand over control to the AI, and then type :droid 1 off when you want to re-take command.

However, this is mostly intended as a debugging tool rather than an aid for the player - I'm not sure how well this would work in practice.
I tried using that command. It's a bit hit-or-miss. Sometimes it works great, but sometimes it breaks down, because the AI just pushes evenly in all directions, instead of focusing on one direction or defending. But even then, it can automate recruitment/recalls, which I really appreciate.
Brittar
Posts: 10
Joined: January 6th, 2025, 12:24 pm

Re: Macromanagement possibilities

Post by Brittar »

The auto-move is helpful, but totally falls apart with more than one unit, like you said. A proper group movement option would be awesome, either the control group thing or the formation painter would be a huge improvement.
Post Reply