Jump to content

Defining macros in 0 A.D. - will it ever be possible?


Use of macros  

6 members have voted

  1. 1. Will you use macros if available?

    • Yes, or probably yes
    • Don't know
    • No, or probably not

Recommended Posts

Hello 0 A.D. friends,

I have been thinking about the possibility of making a mod implementing macros and came to the conclusion this is feasible, albeit complicated. Despite my good intentions, I will be in shortage of time very soon, and this is the kind of project that takes a while to be developed. Perhaps, this is also the kind of project that triggers the interest of some of you smart guys populating the forum. If so, this is the topic for you. ;)

If any of the developers has considered this before, I'd be curious to hear from them. This might not be a new idea after all.

This post is organized in sections, so a reader can skip the parts they're not interested in.

1. What are macros?


Macros are sequences of actions. Players often find themselves in situations where certain sequences of commands are repeated over the game, or across multiple games. A macro "collapses" several actions into one single action and assigns the "collapsed" action to a hotkey/button/command.

The main purpose of a macro is reducing micro-management.

For a more general understanding of macros, see this Wikipedia page.

2. Why do 0 A.D. players need macros?


Macros reduce micro-management and help simplifying repeated actions. For example, the following actions can be automated:

  • At game start, the CC trains a certain unit in a batch of given size, then female citizens are sent to fruit, cavalry to meat, infantry to wood.
  • Every time a building is placed, it is added to a certain control group.
  • Train a certain number of priests from temples and let them guard a hero.

Once a macro has been defined, it can be assigned to a hotkey.

3. Why macros, when there are mods around?


Some mods certainly provide features that can also provide macro functionalities. There are some benefits in the possibility of defining custom macros though:

  • Macros, if embedded into the core game, will not require installation of mods.
  • There are potentially infinite macros a user can define; not all mods can cover them.
  • Players who don't have the skills or the time for coding, will have the opportunity to create custom macros with nearly zero programming knowledge.

4. What's the proposal?


Making a mod, to start with. Embedding macros as part of the core game will be great.

5. How can a player define a macro?


There are many possible ways to allow players defining macros. My first intuitive though is that

each macro instruction is a "grammatical sentence", following the (possibly more complex) structure:


The graphical way. Each macro instruction can be defined by a sequence of dropdown menus. For example:

|wounded| |Infantry| |gather| |closest| |tree|

The command-line way. Each macro instruction can be defined by a SQL-like query. For example:

wounded Infantry gather closest tree

The graphical approach is more intuitive, but the dropdown structure is probably not flexible enough to cover all the possible instructions. The command-line approach, on the contrary, is more flexible but requires some documentation and is less user-friendly.

6. Implementing macros can be complicated


There are several factors that make implementation of macros a non-trivial task.

One first issue is that not all actions might follow the same predefined grammatical structure. Data required by a certain action is highly dependent on the action itself. Therefore a pattern "to rule them all" might not be possible at all. Therefore, instruction patterns can be complex and require some ad-hoc work to be implemented.


  • Like 5
Link to comment
Share on other sites

Its a good idea, but there is one thing that should be talked about here:

In other RTS games, using macros is considered cheating. That being said, if it is implemented into the game, it's definitely not cheating.

The question is then are the repeated actions that these macros take care of an important part of the skill gap in 0ad? Are they important for player experience?

I would personally say most of them are important, save for very basic things like autoqueue (which can be thought of as a macro no?)

So my thoughts are that this might be good as a mod, but not as an addition to the main game.

  • Like 1
Link to comment
Share on other sites

very good idea if you'll ask me. my only concern is the possible overcomputation and how that can be limited.

some tipe of enforced transparency would be nice too, but that is not the hard part.

if we waited the base game devs for a gui rework, there would be nothing like boongui around. macros are a good opportunity for seeing some interesting AI work being tried.

this said, it's true that, in game design, some "dumb" and easily automatable actions are important for player experience. I wouldn't consider skill gap though, that's so overrated.

Link to comment
Share on other sites

Today many players using their own "tools" to get edge (advantage) and they keep it secret. This way making macros public let players not having programming skill to get to similar level. This cannot be considered as cheating or anything else. This should be a MUST in the game to make  games more competitive.

Once autociv was considered as such "cheating tool", today is is basic tool most players can't imagine play without  [I even rememmber nani was removing feature to see how many idle unit you have in minimap - he considered this too strong but fact is if this is publicly available no issues] (and 0ad team slowly adding these features to 0ad - but very slow - and main reason is they dont want to manintain it = funny, but fact)

So nobody complains if other player have own tools and they are not aware of them, but now critique comes when someone makes public effort? 

Kindly wake up! The activity mentula is doing is great and he already deserve at least some of these tools to be "default" 0ad tools. 


One more feature I would like to see and call it cheat but it is your problem

Auto-attack targeting hero | Auto-retreat hero (already used by some players)
Auto-adding default groups when game starts (it is never ending repeating activity and trully boring)
Set default stance per unit type
Auto-sent infra units to towers (
nothing kill your keybord more if you try protect against Hans sword rush and you will definitely lose your eco cycle to handle all these units moving there and back and many times commands you gave are ignored and you have to re-click 2times or more - fact!)

Evenly distribute women on farm build
Barracks production to be auto-adjusted if not resources for all selected (
sometimes you are not able to even product 1 soldier coz of multiple baracks selection or it will produce only in few barracks if higher batch and rest of baracks are idling - but could be producing if some resource availalbe in lower limits)



Further you talk of cheating, most advantage today is strongest CPU&GPU  to get UI responses better than opponent :) => leads to micro skill gap, it is reason why some "light version of 0ad exist" without heavy 3D objects to address this at least to few ms.




Edited by Kampot
Link to comment
Share on other sites

  • 1 month later...

What if certain macros would be a part of the game itself it could be skilled as a perk ingame? The naming here already tells us that

On 09/12/2022 at 11:15 PM, Mentula said:

Macros are sequences of actions.

, where "actions" be interpreted as micro-game actions. A macro would now pull together these micro game actions. Example would be "ring the alarm" :) 


In my opinion, the micro-decisions should matter most in early game phase. What does every single one of my 20 or 40 units do? You know what i mean.

Later on tho, i would find it nice if there were more strategy aspects. You would eventually have multiple armies for multiple purposes. For example, you want a 30 spearmen defensive troops to hold a swamp area against horse attacks, but "have given orders" not to fight infantry. That might be because you would not want a cavalry rush from that direction, maybe because your own infantry is far out at the moment. 

Here we see how the decisions change qualitatively over the course of a game. You do not need to just think "Spears are strong against cav, so i take these 30 spearmen and keep spam clicking these 20 riders", but the strategy aspect goes further than that.
You would additionally need to consider: "i use them to delay a potential attack and get ready to do so as soon as my outpost spotted the enemy, but then they are missing in this other important part of the map where all the ore is", or when to expose which area etc. 

Of course this would lower the skill cap and attention needed to be effective within certain areas. But we should consider that other strategic aspects become relevant after expansion happens. How agile / fast is my army? When i just put 30 spears into the swamp, maybe i will get flanked and they are too far to help my CC in time. Where and for what do i use Cavalry, how so for infantry? Which role do vision and map-awareness play for my decisions? Etc.

I could imaginable to use predefined macros as a way to intentionally change the gameplay experience as the game advances while being embedded into the game meta and thus not being a cheat but an "intentional flavour" of the game. It might aswell help non-pro players to better understand different aspects of strategy and understand different phases by keeping their view on the important things. Which i would endorse, because 0ad is a great game for learning things :).

This might be done for example in an "Army Overview". I find that 10 quick bind hotkeys (control groups) for Buildings AND armies are not enough when the action starts. To address this, there could be the option to toggle between "army mode", where you can manage 10 unit clusters, and "civilization mode", where you manage 10 buildings. Also, it would be a cool option to assign an army control group to a building, so that the queued unit are automatically bound to the corresponding hotkey, aswell as setting default spawn behaviour. Default agressive troops can be problematic on some occasions, and maybe i want my cav to flee from spears before i have built enough.

Another topic which is a maybe bit related to this: I know of a StarCraft custom gamemode called "KeyStone". It uses the StarCraft units which fight in a closed arena and spawn from both sides, but they are not directly controllable. Instead, players use cards to spawn units or get tech on units. 
I am not suggesting to actually do the card thing in 0AD, but the basic meta could indeed be stripped of micro management and still be interesting. Maybe even for mobile platforms, as a fork. Don't know how realizable that would be tho. 

Just some thoughts ^_^

Edited by sternstaub
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...