Poll

Should there be Fortify?

Yes
4 (80%)
No
1 (20%)

Total Members Voted: 3

Voting closed: 4 December 2008, 02:24:33

Author Topic: New Skill Type and Command Type (Possibility)  (Read 1931 times)

modman

  • Guest
New Skill Type and Command Type (Possibility)
« on: 4 December 2008, 02:24:33 »
I think there should be a skill that is exactly like hold position (attack stopped), except it would be called fortify and it would add an extra percent armor while the unit is doing this.  I guess it's kind of like digging in for World War I where they had to dig in to the trenches, but a lot of games have it, but it gives "defensive bonuses" and Glest doesn't have that, so I thought of armor instead.  What do you think?

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: New Skill Type and Command Type (Possibility)
« Reply #1 on: 4 December 2008, 09:13:05 »
Such as in red alert 2 where you deploy your gdi and he gets sand bags around him and a mounted machine gun. I've been hearing about auto-morph so maybe this fits in with that.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

gameboy

  • Guest
Re: New Skill Type and Command Type (Possibility)
« Reply #2 on: 4 December 2008, 09:37:46 »
yes there should be something like that,better known as stances.
Defensive Stance - increase defensive attributes.
Battle Stance - basic stance.
Aggressive stance - increase attack attributes.

Stand Ground - a unit will stand where he is kept.
Raid - a unit will attack all buildings first, with a bonus against buildings.
Attack at Will - a unit will first attack all units, with a bonus against units.

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: New Skill Type and Command Type (Possibility)
« Reply #3 on: 4 December 2008, 16:51:42 »
Quote from: "modman"
I think there should be a skill that is exactly like hold position (attack stopped), except it would be called fortify and it would add an extra percent armor while the unit is doing this.

Why not just use the standard hold skill and add an effect which gives extra armour to units that need it? I don't see any need for a whole new skill type.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

daniel.santos

  • Guest
Re: New Skill Type and Command Type (Possibility)
« Reply #4 on: 4 December 2008, 23:11:51 »
Yea, the only problem is that effects aren't set up to be able to  "apply an effect to self when skill is executed", otherwise, it would be the perfect answer.  And I also agree that there's no new skill type that should be needed.  However, here are some things to consider:
  • Should the unit be able to instantly enter this state or should it take them time to "dig in"?
  • If it takes them time, then perhaps a morph skill is more appropriate, especially if it costs them some type of resources, or modifies their commands (i.e., can no longer move).  Remember that you can always have another morph skill to go back to a "not-dug-in" unit that executes nearly instantly.
  • If you are going to change your "stance", you should probably implement some other penalty, i.e., aggressive stance would +damage but -armor/resistance/chance-to-be-hit (the last two which aren't yet implemented).
  • Still, the idea of units having a "state" (or "stance") has merit and is probably worth consideration.  Each stance could be defined in the same terms as an effect and a skill could be implemented to transition from one stance to another as a limited psudo-morphing ability, without defining another unit.
As far as targeting goes (i.e., attacking buildings first, etc.) that's a bit more complicated, and probably deserves consideration as well.  I'm working on code to cause units to prefer to attack enemy units which aren't flagged as "walls" so that barrier units are treated correctly (will still have to teach the AI how to properly build them though).  I'm also planning AI features which will cause the AI to attack specific unit classes and attempt to ignore others, unless blocked (specifically, harassment AI which targets harvesters & builders and other "soft targets"), so the functionality will be needed for this anyway.

This is unrelated, but may be of interest. There is code in place (although undocumented) to give an attack command more than one attack skill and a set of rules to use to choose the appropriate attack skill based upon the situation.  You can use this specify a different  attack skill when attacking buildings, but there is nothing to tell it to prefer to *target* buildings.  Just for the record, you specify multiple attack skills in an attack command with more than one attack skill by specifying <attack-skills> instead of <attack-skill> in the <command type="attack"> tag.  Each attack skill can have preferences associated with them so that the appropriate attack skill is selected based upon the situation.  Look at the FPM's Lich and Battle Mech "auto_attack" commands for examples.  To see more precisely how it behaves, you'll have to look at the source code for now (source/glest_game/types/command_type.cpp line 80), but this is a summary of the flags:
  • whenever-possible (prefer to use this skill over all others, when possible)
  • at-max-range (Haven't tested it yet and probably incomplete.  I think this one was supposed to make the unit flee from their target if they got closer than the max range, so the attacking unit stayed as far away as possible)
  • on-large-units (prefer to use this skill when attacking units that are larger than size 1)
  • on-buildings (prefer to use this skill when attacking buildings)
  • when-damaged (prefer to use this skill when attacking when at less than 100% health)
XML snippet from FPM Lich:
Code: [Select]
<command>
<type value="attack"/>
<name value="auto_attack"/>
<image path="../../../../placeholders/icon.bmp"/>
<unit-requirements/>
<upgrade-requirements>
<upgrade name="energy_extraction"/>
</upgrade-requirements>
<move-skill value="move_skill"/>
<attack-skills>
<attack-skill value="withering_dispair"/>
<attack-skill value="soul_steal">
<flags><when-damaged/></flags>
</attack-skill>
</attack-skills>
</command>
The Lich's auto-attack skill is what causes it to automatically choose the soul steal attack (the one that restores its HP using the HP of its enemies) only when the Lich is below 100% health.

XML snippet from FPM Battle Machine
Code: [Select]
<command>
<type value="attack"/>
<name value="auto_attack"/>
<image path="../../../../placeholders/icon.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="charge_skill"/>
<attack-skills>
<attack-skill value="melee_attack">
<flags><whenever-possible/></flags>
</attack-skill>
<attack-skill value="arrow_attack"/>
</attack-skills>
</command>
The Battle Machine's auto-attack skill allows it to use arrows to attack flying targets, but prefer to use it's melee attack whenever possible since it does a lot more damage.

So perhaps a <targeting-preferences> similar to the above can be added at some point?  I would normally consider it extraneous except that my future AI will need it anyway.  So those preferences could be something like:
  • nearest (the current behavior)
  • buildings
  • non-buildings
  • military
  • harvester
  • builder
  • healer
  • producer
  • weakest
Most of this is for AI stuff, but if you really wanted to stick it on a command that you let human players use, you could.  And one last note, there also will be a <move-skills> tag (to encapsulate <move-skill> tags) coming up to support stuff like walking when paroling, but running to attack when an enemy unit is sighted.

gameboy

  • Guest
Re: New Skill Type and Command Type (Possibility)
« Reply #5 on: 5 December 2008, 03:49:41 »
thats some pretty cool stuff daniel, i can't wait till its finished.
BTW will you be doing attack formations?

modman

  • Guest
Re: New Skill Type and Command Type (Possibility)
« Reply #6 on: 6 December 2008, 03:18:17 »
I don't know if this relates, but maybe there should be a command type that is determined somhow in XML that in the XML it would say to use this attack under certain conditions, then the next attack under another set of conditions, until all attacks of that unit are accounted for.  An example of how this would work would be that the Battlemachine in Tech would use its arrow attack until the attacker was within 1 range in the land field and then use the ax.

A better but less well known example would be Dark Magic's Reaper, because its ranged land/air "death bolt" attack requires EP and its land melee "scythe" attack does not.  So you would say that while the EP is greater than that required for a "death bolt" stay on that attack, but when it drops below that required amount, use the scythe.  If the attacker is air, then it would have to use the "death bolt", but what if there is not enough EP?  Then do not just stand there like an idiot!  Keep moving in the direction you were moving before until you have enough EP!

There would also have to be safeguards to keep it from doing wierd things near Workers, but that'll just have to be tested.  Also if it sees even more enemies and there is still one in the air that can attack you, assess whether the units are faster than the Reaper and if not just run away, because it'll be killed otherwise.

daniel.santos

  • Guest
Re: New Skill Type and Command Type (Possibility)
« Reply #7 on: 6 December 2008, 10:53:29 »
The problem in your example with the Battlemachine using the arrow attack when not in melee range is that it isn't using the arrow attack and moving at the same time, so it will never get to melee range unless it's target comes to it -- that's not good because it can get ranged to death while dealing minimal damage and failing to "tank" for ranged units on the same team (having 2500-ish HPs, it makes a good "tank").  With the "auto_attack" command I described above, it will actually use the ranged attack only on flying units and attempt to get within melee range for ground units - so that solves some of the more critical problems, but if, for instance, it cannot reach the ground unit because it's blocked, it never tries to hit it with it's ranged weapon (which would be best).

Your Reaper faces even more challenges.  For now, you can use an "auto_attack" command and it will attempt to use it's scythe attack on ground units and death bolt on others (which is probably better than selecting either of them exclusively, especially since the AI only uses the 1st attack command).  However, I would very much like support for switching skills when out of EPs!  This is the same thing I would like to get working for the move skills I described a few days ago as well.

 

anything