Jump to content

Conversion system


Recommended Posts

Unitai.js It's definitely a monstrosity.

What a difficult thing, no wonder no one tries to introduce new commands and components lately.

https://gitea.wildfiregames.com/0ad/0ad/issues/2579

This is going to be a wall to break down in my project, that is: trying to implement conversion in unit AI.

 

downloadfile.png

Edited by Classic-Burger
Link to comment
Share on other sites

@Classic-Burger, why don't you use the existing capture system? Would be much easier.

Probably works right away with only few tweaks in templates: 

I) Add a capture attack to template_unit_support_healer.xml

Spoiler
    <Attack>
        <Capture>
            <AttackName>Capture</AttackName>
            <Capture>30</Capture>
            <MaxRange>30</MaxRange>
            <RepeatTime>1000</RepeatTime>
            <RestrictedClasses datatype="tokens">Structure</RestrictedClasses>
        </Capture>
    </Attack>

II) Add capture points to all units you want to be able to be converted (you can also then put different values in hero, champion templates...)

Spoiler
  <Capturable>
    <CapturePoints>50</CapturePoints>
    <RegenRate>5</RegenRate>
  </Capturable>

Just tested it and it seems seamless.

If you really want to add some randomization too into the capture then you could afterward add it to Capturable.js, but you could do it now in 2 lines of code too.

Link to comment
Share on other sites

37 minutes ago, Atrik said:

why don't you use the existing capture system? Would be much easier.

In theory I want it to work differently, I want it to have a cooldown and cost faith or power/mana. 

The other thing is to prevent what happened with the catapults, a few alphas ago. Then it looked like a tennis match.

Link to comment
Share on other sites

1 hour ago, Atrik said:

@Classic-Burger, why don't you use the existing capture system? Would be much easier.

Probably works right away with only few tweaks in templates: 

I) Add a capture attack to template_unit_support_healer.xml

  Reveal hidden contents
    <Attack>
        <Capture>
            <AttackName>Capture</AttackName>
            <Capture>30</Capture>
            <MaxRange>30</MaxRange>
            <RepeatTime>1000</RepeatTime>
            <RestrictedClasses datatype="tokens">Structure</RestrictedClasses>
        </Capture>
    </Attack>

II) Add capture points to all units you want to be able to be converted (you can also then put different values in hero, champion templates...)

  Reveal hidden contents
  <Capturable>
    <CapturePoints>50</CapturePoints>
    <RegenRate>5</RegenRate>
  </Capturable>

Just tested it and it seems seamless.

If you really want to add some randomization too into the capture then you could afterward add it to Capturable.js, but you could do it now in 2 lines of code too.

By the way, it is not just one implementation that I will try.

Thanks for the recommendation. The official ticket says there are several planned implementations.

For now I'm looking for the AoE II based implementation.

  • Like 1
Link to comment
Share on other sites

<Entity parent="template_unit_support_healer">

    <Convert>

        <Range>20</Range>

        <ChancePerSecond>0.05</ChancePerSecond>

        <Interval>1000</Interval>

        <Cooldown>5000</Cooldown>

        <Cost>

            <faith>50</faith>

        </Cost>

        <FaithRegenRate>1</FaithRegenRate>

        <MaxFaith>100</MaxFaith>

        <CurrentFaith>100</CurrentFaith>

        <UnconvertibleClasses>Hero Mechanical Siege</UnconvertibleClasses>

        <ConvertibleClasses>Infantry Cavalry Support</ConvertibleClasses>

        <RangeOverlay>

            <LineTexture>heal_overlay_range.png</LineTexture>

            <LineTextureMask>heal_overlay_range_mask.png</LineTextureMask>

            <LineThickness>0.35</LineThickness>

        </RangeOverlay>

    </Convert>

</Entity>

Faith. Auto-regeneration  of faith.Maximum faith.

Cooldown: It would be a waiting time in video games before using a skill.

Chance: It is done randomly, it is not similar to capture, in capture you do not fail, if you have freedom that your unit is not stopped.If you fail, you waste faith and have to start over. The chance is given per second.

Edited by Classic-Burger
Link to comment
Share on other sites

Edit:I was wrong, the Babylonian priests cast curses, they do not convert.

Conversion from AoEO project Celeste.

Limit of Conversions: A single Priest cannot convert an entire army at once. He can only convert one unit at a time and must wait for his ability to recharge (cooldown) before attempting to convert another.

- Immunity after Conversion: Units that have just been converted are immune to being converted again for a short period of time. This prevents "ping-ponging" of units between two players with priests.

Edited by Classic-Burger
Link to comment
Share on other sites

https://ageofempiresonline.fandom.com/wiki/Priest

I like that they are culturally different; we could have Greeks who, instead of being priests, are sophists or philosophers.

The Romans could have senators or politicians who bribed.

The Celts could heal and fight.

And Middle Eastern religions could be more powerful with conversion.

Link to comment
Share on other sites

5 hours ago, Classic-Burger said:

https://ageofempiresonline.fandom.com/wiki/Priest

I like that they are culturally different; we could have Greeks who, instead of being priests, are sophists or philosophers.

The Romans could have senators or politicians who bribed.

The Celts could heal and fight.

And Middle Eastern religions could be more powerful with conversion.

Druid Druid, a Celtic priest that can attack and heal units in combat while also boosting damage of the healing unit.
That sounds cool, actually. 

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

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

 Share

×
×
  • Create New...