Jump to content

How to change all units, resources and (garrisonabble) buildings


Recommended Posts


I have idea to change all units to make game less unit spammy but to keep gameplay exactly same.

So is there way to make script (JS?) that will apply following to all entities:

  • Units would be double cost
  • double time to build
  • double damage
  • double resistance
  • double gather rate
  • double capture rate
  • Buildings will have less garison capacity
  • Fields&Resources will be reduced to 2x less worker capacity.
  • etc.

...? Possible?

Link to comment
Share on other sites

iirc those values you found determine the AI difficulty. But generally that sounds like a nice idea for a mod to test how that would play out :)

You may want to look at https://code.wildfiregames.com/D4250 and there specifically at the file " binaries/data/mods/public/simulation/data/technologies/special/turbo_match.json "

You basically only need one auto-researched tech file, that changes the appropriate values

I.e. for you goals you would need:

		{ "value": "Cost/BuildTime", "multiply": 2},
		{ "value": "ProductionQueue/TechCostMultiplier/time", "multiply": 2}

instead of 0.5 and

"affects": ["Unit"],

instead of "affects": ["Unit", "Structure"],


(and the same can be done for the capture rate ect... -> See how it's done in other techs https://github.com/0ad/0ad/tree/master/binaries/data/mods/public/simulation/data/technologies)

  • Like 1
Link to comment
Share on other sites

1. For some reason below code does nothing.

Mod is enabled b/c it returned me error when I uploaded wrong format JSON.





2. I also tried below in initGame.js but still no change in times:

// Source Delenda Est!

function InitGame(settings)
    // No settings when loading a map in Atlas, so do nothing
    if (!settings)
        // Map dependent initialisations of components (i.e. garrisoned units)
        Engine.BroadcastMessage(MT_InitGame, {});
    let cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager);

    for (let i = 0; i < settings.PlayerData.length; ++i) {
        let cmpPlayer = QueryPlayerIDInterface(i);
        cmpModifiersManager.AddModifiers("All player bonus", {
            // "ResourceGatherer/BaseSpeed": [{ "affects": ["Unit", "Structure"], "multiply": rate[AIDiff] }],
            // "Trader/GainMultiplier": [{ "affects": ["Unit", "Structure"], "multiply": rate[AIDiff] }],
            "Cost/BuildTime": [{ "affects": ["Unit"], "multiply": 4 }]
        }, cmpPlayer.entity);


Link to comment
Share on other sites


I also tried with .../templates/template_unit.xml like this:

<?xml version="1.0" encoding="utf-8"?>
    <BuildTime op="mul">3</BuildTime>
      <food op="mul">3</food>
      <wood op="mul">3</wood>
      <stone op="mul">3</stone>
      <metal op="mul">3</metal>


I copied entire file from community-mod and just changed these two: <Resources> and <BuildTime>  

But no change, no error, nothing.

Edited by BeTe
Link to comment
Share on other sites

5 hours ago, maroder said:
"autoResearch": true,


Yeah now it works. Awesome.

Can I modify all child notes? Now I have:


       { "value": "Attack/Melee/Damage/Hack", "multiply": 2 },
        { "value": "Attack/Melee/Damage/Pierce", "multiply": 2 },
        { "value": "Attack/Melee/Damage/Crush", "multiply": 2 }

I tried "Attack/*" but it doesn't recognize.

Link to comment
Share on other sites

36 minutes ago, Stan&#x60; said:

@BeTe would you like to make available through 0ad.mod.io ?

Hm, then it would be 1 click download directly from 0AD > Seetings > Mods, right? Idk, it would make it easier to test, but not sure if you want to have unfinished mods there...

Link to comment
Share on other sites

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...