Author Topic: Multi Attack?  (Read 4251 times)

Little Helper

  • Guest
Multi Attack?
« on: 3 March 2010, 01:26:22 »
Could GAE have multi attack for units. So lets say my archer attack and enemy with skill A after that he attacks again but with Skill B with out me manually doing it. Why have this? Well seeing your units attack with the same move its too...the same ish  and not just that it makes the unit attack differently! :o

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Multi Attack?
« Reply #1 on: 3 March 2010, 01:42:29 »
Yah, and multi death anims.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Little Helper

  • Guest
Re: Multi Attack?
« Reply #2 on: 3 March 2010, 03:22:58 »
Yea! ;D

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Multi Attack?
« Reply #3 on: 3 March 2010, 03:36:21 »
I remember Daniel saying something like this was in the works.  I'd be very excited to see it implemented! :)

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Multi Attack?
« Reply #4 on: 3 March 2010, 03:44:56 »
Quote
I remember Daniel saying something like this was in the works.  I'd be very excited to see it implemented! Smiley

Me as well!
Egypt Remastered!

Proof: Owner of glest@mail.com

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Multi Attack?
« Reply #5 on: 3 March 2010, 04:19:11 »
Do you mean to have the AI automatically use different attacks (and not just for when they can't use one)? That's an AI thing, but should (and probably will be eventually).
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

Little Helper

  • Guest
Re: Multi Attack?
« Reply #6 on: 3 March 2010, 04:23:10 »
Yea  ::) thats what I mean!

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Multi Attack?
« Reply #7 on: 3 March 2010, 04:24:17 »
The AI already does that. ::)
What we really need is support for multiple anims.
Egypt Remastered!

Proof: Owner of glest@mail.com

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Multi Attack?
« Reply #8 on: 3 March 2010, 04:40:24 »
From what I remember about the discussion, Daniel was saying they could make something like a "playlist" of animations and they would be chosen at random like the sounds currently are.  So if you had a martial artist unit, it could be something like
Code: [Select]
<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="150"/>
<anim-speed value="150"/>
<animations>
<animation path="models/right_cross.g3d"/>
<animation path="models/1-2_combo.g3d"/>
<animation path="models/uppercut.g3d"/>
<animation path="models/roundhouse_kick.g3d"/>
</animations>

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Multi Attack?
« Reply #9 on: 3 March 2010, 04:41:07 »
Yah, that's it!
Egypt Remastered!

Proof: Owner of glest@mail.com

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Multi Attack?
« Reply #10 on: 3 March 2010, 12:21:20 »
I didn't think this had made it onto trac yet, lucky I looked first, ticket #11, set to come in 0.3.

This one is actually not going to be too hard, for the most part ;)

Any takers?
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Multi Attack?
« Reply #11 on: 17 March 2010, 08:04:26 »
hmm...  ::) this would be cool
there might be some problems though...if it is implemented...since if skill a might have some bad values...then... :bomb:  ::)

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Multi Attack?
« Reply #12 on: 17 March 2010, 17:30:14 »
You should be able to add a skill in the command and then it attack like it is 3 units

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

      </command>
Get the Vbros': Packs 1, 2, 3, 4, and 5!

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Multi Attack?
« Reply #13 on: 17 March 2010, 17:43:15 »
No, then the attacks would be too random, we just need different anims for each attack and we need to be able to set the speed for each one, and then particles for each attack..........
Egypt Remastered!

Proof: Owner of glest@mail.com

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Multi Attack?
« Reply #14 on: 17 March 2010, 20:50:59 »
hmm...  ::) this would be cool
there might be some problems though...if it is implemented...since if skill a might have some bad values...then... :bomb:  ::)

If your skills have 'bad values' then you are going to have problems anyway, are you not?

No, then the attacks would be too random, we just need different anims for each attack and we need to be able to set the speed for each one, and then particles for each attack..........

This is the only tricky bit, attack skill animations requiring different start times, anim speed and/or projectile offsets. Unfortunately the start time and anim speed affect more than just what you see, they affect the game, so some care will need to be taken, and some restrictions may be needed.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Multi Attack?
« Reply #15 on: 17 March 2010, 22:52:42 »
hmm...  ::) this would be cool
there might be some problems though...if it is implemented...since if skill a might have some bad values...then... :bomb:  ::)
If your skills have 'bad values' then you are going to have problems anyway, are you not?
That's true.  ::)  :O
I guess.  :P

Fluffy203

  • Guest
Re: Multi Attack?
« Reply #16 on: 17 March 2010, 23:52:38 »
can you elaborate on how these speeds affect the game , i would love to know  :D

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Multi Attack?
« Reply #17 on: 18 March 2010, 07:49:46 »
Have a look at this topic,
https://forum.megaglest.org/index.php?topic=4525.0

Then comeback here for any follow-up questions / requests for clarification / etc.  I can probably say a whole lot more about the subject now than I could then, I've just recently pulled the whole skill/animation cycle process apart and put it back together again, with different 'bits' ;)

Cheers.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Fluffy203

  • Guest
Re: Multi Attack?
« Reply #18 on: 18 March 2010, 22:56:42 »
Good i'm glad to hear that and now i understand it to the point of settling my curiosity , so how much coding skill does this require to alter and understand?

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Multi Attack?
« Reply #19 on: 18 March 2010, 23:40:19 »
... so how much coding skill does this require to alter and understand?

I'm not sure how much 'skill' is required, there is nothing overly complex in there as far as I'm concerned, but that's a perspective thing.  It's a large amount of code, and you need to understand how a fair amount of it works and interacts with other parts before you could change such things (or change them and expect success, that is).

Ultimately it depends on programming experience and how much time you can put into it. I wouldn't recommend newbie programmers dive straight into it, but any programmer with a bit of experience could be making such changes within weeks/months (depending on time expenditure).

If your not an experienced programmer, become one first. Learn about data structures and algorithms, learn about discrete mathematics, without a solid foundation you will struggle to achieve much.

Good luck, and a final bit of advice, persistence is key, programming can be incredibly frustrating at times (and very humbling, you'll constantly be amazed by your own stupidity) but if you just give up, obviously you'll get nowhere.

Cheers.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Fluffy203

  • Guest
Re: Multi Attack?
« Reply #20 on: 18 March 2010, 23:55:16 »
I took at class on vb , but i'm not sure if they are the same thing , but i'll go for it cause i've learned the best way to learn something is to experience it and thanks for the advice  ;D

Gabbe

  • Guest
Re: Multi Attack?
« Reply #21 on: 20 April 2010, 20:32:38 »
What if i don`t want the attacks anims be random? If i want one attack to be used when close to water for example: A tanks driving into a river for executing a soldier, then i wan`t him to use it`s machinegun instead of the cannon?

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Multi Attack?
« Reply #22 on: 20 April 2010, 22:03:33 »
This is more of an AI thing that hasn't been implemented yet.

It could be something (very roughly) like:
Code: [Select]
<unit brain="tankbrain.ai">

Code: [Select]
start_event() {
  setRangeEvent("eventInWater", IN, TERRAIN_TYPE, Water);
  setRangeEvent("eventOnLand", ON, TERRAIN_TYPE, Land);
}

eventInWater() {
  setAttackSkill("MachineGun");
}

eventOnLand() {
  setAttackSkill("Cannon");
}

OR

Code: [Select]
brain_loop() {
  if (getTerrainType() == WATER && isInTerrainType()) {
    setAttackSkill("MachineGun");
  } else if (getTerrainType() == LAND && isOnTerrainType()) {
    setAttackSkill("Cannon");
  }
}

Or it could be made less flexible by having a list of scenarios that you can assign a weapon.
Code: [Select]
InWaterAttackSkill=MachineGun
OnLandAttackSkill=Cannon

What these are doing is getting information from the environment and creating a policy for what to do in certain situations. A table data-structure could be used to define a policy.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

wyvern

  • Guest
Re: Multi Attack?
« Reply #23 on: 21 April 2010, 02:16:31 »
Would it be possible to make units attack an enemy with the best choice of attack unless ordered otherwise, for example a archer using a sword against a stickfighter in close combat.

Zoythrus

  • Guest
Re: Multi Attack?
« Reply #24 on: 21 April 2010, 02:43:25 »
like telling the unit to use attack A unless the enemy comes into the range of attack B?

 

anything