azayrahmad 175 Posted March 28 Report Share Posted March 28 (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 2 hours ago by azayrahmad vid 7 4 Quote Link to post Share on other sites
wowgetoffyourcellphone 6.880 Posted March 29 Report Share Posted March 29 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. 2 Quote Link to post Share on other sites
Alexandermb 3.863 Posted March 29 Report Share Posted March 29 I don't log often this days due to heavy work, but man this deserves a medal! 3 1 Quote Link to post Share on other sites
azayrahmad 175 Posted March 30 Author Report Share Posted March 30 (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 by azayrahmad 1 2 Quote Link to post Share on other sites
azayrahmad 175 Posted Monday at 08:02 Author Report Share Posted Monday at 08:02 (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 Monday at 08:08 by azayrahmad 4 Quote Link to post Share on other sites
azayrahmad 175 Posted 3 hours ago Author Report Share Posted 3 hours ago 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 post Share on other sites
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.