BeTe Posted March 10, 2023 Report Share Posted March 10, 2023 Hey. 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? Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 10, 2023 Author Report Share Posted March 10, 2023 I found example in Delenda Est: https://github.com/JustusAvramenko/delenda_est/blob/master/simulation/helpers/InitGame.js#L64 But it's pretty messy and I am not sure that's what I need. Quote Link to comment Share on other sites More sharing options...
maroder Posted March 10, 2023 Report Share Posted March 10, 2023 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) 1 Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 10, 2023 Author Report Share Posted March 10, 2023 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, {}); return; } 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); } } @maroder Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 10, 2023 Author Report Share Posted March 10, 2023 (edited) p.s. I also tried with .../templates/template_unit.xml like this: <?xml version="1.0" encoding="utf-8"?> <Entity> <AIProxy/> <Cost> <Population>1</Population> <BuildTime op="mul">3</BuildTime> <Resources> <food op="mul">3</food> <wood op="mul">3</wood> <stone op="mul">3</stone> <metal op="mul">3</metal> </Resources> </Cost> <Decay> .... I copied entire file from community-mod and just changed these two: <Resources> and <BuildTime> But no change, no error, nothing. Edited March 10, 2023 by BeTe Quote Link to comment Share on other sites More sharing options...
maroder Posted March 11, 2023 Report Share Posted March 11, 2023 ah my bad, I read too quickly. You also need to line "autoResearch": true, in the tech json, so that it actually gets researched. See e.g: https://github.com/0ad/0ad/blob/6ed56a0f237f42b552da5efb1fe05102f82d7159/binaries/data/mods/public/simulation/data/technologies/civbonuses/han_population.json#L3 Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 11, 2023 Author Report Share Posted March 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Stan` Posted March 11, 2023 Report Share Posted March 11, 2023 No wildcards are not supported. 1 Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 11, 2023 Author Report Share Posted March 11, 2023 (edited) I am very much looking for your feedback, suggestions etc. Edited March 11, 2023 by BeTe Quote Link to comment Share on other sites More sharing options...
alre Posted March 14, 2023 Report Share Posted March 14, 2023 just double health instead of resistance. that should work. 1 Quote Link to comment Share on other sites More sharing options...
alre Posted March 14, 2023 Report Share Posted March 14, 2023 also you would need to double the number of arrows for each unit garrisoned, or something like that. by the way, you should try the turbo mode by freagarach. 1 Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 14, 2023 Author Report Share Posted March 14, 2023 @alreAh yeah. Omg, initially I had plan to increase health but I messed up with resistance. Yes double arrows or double power of arrows... Not sure what's better... I guess it's same. Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 14, 2023 Author Report Share Posted March 14, 2023 (edited) @alreOh, I did added 2x health, not sure why I added also resistance. If someone wants to try, I attached mod. I think this should be used in TGs where lag is insane! 0ad_fewer_units-0.0.1.zip Edited March 14, 2023 by BeTe Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 14, 2023 Author Report Share Posted March 14, 2023 Fixed few details... Anyone knows why batch training doesn't work anymore? 0ad_fewer_units-0.0.3.zip Quote Link to comment Share on other sites More sharing options...
Stan` Posted March 15, 2023 Report Share Posted March 15, 2023 @BeTe would you like to make available through 0ad.mod.io ? 1 Quote Link to comment Share on other sites More sharing options...
BeTe Posted March 15, 2023 Author Report Share Posted March 15, 2023 36 minutes ago, Stan` 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... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.