Author Topic: A few new things  (Read 7454 times)

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
A few new things
« on: 25 June 2011, 22:05:52 »
Elimnator and Tiger asked for it so here it is:

With svn version you can now:

#1. have multiple models per skill example:

Code: [Select]
<skill>
<type value="stop"/>
<name value="stop_skill"/>
<ep-cost value="0"/>
<speed value="1000"/>
<anim-speed value="45"/>

<animation-random-cycle-maxcount value="1" />
<animation path="models/archer_standing.g3d" />
                        <animation path="models/archer_walking.g3d" />
<sound enabled="false"/>
</skill>

<animation-random-cycle-maxcount value="1" />

This optional node tells the engine to cycle through a maximum of 1 random models (useful for death animations, pick a random one but don't switch to another after it finishes animating). If this node does not exist we assume no maximum

You simply stack the animation nodes in the skill and we will pick random models each time from that list.

To FORCE a particular model to be used when the unit's HP are within a certain range you may add the optional fromHp and toHp attributes:

<animation path="models/archer_walking.g3d" minHp="0" maxHp="7" />

This would tell the engine to always pick this model when the units hp is between 0 and 7

#2: Define attack-boost information per skill. Think of attack-boost as a 'temporary upgrade' which is associated to a skill of a unit. Once 'affected' units com within the range of the units attack-boost radius, a special upgrade + particles are applied while the affected units are in this radius, example:

Code: [Select]
<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="50"/>
<anim-speed value="50"/>
<animation path="models/archer_attacking.g3d"/>
<sound enabled="true" start-time="0.5">
<sound-file path="/sounds/archer_attack1.wav"/>
<sound-file path="/sounds/archer_attack2.wav"/>
<sound-file path="/sounds/archer_attack3.wav"/>
<sound-file path="/sounds/archer_attack4.wav"/>
</sound>
<attack-strenght value="100"/>
<attack-var value="50"/>
<attack-range value="10"/>
<attack-type value="piercing"/>
<attack-start-time value="0.5"/>
<attack-fields>
<field value="land"/>
<field value="air"/>
</attack-fields>

                        <attack-boost>
<allow-multiple-boosts value="false" />
<radius value="5"/>
                        <target value="faction"> <!-- ally foe faction unit-types all -->
<!-- <unit-type value="catapult" /> -->
                                </target>

<max-hp value="100"/>
<max-ep value="0"/>
<sight value="5"/>
<attack-strenght value="6"/>
<attack-range value="0"/>
<armor value="10"/>
<move-speed value="0"/>
<production-speed value="0"/>

<particles value="true">
<originator-particle-file path="glow_particles.xml"/>
<affected-particle-file path="glow_particles.xml"/>
</particles>

                        </attack-boost>

<projectile value="true">
<particle value="true" path="particle_proj.xml"/>
<sound enabled="true">
<sound-file path="/sounds/arrow_hit1.wav"/>
<sound-file path="/sounds/arrow_hit2.wav"/>
<sound-file path="/sounds/arrow_hit3.wav"/>
<sound-file path="/sounds/arrow_hit4.wav"/>
<sound-file path="/sounds/arrow_hit5.wav"/>
</sound>
</projectile>
<splash value="false"/>
</skill>


Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #1 on: 25 June 2011, 22:32:00 »
Add to wiki please? I did too much today (over 30kb) and haven't got enough feeling left in my fingers to do it...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: A few new things
« Reply #2 on: 25 June 2011, 22:38:16 »
Once its fully tested and final changes are made it will be fully documented on the wiki.

The VBros are working out any issues they find as they test it in their mods.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #3 on: 25 June 2011, 22:48:26 »
Once its fully tested and final changes are made it will be fully documented on the wiki.

The VBros are working out any issues they find as they test it in their mods.
Mmk. A suggestion then, if willing to expand, would be to add multipliers too to number 2 (puns not intended). Static modifiers are great, but taking away 100 health is biased towards the weaker foes with very little health, where that could be 20% of their max, but almost nothing to a strong unit with, say, 2000 hp, where that would only be 5%. The solution is multipliers, a number that will multiply the stat. For example, increasing your units HP by 10% (a multiplier of 1.1) would be more consistent and is relative to the unit's abilities.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: A few new things
« Reply #4 on: 26 June 2011, 00:36:01 »
Wow great stuff softcoder! I kinda want to try this stuff out as well.

I do agree with omega about multipliers. If ut not to busy of course. ;)
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

Mr War

  • Guest
Re: A few new things
« Reply #5 on: 26 June 2011, 02:56:00 »
Great stuff siftcoder, I can see good uses for this in my mods, I think it'll make gameplay and feel better

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: A few new things
« Reply #6 on: 26 June 2011, 04:05:48 »
Yes multipliers are an excellent idea. On another note, anyone who compiles from svn, you might be able to enter your native language characters now (German, Chinese, Italian etc), I changed stuff today and so far Tomreyn says he's able to type his special German characters in game :)

Edit:

Ok svn has support for multipliers: (static values are the default, but you can tell it to make the value a multiplier by adding a special attribute on the node). Below would add 300% to the units move speed. These tags ALSO should work for normal upgrades as well.

Code: [Select]
<move-speed value="300" value-percent-multipler="true" />
Update:

Any Windows users who want to try this out I have a current Windows binary snapshot here:

http://www.soft-haus.com/glest/temp/megaglest3.5.3-dev_i386_win32_bin.exe

Here is a sample of my XML file where I edited TECH's archer xml and added multiple animations for the 'stop_skill'. Likewise I added an 'attack-boost' to the archers 'attack_skill' so that and unit in the archers own faction that is within the radius if 5 cells will get a temporary upgrade of +100 hp, +5 sight, +6 attack strength, +!0 armor, * 300 (multiplier) move speed. When this boost is 'active' the archer AND the affected units will 'glow' similar to the genie does in Persian.

Code: [Select]
<?xml version="1.0" standalone="no"?>

<unit>
<parameters>
<size value="1"/>
<height value="3"/>
<max-hp value="700" regeneration="0"/>
<max-ep value="0"/>
<armor value="20"/>
<armor-type value="leather"/>
<sight value="15"/>
<time value="60"/>
<multi-selection value="true"/>
<cellmap value="false"/>
<levels>
<level name="elite" kills="5"/>
</levels>
<fields>
<field value="land"/>
<field value="air"/>
</fields>
<properties/>
<light enabled="false"/>
<unit-requirements>
<unit name="barracks"/>
</unit-requirements>
<upgrade-requirements/>
<resource-requirements>
<resource name="wood" amount="50"/>
<resource name="gold" amount="100"/>
<resource name="food" amount="1"/>
</resource-requirements>
<resources-stored/>
<image path="images/archer.bmp"/>
<image-cancel path="images/tech_cancel.bmp"/>
<meeting-point value="false"/>
<selection-sounds enabled="true">
<sound path="sounds/archer_select1.wav"/>
<sound path="sounds/archer_select2.wav"/>
<sound path="sounds/archer_select3.wav"/>
<sound path="sounds/archer_select4.wav"/>
<sound path="sounds/archer_select5.wav"/>
<sound path="sounds/archer_select6.wav"/>
<sound path="sounds/archer_select7.wav"/>
<sound path="sounds/archer_select8.wav"/>
<sound path="sounds/archer_select9.wav"/>
<sound path="sounds/archer_select10.wav"/>
<sound path="sounds/archer_select11.wav"/>

</selection-sounds>
<command-sounds enabled="true">
<sound path="sounds/archer_ack1.wav"/>
<sound path="sounds/archer_ack2.wav"/>
<sound path="sounds/archer_ack3.wav"/>
<sound path="sounds/archer_ack4.wav"/>
<sound path="sounds/archer_ack5.wav"/>
<sound path="sounds/archer_ack6.wav"/>
<sound path="sounds/archer_ack7.wav"/>
<sound path="sounds/archer_ack8.wav"/>
<sound path="sounds/archer_ack9.wav"/>
<sound path="sounds/archer_ack10.wav"/>
<sound path="sounds/archer_ack11.wav"/>
<sound path="sounds/archer_ack12.wav"/>
<sound path="sounds/archer_ack13.wav"/>
<sound path="sounds/archer_ack14.wav"/>
<sound path="sounds/archer_ack15.wav"/>
</command-sounds>
</parameters>

<skills>

<skill>
<type value="stop"/>
<name value="stop_skill"/>
<ep-cost value="0"/>
<speed value="1000"/>
<anim-speed value="45"/>
<animation path="models/archer_standing.g3d" />
                        <animation path="models/archer_walking.g3d" />
<sound enabled="false"/>
</skill>

<skill>
<type value="move"/>
<name value="move_skill"/>
<ep-cost value="0"/>
<speed value="220"/>
<anim-speed value="125"/>
<animation path="models/archer_walking.g3d"/>
<sound enabled="false"/>
</skill>

<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="50"/>
<anim-speed value="50"/>
<animation path="models/archer_attacking.g3d"/>
<sound enabled="true" start-time="0.5">
<sound-file path="/sounds/archer_attack1.wav"/>
<sound-file path="/sounds/archer_attack2.wav"/>
<sound-file path="/sounds/archer_attack3.wav"/>
<sound-file path="/sounds/archer_attack4.wav"/>
</sound>
<attack-strenght value="100"/>
<attack-var value="50"/>
<attack-range value="10"/>
<attack-type value="piercing"/>
<attack-start-time value="0.5"/>
<attack-fields>
<field value="land"/>
<field value="air"/>
</attack-fields>

                        <attack-boost>
<allow-multiple-boosts value="false" />
<radius value="5"/>
                         <target value="faction"> <!-- ally foe faction unit-types all -->
<!-- <unit-type value="catapult" /> -->
                                </target>

<max-hp value="100"/>
<max-ep value="0"/>
<sight value="5"/>
<attack-strenght value="6"/>
<attack-range value="0"/>
<armor value="10"/>
<move-speed value="300" value-percent-multipler="true" />
<production-speed value="0"/>

<particles value="true">
<originator-particle-file path="glow_particles.xml"/>
<affected-particle-file path="glow_particles.xml"/>
</particles>

                        </attack-boost>

<projectile value="true">
<particle value="true" path="particle_proj.xml"/>
<sound enabled="true">
<sound-file path="/sounds/arrow_hit1.wav"/>
<sound-file path="/sounds/arrow_hit2.wav"/>
<sound-file path="/sounds/arrow_hit3.wav"/>
<sound-file path="/sounds/arrow_hit4.wav"/>
<sound-file path="/sounds/arrow_hit5.wav"/>
</sound>
</projectile>
<splash value="false"/>
</skill>

<skill>
<type value="die"/>
<name value="die_skill"/>
<ep-cost value="0"/>
<speed value="60"/>
<anim-speed value="60"/>

<animation-random-cycle-maxcount value="1" />
<animation path="models/archer_dying.g3d"/>
<animation path="models/archer_attacking.g3d"/>
<sound enabled="true" start-time="0">
<sound-file path="sounds/archer_die1.wav"/>
<sound-file path="sounds/archer_die2.wav"/>
<sound-file path="sounds/archer_die3.wav"/>
<sound-file path="sounds/archer_die4.wav"/>
</sound>
<fade value="false"/>
</skill>

</skills>

<!-- *** commands *** -->

<commands>

<command>
<type value= "stop"/>
<name value="stop"/>
<image path="images/tech_stop.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<stop-skill value="stop_skill"/>
</command>

<command>
<type value="move"/>
<name value="move"/>
<image path="images/tech_move.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
</command>

<command>
<type value="attack"/>
<name value="attack"/>
<image path="images/archer_attack.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
<attack-skill value="attack_skill"/>
</command>

<command>
<type value="attack_stopped"/>
<name value="hold_position"/>
<image path="images/tech_hold.bmp"/>
<unit-requirements/>
<upgrade-requirements>
<upgrade name="training_field"/>
</upgrade-requirements>
<stop-skill value="stop_skill"/>
<attack-skill value="attack_skill"/>
</command>

</commands>
</unit>


Did a lot of testing and fixed some bugs related to these new features, also added (in svn):

- support for png textures for Water in tiles

Code: [Select]
<parameters>
<water effects="true">
<texture path="water/water_1.png"/>
<texture path="water/water_2.png"/>
<texture path="water/water_3.png"/>

                       etc..
- min/max hp values for damage particles:

Code: [Select]
<damage-particles value="true">
<particle-file path="fire_particles1.xml" minHp="4000" maxHp="5000"/>
<particle-file path="fire_particles2.xml" minHp="1000" maxHp="3999"/>
<particle-file path="fire_particles3.xml" minHp="1" maxHp="999"/>
</damage-particles>
« Last Edit: 2 July 2011, 00:26:25 by softcoder »

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: A few new things
« Reply #7 on: 6 July 2011, 02:15:48 »
OK, I have been using the new stuff and here is an example pic:

Download my new Creek faction to try some new stuff.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #8 on: 6 July 2011, 06:08:08 »
Oh, wow, didn't notice that you edited your post. Thankfully Elim bumped it. Since it's now in the SVN and has a mod that uses some of the features, I think it's time to document it properly. I can happily do that if you supply a bit more information, or you can do so yourself.

I think multiple animations may be in there, not sure, if it is though, we'd probably have to add the min-hp and max-hp parameters. Question first: What happens if these parameters overlap, eg: one animation is when the unit's HP is 0-60, and the other is 40-100, what happens when the hp is 40-60, where it fills both animation requirements?

This here seems to be the full XML options for these unit boosts.
Code: [Select]
<allow-multiple-boosts value="false" />
<radius value="5"/>
<target value="all|ally|foe|faction"/>
<max-hp value="100"/>
<max-ep value="0"/>
<sight value="0"/>
<attack-strenght value="0"/>
<attack-range value="0"/>
<armor value="0"/>
<move-speed value="100" value-percent-multipler="true" />
<production-speed value="0"/>
<particles value="true">
<originator-particle-file path="glow_particles.xml"/>
<affected-particle-file path="glow_particles.xml"/>
</particles>
First tricky one we have seems to be the target tag. Am I correct in the assumption that if using the ally, all, foe, or faction values, the tag would simply look like <target value="value" /> while if the value is unit-types, then it would contain a children list of <unit-type name="name" /> tags? And another question about that tag, can it have units from any faction in that techtree, or just from the current faction? (eg: if a magic unit has point boost, can it use a unit-type tag to give a negative boost to tech's swordmen?)

The boosting tags seem to be the exact same as scenarios except that they can have an optional "value-percent-multiplier" which will have the value input instead be divided by 100 then multiply the stat (sadly, this percentage format is rather inconsistent with every other occurance in the XMLs, which instead use 1.0 = 100%, aka: decimal form).

As for particles, I'm assuming that originator-particle-file is the particles to give to the unit that will distribute the boost when the the affected unit is nearby (which would get the affected-particle-file particle system). This would last only while the affect unit is within the radius distance (and thus being affected), and would end when the affected unit leaves.

And the trickiest question: when using multiple boosts (and allow-multiple-boosts is true), how do multipliers stack? In GAE, the ADD all the multipliers together, then multiply them by the base stat, then finally add on the static modifiers (this prevents multipliers from becoming godly exponential increases, which could be too steep and thus be overpowered and unintended). The formula's GAE uses and examples are explained here: GAE/Enhancements#Analysis
« Last Edit: 18 June 2016, 18:24:55 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: A few new things
« Reply #9 on: 6 July 2011, 06:38:06 »
Really nice stuff Softcoder  :thumbup:

I'll test the snapshot and report ny problems...
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: A few new things
« Reply #10 on: 6 July 2011, 06:43:25 »
The snapshot is ultra buggy, I have corrected many things in svn since that snapshot. I'll post a new windows build soon (in a day or two) once I hear from testers that all is stable (but the new features are definitely making the game play very cool) :)

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: A few new things
« Reply #11 on: 10 July 2011, 10:40:03 »
why can't you make that you boost hp-regeneration.
I want to make a unit that heals all units in range. I am not sure that i will use it anymore (now i will boost attack range).
AND ( this one i will use ) i want to use particles only for affected units!
AND (this one i will use too) i want to do the attack-boost only on ALLY unit-types (hm my bad english :) )
« Last Edit: 10 July 2011, 15:31:36 by PT »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #12 on: 10 July 2011, 18:19:22 »
AND ( this one i will use ) i want to use particles only for affected units!
You can, just use the <affected-particle-file path="glow_particles.xml"/> tag as demonstrated in my example (which I will add to the wiki if softcoder could answer the few questions and/or confirm my guesses). Since I'm assuming both particles tags are optional, just don't use the <originator-particle-file path="glow_particles.xml"/> tag.

AND (this one i will use too) i want to do the attack-boost only on ALLY unit-types (hm my bad english :) )
Yeah, that doesn't seem possible, you could have either unit types or ally, but not both. Perhaps an improvement would be to allow the <unit-type name="name" /> tags to be used in any target tag, such as with the below example:

Code: [Select]
<target value="ally">
<unit-type name="name" />
</target>

That would actually make the unit-types tag obsolete, since if any of the target values could be used, they would be far more "accurate" in terms of defining what units exactly will be affected.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: A few new things
« Reply #13 on: 11 July 2011, 00:33:04 »
Yargh. :confused: I know I'm biased here, but the GAE effects syntax is much cleaner if you ask me.
https://docs.megaglest.org/GAE/Emanations

That would actually make the unit-types tag obsolete, since if any of the target values could be used, they would be far more "accurate" in terms of defining what units exactly will be affected.
No, not really.  Tags are far more flexible because they can refer to a hypothetical unit.  For example, if you have an effect that targets all "infantry" units, you don't have to worry about listing the Dwarven Warrior, Elvish Magol, Tech Sword(s)man, Axe Indian, etc., so long as they are tagged as "infantry" in their own respective XML files.  The same could go for "undead" or "vehicle" just as easily.  This allows the file to refer to units outside of its own tech tree without having to know what they are (and without having to maintain multiple lists across several XML files!).  The system was originally inspired by CSS, to which I'm sure you can relate.
« Last Edit: 18 June 2016, 17:56:23 by filux »

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #14 on: 11 July 2011, 07:07:20 »
That would actually make the unit-types tag obsolete, since if any of the target values could be used, they would be far more "accurate" in terms of defining what units exactly will be affected.
No, not really.  Tags are far more flexible because they can refer to a hypothetical unit.  For example, if you have an effect that targets all "infantry" units, you don't have to worry about listing the Dwarven Warrior, Elvish Magol, Tech Sword(s)man, Axe Indian, etc., so long as they are tagged as "infantry" in their own respective XML files.  The same could go for "undead" or "vehicle" just as easily.  This allows the file to refer to units outside of its own tech tree without having to know what they are (and without having to maintain multiple lists across several XML files!).  The system was originally inspired by CSS, to which I'm sure you can relate.
Sorry, I don't think I was clear enough. Long explanation time.

Firstly, MegaGlest doesn't support tags (or at least not to my knowledge), though they are quite useful in GAE for the reasons you mentioned. However, in this case, it's refer specifically to the target tag here. Currently, you can have either ally (effects any allied unit on the same team as you), faction (effects any unit in the same faction), foe (affects any unit not on your team), all (affects any unit), or unit-types (affects the listed units, on any team). However, if you, for example, want it to only affect one unit type that is on your team, there's a clash. To have it affect your team, you would normally use ally, but that won't let you specify the unit-type. The unit-types tag itself will affect everyone, to my understanding (I could be totally wrong, by the way, the XML layout isn't clear enough, and I cannot document in depth until my questions are answered, such as this one here. In the event I am totally wrong, disregard me completely as a bumbling fool). Thus, the ability to combine ally with a list of unit-types would fix that shortage.

The word "tag" in my quoted text is actually referring to an XML element (eg: <my-tag value="omega is awesome" />).

Offtopic: Can units have multiple tags?
« Last Edit: 12 July 2011, 03:42:04 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: A few new things
« Reply #15 on: 11 July 2011, 07:17:39 »

AND (this one i will use too) i want to do the attack-boost only on ALLY unit-types (hm my bad english :) )
Yeah, that doesn't seem possible, you could have either unit types or ally, but not both. Perhaps an improvement would be to allow the <unit-type name="name" /> tags to be used in any target tag, such as with the below example:

Code: [Select]
<target value="ally">
<unit-type name="name" />
</target>

That doesn't work: i tried it

but thank you for that:
Quote from: PT on 10 July 2011, 10:07:03 AM

    AND ( this one i will use ) i want to use particles only for affected units!

You can, just use the <affected-particle-file path="glow_particles.xml"/> tag as demonstrated in my example (which I will add to the wiki if softcoder could answer the few questions and/or confirm my guesses). Since I'm assuming both particles tags are optional, just don't use the <originator-particle-file path="glow_particles.xml"/> tag.
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #16 on: 11 July 2011, 09:18:03 »

AND (this one i will use too) i want to do the attack-boost only on ALLY unit-types (hm my bad english :) )
Yeah, that doesn't seem possible, you could have either unit types or ally, but not both. Perhaps an improvement would be to allow the <unit-type name="name" /> tags to be used in any target tag, such as with the below example:

Code: [Select]
<target value="ally">
<unit-type name="name" />
</target>

That doesn't work: i tried it
Of course it doesn't, that's not a code example (though by testing it, you did verify that I am understanding Softcoder's XML example correctly), it's just an example of how this feature should be implemented.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: A few new things
« Reply #17 on: 11 July 2011, 13:49:06 »
When it comes to targets of the attack-boost the following are valid:

Ally,Foe,Faction,UnitTypes,All

If the value is UnitType then you are able to specify specific unitTypes that should be affected (this is where the sub tags fit in). If modders want the ability to use these sub-tags as a 'second level filter' that could potentially also be done, but currently is not implemented as such.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #18 on: 11 July 2011, 21:03:02 »
When it comes to targets of the attack-boost the following are valid:

Ally,Foe,Faction,UnitTypes,All

If the value is UnitType then you are able to specify specific unitTypes that should be affected (this is where the sub tags fit in). If modders want the ability to use these sub-tags as a 'second level filter' that could potentially also be done, but currently is not implemented as such.
The problem is, those tags alone aren't very useful unless you can combine them with unit-types. That way you could have ONLY allied Guards be boosted, or maybe only enemy Archers, etc. Otherwise, it's impossible to affect units without accidentally boosting foes or reducing allies, unless you want to affect all units.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: A few new things
« Reply #19 on: 12 July 2011, 02:04:12 »
Fair enough, unit-type may now be used for all types as a sub-filter

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: A few new things
« Reply #20 on: 12 July 2011, 03:40:56 »
Fair enough, unit-type may now be used for all types as a sub-filter
Cool, but could you please answer my questions and assumptions in my previous post so that we can add this to the Wiki?

Oh, wow, didn't notice that you edited your post. Thankfully Elim bumped it. Since it's now in the SVN and has a mod that uses some of the features, I think it's time to document it properly. I can happily do that if you supply a bit more information, or you can do so yourself.

I think multiple animations may be in there, not sure, if it is though, we'd probably have to add the min-hp and max-hp parameters. Question first: What happens if these parameters overlap, eg: one animation is when the unit's HP is 0-60, and the other is 40-100, what happens when the hp is 40-60, where it fills both animation requirements?

This here seems to be the full XML options for these unit boosts.
Code: [Select]
<allow-multiple-boosts value="false" />
<radius value="5"/>
<target value="all|ally|foe|faction"/>
<max-hp value="100"/>
<max-ep value="0"/>
<sight value="0"/>
<attack-strenght value="0"/>
<attack-range value="0"/>
<armor value="0"/>
<move-speed value="100" value-percent-multipler="true" />
<production-speed value="0"/>
<particles value="true">
<originator-particle-file path="glow_particles.xml"/>
<affected-particle-file path="glow_particles.xml"/>
</particles>
First tricky one we have seems to be the target tag. Am I correct in the assumption that if using the ally, all, foe, or faction values, the tag would simply look like <target value="value" /> while if the value is unit-types, then it would contain a children list of <unit-type name="name" /> tags? And another question about that tag, can it have units from any faction in that techtree, or just from the current faction? (eg: if a magic unit has point boost, can it use a unit-type tag to give a negative boost to tech's swordmen?)

The boosting tags seem to be the exact same as scenarios except that they can have an optional "value-percent-multiplier" which will have the value input instead be divided by 100 then multiply the stat (sadly, this percentage format is rather inconsistent with every other occurance in the XMLs, which instead use 1.0 = 100%, aka: decimal form).

As for particles, I'm assuming that originator-particle-file is the particles to give to the unit that will distribute the boost when the the affected unit is nearby (which would get the affected-particle-file particle system). This would last only while the affect unit is within the radius distance (and thus being affected), and would end when the affected unit leaves.

And the trickiest question: when using multiple boosts (and allow-multiple-boosts is true), how do multipliers stack? In GAE, the ADD all the multipliers together, then multiply them by the base stat, then finally add on the static modifiers (this prevents multipliers from becoming godly exponential increases, which could be too steep and thus be overpowered and unintended). The formula's GAE uses and examples are explained here: GAE/Enhancements#Analysis
« Last Edit: 18 June 2016, 17:52:36 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: A few new things
« Reply #21 on: 14 July 2011, 00:07:07 »
should i post that a feature request now  :o ? Because i want to use the boost as home-boost (at home all warriors gets more strength) but it looks bad if the workers get this too.
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: A few new things
« Reply #22 on: 14 July 2011, 01:48:51 »
Just specify the army units:
Code: [Select]
<target value="faction">
<unit-type name="archer" />
<unit-type name="swordman" />
<unit-type name="guard" />
<unit-type name="ect" />
</target>
Get the Vbros': Packs 1, 2, 3, 4, and 5!

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: A few new things
« Reply #23 on: 14 July 2011, 19:12:39 »
for what is faction ( only for you or what? ) and the thing you write there does NOT WORK. I tried it with ally.
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: A few new things
« Reply #24 on: 14 July 2011, 21:15:25 »
Faction means you. Try it with faction.
Get the Vbros': Packs 1, 2, 3, 4, and 5!