Jump to content

azayrahmad

Community Members
  • Posts

    270
  • Joined

  • Last visited

Posts posted by azayrahmad

  1. 1 hour ago, Stan` said:

    don't see how the latter doesn't have a gameplay impact?

    I'm sorry that came out wrong. I mean different gameplay impact. Batch training is not so much automation as it is also incentivizing bulk purchase. Therefore both can exist together. 

    • Like 1
  2. On 15/4/2021 at 1:03 AM, wowgetoffyourcellphone said:

    Batch Training was introduced to minimize micro (a train time incentive is used to encourage its use as well). Isn't this a competing feature?

    I'd argue that they are complimenting each other. Batch training has gameplay impact though, while auto queue simply let you focus on other things beside 'always creating citizen' micro. 

    • Thanks 1
  3. Regarding the historical background, I found a relevant article from WorldHistory.com (previously Ancient.eu). Excerpts:

    Quote

     

    The most important effect of elephants in the field was probably, then, a psychological one. These huge beasts would have terrified men and horses both visually and orally with their trumpeting. Even the smell of elephants could drive unprepared horses into a stampede. Starting the battle in a simple line in front of their own troops they could cause undisciplined and poorly trained cavalry lines to scatter in panic. They were also used to combat any elephants in the opposition's ranks. Tossing, ripping, and crushing the enemy, elephants were used to cause havoc with any defensive fieldworks and fortifications too, where they knocked down walls with their foreheads or pulled them down with their trunks.

    Elephant corps did not have everything their own way, of course. Firstly, both soldiers and cavalry horses were trained to get used to the sight, smell, and sounds of elephants. Then they obviously provided large targets for artillery fire. Pits and spikes were prepared to entrap them and, if they could get close enough, men were charged with hamstringing the beasts or hacking at their trunks. This latter eventuality was, in part, avoided by the stationing of a small team of infantry to protect the elephant's legs. If the elephant were wounded then all hell might break lose as, unpredictable at the best of times, wounded elephants could literally go mad and cause tremendous damage to both sides. If this happened the rider used a metal spike and hammer to pierce the elephant's brain and kill it immediately.

     

    So I guess this mod is pretty spot-on, at least according to the article.

    I think I just got an idea on elephant morale for my mod...

    • Like 1
  4. 17 hours ago, maroder said:

    I have found no example where a technology is used to revert the effect of an aura

    Great adaptation, @maroder! Perhaps create a new class e.g. Habituated. Or add Basic class to the aura so advance /elite units are not affected.

    As to @faction02's concern, I think it could be mitigated by tweaking the aura range, i.e. should be within elephant's attack range so fleeing enemies can still be killed.

    • Like 1
    • Thanks 1
  5. Darn it I knew I must not be the only one trying to implement this feature here. I searched for 'queue' and 'auto queue' in this forum and found nothing relevant. 

    To answer @seeh's question, yes it is the exact same functionally. The only difference beside the name is that autociv uses hotkey and my proposed mod uses button.

    I think I'm going to add hotkey to my mod.

    • Like 1
    • Thanks 1
  6. Auto-Queue is an ability of a building to loop through production queue indefinitely as long as resources and population limits permit it. So instead of training units repeatedly, you can simply set the queue once and set the building to auto-queue. If you played Age of Mythology you probably have used this features. In Rise of Nations it's called Infinite Queue.

    I have searched through the forum in case this topic has been discussed before, but I can't find any. So I decided to make a small mod to demonstrate this feature, inspired mostly from RoN's infinite queue. I attached the mod below (also accessible from GitHub). Here is the screenshot of 0 A.D (Alpha 24b release) using Auto-Queue mod. The button is accessible in middle panel at the bottom (command section, beside delete and rally point button).

    screenshot0002.thumb.png.f52f272b80a97d198a209fe11a559ed2.png

    When the button is toggled on, units in queue will be indefinitely looped. It doesn't work with technologies as they are one time only. 

    I know that auto-queue is generally considered as a rather controversial feature in RTS, as it is reducing micro but also can be dangerous if left unattended. I personally think that 0 A.D. vision is to reduce repetitive actions, so this feature is a must. What do you think about adding auto-queuing in 0 A.D?

    0AD-Auto-Queue.zip

    • Like 7
    • Thanks 3
  7. 14 minutes ago, maroder said:

    Version 0.03: Added nice but very hacky fire effects to the palisades

    Very nice... I think you could reduce the damage variants to only 3/4 variants. Now I've got an idea of spreading fires through palisades...

    I've also thought on removing defense and dropsite capability of civic centers. However I realized that civic centers in 0 AD is based on AoE games, which is meant to be the first and eventually the last building you'll ever have in the game, and thus needs all basic economic and defense capabilities for a city to survive.

    My suggestion is to do it like Stronghold games, by giving free first granary and stockpile. In 0 AD case, free first farmstead/storehouse and small tower. You could make separate templates for them (like template_structure_defensive_tower_free.xml), set the cost to 0, and limit this to 1 per civic center. I haven't use AutoBuildable component, but I imagine this would be able to be used in such scenario.

    Good luck with your mod!

    • Like 1
  8. 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!

    • Like 5
  9. On 18/03/2020 at 1:58 AM, Stan` said:

    image.png

    In A24 there will be support for status effects, So I tried to make a few icons in preparation. I also added new icons to the list above.

    image.png

    Why didn't I spot this thread sooner... These status effects icons are cool, and foreshadows what may come to 0AD (frozen effect, terrain/biome effects are coming to 0AD?)

    • Like 1
  10. I think someone has proposed here in this forum that deleting building should decrease building HP gradually, and I agree with it. This proposal sounds similar. 

    In addition to this idea id also like to add that building deletion should be able to be cancelled. This is useful to prevent accidental deletion and allow opponent to retake captured building and stop the process. 

    Also I think instead of calling it deletion it should be called salvaging since we got loot from it. 

    • Like 3
  11. 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. 

    • Like 1
    • Thanks 3
  12. 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. 

    screenshot0008.png.c4240e4c3a497f8eca219b96f7b60cd4.thumb.png.35e13028b31510d827116b4e76512053.png

    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). 
    • Like 10
    • Thanks 7
  13. Thanks @wraitii for your help!

    It turns out that OnRangeUpdate seems to not detect entity once it is destroyed, so the solution is to reverse how ApplyMoraleInfluence and RemoveMoraleInfluence work. Previously the unit applies aura to other units in range, now I reversed it so all units in range applies the effect to the unit instead. I haven't tested this thoroughly but so far it seems to be okay.

    OnDestroy seems to be what I just looking for. Perhaps for morale damage on death instead of mucking around in Health component.

    That stackability trick is neat. I wonder why Aura component do it like that, your comment explains it well, thank you.

  14. Hi @Freagarach,

    Yes, I realized that I had misnamed the variable, already fixed now.

    In addition to stackable problem above, I found that OnRangeUpdate does not trigger for other units if a unit is killed. So if unit A is applying effect to unit B in range, and then unit A is killed, unit B still has effect applied

    Debugging current code shown that the effect removal (RemoveMoraleInfluence) does not trigger for unit B. However if in this case unit B is killed instead, the removal is triggered (removing effect applied from unit A to unit B as unit B is no longer in range).

    Do you perhaps have any idea how to solve this? i.e. ensure that killing units also remove its effect?

    Thank you.

  15. Hi @Freagarach

    I finally found out why it didn't work.Applying the morale regeneration must be looped per entity. So e.g. ApplyMoraleInfluence must be:

    Morale.prototype.ApplyMoraleInfluence = function(ents)
    {
        var cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager);
        for (let ent of ents)
        {
            cmpModifiersManager.AddModifiers(
                "MoraleSupport",
                {
                    "Morale/RegenRate": [{ "affects": ["Unit"], "add": this.GetMoraleLevel() }],
                },
                ent
            );
        }
    }

    Not sure why cmpModifiersManager cannot apply to all entities at once like in ApplyMorale, perhaps there's something to do with the format of entities retrieved from this function:

    let affectedPlayers = cmpPlayer.GetAllies();

    Apparently cmpModifiersManager.AddModifiers cannot be applied to affectedPlayers all at once, need to be looped per entity.

    EDIT: Although after further tests, I see that the effect do not stack, i.e. the RegenRate would stay the same once modified, therefore multiple units in the same range do not have their morale increased exponentially. I already added True at the end of AddModifiers but it seems to change nothing. Like this:

            cmpModifiersManager.AddModifiers(
                "MoraleAllies",
                {
                    "Morale/RegenRate": [{ "affects": ["Unit"], "add": this.GetMoraleLevel() }],
                },
                ent,
                true,
            );

    If you or anyone reading this know how to fix this, I would be very thankful.

    Thanks!

×
×
  • Create New...