azayrahmad Posted March 28, 2021 Report Share Posted March 28, 2021 (edited) Overview This mod adds morale system to 0 A.D. Please read an overview of morale in Wikipedia page here. This mod tries to represent military morale and to some extent also employee morale (for workers). Morale system here is inspired from a mix between Total War and Stronghold style morale. So basically the higher the morale, the better your units at gathering, building, and fighting, and vice versa. Morale is influenced by unit's health, being attacked, being near other units, etc. On a very low morale, units will flee the battlefield. I originally develop this mod for Happiness system in my City Building Mod, however it became more complicated so I decided to release it separately as Morale system. Therefore, this mod is designed to be as bare-boned and customizable as possible, so it will be compatible to many mods, although the mod should be quite playable as it is. Features Every unit has morale icon to represent its current state. Some aspects that can influence unit morale: Presence of other units on viewing distance. Allies increase morale and enemies decrease morale. Being attacked. Arrow shots would decrease morale, even if it missed. Health increase/decrease. Morale would increase/decrease accordingly. Unit death would cause significant morale decrease to nearby allies and vice versa. Low morale can cause a unit to have decreased gathering rate, building rate, and attack rate. Extremely low morale cause unit to flee from enemy and became passive. Units reaching max morale would cheer and start becoming violent. Structures can also have morale. Structures with low morale can have reduced attacks speed and also slower training and research time. Garrison units with high morale inside for increased morale. Some variables that can be customized for further modding (mostly need to edit component variable but later planned to be customizable via template): Significance (the higher unit significance the higher influence it has on nearby units) Range (by default it uses unit vision but can be altered) RegenRate (default morale regenerate rate) etc (please look at Init function of Morale.js) Installation Clone or download the mod from GitHub page to My Games/0ad/mods folder. (I will add mod.io link later) Contribute This mod is very much a work in progress. Everyone is certainly welcome to contribute by testing the mod and tell me what you think! If you found issue or have some ideas you'd like to implement, feel free to discuss here or even create Pull Request to the GitHub repo. I also currently have no access to a better quality computer to create high quality screenshot/video preview, so you can share your screenshots here as well! Credits Thank you very much to: @Freagarach, @wraitii for helping out on problems I encountered with some components (see the discussion behind the scene here) @Grapjasfor letting me adapt his Wounded feature from Grapejuice mod (another interesting mod you should check) @wowgetoffyourcellphone for arrow morale damage suggestion and fear units (implementable by Significance, but not yet). Edited April 15, 2021 by azayrahmad vid 10 7 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 29, 2021 Report Share Posted March 29, 2021 15 hours ago, azayrahmad said: Unit death would cause significant morale decrease to nearby allies and vice versa. Nice. You could make the presence of a hero give a morale boost, while his/her death would cause a morale decrease. 3 Quote Link to comment Share on other sites More sharing options...
Alexandermb Posted March 29, 2021 Report Share Posted March 29, 2021 I don't log often this days due to heavy work, but man this deserves a medal! 5 2 Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted March 30, 2021 Author Report Share Posted March 30, 2021 (edited) On 29/3/2021 at 10:34 AM, wowgetoffyourcellphone said: Nice. You could make the presence of a hero give a morale boost, while his/her death would cause a morale decrease. This is achievable using Significance, which multiplies morale regenerate rate effect and death instant morale damage/bonus to nearby enemies/allies. However I avoid editing template files for now to keep compatibility with as many Alpha versions and mods as possible. I'd probably release template changes either as separate mod or as part of City Building mod. Edited March 30, 2021 by azayrahmad 1 3 Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted April 12, 2021 Author Report Share Posted April 12, 2021 (edited) Recent changelog: Improved fleeing behavior (low morale units flee when sighting enemy or being attacked) Unit Stance change based on morale (low morale units automatically have Passive stance, high morale units have Violent stance). Units reaching maximum morale will cheer. Average morale display on multiple units selection in selection panel. Morale for structures is now supported, complete with garrison morale effect and capture points reduction on low morale. Plans for next updates: Improve performance (currently noticeable in large battles, but should be fine on smaller maps). Rage/amok behavior (raging unit attacks both ally and enemy) Multipliers for specific classes (e.g. cavalry should decrease enemy infantry morale more, or camel's stench should decrease cavalry morale for allies and enemies alike). Player's multiplier (players with bigger city and more kills will decrease enemies' morale more) Complete morale setting differentiation of different unit types and ranks and also structures. (Higher ranks units, champions and heroes should have higher Significance and max morale) Complete code documentation to make the mod easier to use as dependency for other mods. Let me know if you guys have some more suggestions! Edited April 12, 2021 by azayrahmad 5 Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted April 15, 2021 Author Report Share Posted April 15, 2021 A preview of Morale System on Gaul (me) vs Rome (AI) swordsmen fight. 0AD 24b. Due to UnitAI that makes units in formation break formation while attacking, manual interventions are needed to ensure the Gaul swordsmen to stay in formation. 4 Quote Link to comment Share on other sites More sharing options...
azayrahmad Posted April 29, 2021 Author Report Share Posted April 29, 2021 (edited) Recent changelog: Cheat codes for morale. Type 'moralize' or 'demoralize' on selected unit(s) to fill up or empty morale respectively. Flank morale bonus. Units attacked from the side or behind deplete morale faster. Class morale bonus. Units can have morale influence bonus on specific classes and alliance. Template differentiation. Now units with different classes and ranks have different morale points and significance. Code has been documented for easier modding. Separate Morale and Influence. It is now possible for an entity to have influence without being affected itself. 0AD-morale-system-0.0.1.pyromod Edited April 29, 2021 by azayrahmad Add template differentiation 5 Quote Link to comment Share on other sites More sharing options...
soloooy0 Posted April 29, 2021 Report Share Posted April 29, 2021 Then civs will have morale bonuses, whether they use formation or not Romans and Greeks, with closed formations will have bonuses, on the other hand the Celts and Iberians in open formations or without formations The naked fans and the fire cav iber will have more morale than normal if they go alone and have more than x% HP i love this concept Quote Link to comment Share on other sites More sharing options...
Lopess Posted April 29, 2021 Report Share Posted April 29, 2021 Congratulations on the great work Azayrahmad! 1 2 Quote Link to comment Share on other sites More sharing options...
LienRag Posted September 26, 2021 Report Share Posted September 26, 2021 Formations should have a very important role on morale, shouldn't they ? (going both way : units with low morale leaving formation - historically, mainly from the rear, that's one of the reasons to have multiple ranks - and units still in formation getting some morale bonus, the level of which depends on the formation) Quote Link to comment Share on other sites More sharing options...
myou5e Posted June 12, 2022 Report Share Posted June 12, 2022 Just want to say this looks fantastic :-). Would love to get this working on A26 I guess a few changes would need to be made now :-p Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 12, 2022 Report Share Posted June 12, 2022 Wow, this is incredible. Glad I came across it. Will you release another update? If so, it would be cool if the units with super low morale could switch sides. It would be great for my mod where I could implement a morale system for my Lords who could lose morale and turn against me if I don't keep them happy. 1 Quote Link to comment Share on other sites More sharing options...
myou5e Posted June 12, 2022 Report Share Posted June 12, 2022 26 minutes ago, LordStark said: If so, it would be cool if the units with super low morale could switch sides. I would LOVE this, especially for Mercenaries in my opinion. Mercenaries aren't going to die for you haha. This has always been their problem, so paying them off or cornering them could be an important strategy. 1 Quote Link to comment Share on other sites More sharing options...
LordStark Posted June 12, 2022 Report Share Posted June 12, 2022 Yes, good point. I would only want certain units to be potentially traitors. Perhaps it could be a option that we can mod into the units ourselves. I would have my Lords and Mercenaries as potential traitors but the Men at Arms of my retinue are 100% loyal. Also, it would be good if there was some way that a group of units could betray you together. As an example, if it were a feature in my mod, one of my Lords might have an aura that can be used to convert nearby citizen soldiers ((but not the main Lord's (the player) Men at Arms) to him which he stitches sides. 1 Quote Link to comment Share on other sites More sharing options...
myou5e Posted June 12, 2022 Report Share Posted June 12, 2022 (edited) 14 minutes ago, LordStark said: Yes, good point. I would only want certain units to be potentially traitors. Perhaps it could be a option that we can mod into the units ourselves. I would have my Lords and Mercenaries as potential traitors but the Men at Arms of my retinue are 100% loyal. Also, it would be good if there was some way that a group of units could betray you together. As an example, if it were a feature in my mod, one of my Lords might have an aura that can be used to convert nearby citizen soldiers ((but not the main Lord's (the player) Men at Arms) to him which he stitches sides. Yes I would agree. I think certain units would have very high morale and they would fight more ferociously when wounded, rather than betray you. This could apply to Norse maybe, and a lot of elite units and heroes. Edited June 12, 2022 by myou5e spelling Quote Link to comment Share on other sites More sharing options...
LienRag Posted April 28, 2023 Report Share Posted April 28, 2023 On 12/06/2022 at 3:21 PM, myou5e said: I would LOVE this, especially for Mercenaries in my opinion. Mercenaries aren't going to die for you haha. This has always been their problem, so paying them off or cornering them could be an important strategy. Interesting indeed, especially if there's an upkeep for Mercenaries, and the mercenaries' morale largely depends on whether this upkeep is paid in full or not. 1 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.