Author Topic: Skill cycles, and other stuff...  (Read 2353 times)

jda

  • Guest
Skill cycles, and other stuff...
« on: 26 March 2010, 18:36:26 »
Skill cycles for morph are generally very short, and it takes many such cycles to complete a typical morph. Ep is deducted per skill cycle. If I have my facts right (no guarantee), one 'point' of production is added per cycle, so the Ep required to finish a morph is equal to the produced units production 'time' multiplied by the skills ep cost.

I will attempt shortly to write up an explanation of skill cycles & commands and the various unit/skill parameters that affect such things, so that people who prefer numbers can figure this all out with less trial and error and more planning, but it may take a while to compose, knowing how one command works doesn't necessarily give you much insight into how another command might work.

That would be awsome! 8)
Where will you be publishing that explanation?

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Skill cycles, and other stuff...
« Reply #1 on: 27 March 2010, 03:23:57 »
so you are saying that if morphing costs 30 EP and the morph time equals 5 seconds, that the unit would need 150 EP to morph?

No, not 5 'seconds', but rather the 'produciton time' of the unit you are morphing to.

Let's do this by example, should make more sense :) I'm feeling particularly creative today, so let's say with have unit_a and unit_b,
unit_a can morph to unit_b, and the morph skill has a ep cost of 5.
unit_b has a production time of 60 (unfortunately, this is called 'time' in the XML paramaters).

So, it will require 60 skill cycles, each with a cost of 5ep == 300 Ep total required to finish the morph.

A 'real world' time to complete the morph can also be calculated from these numbers and the skill speed, but I'll get to that later (and hopefully many other things at the same time)

That would be awsome! 8)
Where will you be publishing that explanation?

It'll be posted on the forum somewhere, I haven't really considered 'where' yet, probably 'mods' makes sense, if it's deemed intelligible someone can put it on the wiki ;)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Zoythrus

  • Guest
Skill cycles, and other stuff...
« Reply #2 on: 27 March 2010, 04:05:37 »
it would be nice if i had something to go from when it comes to the "time/cycles" thing....

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Skill cycles, and other stuff...
« Reply #3 on: 28 March 2010, 06:40:34 »
I'm still working my way through the commands/skills, but here is a first draft of the 'intro' which attempts to show how the skill speed is used.

Skill cycles.

A skill cycle in glest is an 'indivisible' unit action, commands are executed by a series of skills, after each skill cycle the command is updated and this selects the next skill to execute.  Once a skill cycle begins, it cannot be stopped (with one exception, that being unit death, which will cut the current skill cycle off).  In the program skill progress is represented by a number between 0 and 1, when this number gets to 1 the skill cycle is complete.

World frames.

The game, at normal speed, runs at 40 world frames per second, each unit is updated in each frame, where amoungst other things the skill progress is updated, and if the skill cycle finishes the command is updated.

Skill cycles and world frames. (calculating skill cycle length).

How long each skill cycle takes to execute is determined solely by the skill's 'speed' (except for move skills, which are also modified by slope and by whether it is a straight or diagonal).  For non-move skills, in each world frame update the progress has skill_speed / 4000 added to it.

eg.
Initiate repair skill has a speed of 50.  Thus each world update 50 / 4000 == 0.0125 is added to the skill progress.  1.0 / 0.0125 == 80, so each skill cycle of an Initiate's repair skill takes 80 world frames to complete (and 80 / 40 = 2 seconds at normal game speed).

Initiate morph skill has a speed of 500, so each update adds 0.125 to skill progress, and an Initiate morph skill cycle takes 8 frames to complete. (8 / 40 == 0.2 seconds at normal game speed).
Glest Advanced Engine - Code Monkey

Timeline | Downloads

jda

  • Guest
Skill cycles, and other stuff...
« Reply #4 on: 29 March 2010, 15:38:36 »
eg.
Initiate repair skill has a speed of 50.  Thus each world update 50 / 4000 == 0.0125 is added to the skill progress.  1.0 / 0.0125 == 80, so each skill cycle of an Initiate's repair skill takes 80 world frames to complete (and 80 / 40 = 2 seconds at normal game speed).
And that means an Initiate will repair (I think it's 10 on each cycle) 10 HP every 2 seconds?

Quote
Initiate morph skill has a speed of 500, so each update adds 0.125 to skill progress, and an Initiate morph skill cycle takes 8 frames to complete. (8 / 40 == 0.2 seconds at normal game speed).
And given as a Battlemage's <time value="75"/>, that means it will take the Initiate 15 seconds ( 75 x 0.2 ) to morph to a Battlemage at normal game speed?

Am I getting all this right?

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Skill cycles, and other stuff...
« Reply #5 on: 29 March 2010, 15:41:39 »
I think pretty close. Just keep adding EP till it works.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Skill cycles, and other stuff...
« Reply #6 on: 30 March 2010, 01:37:35 »
And that means an Initiate will repair (I think it's 10 on each cycle) 10 HP every 2 seconds?

Repair is unique, I haven't 'covered' the repair command/skill yet, but I have looked at it, for vanilla glest the amount repaired is, max_hp / production_time + 1, rounded down. So if the Initiate was repairing a Golem, max_hp == 2000 / produciton_time == 150 + 1 rounded down is == 14 hit points repaired.

With GAE you get the same behaviour by default, but you can override the amount with an <amount value="xxx"/> and optionally a <multiplier value="x.x" />. There are also some flags not related to the amount repaired, 'self allowed', 'self only', 'pet only'.

Quote from: jda
Quote
Initiate morph skill has a speed of 500, so each update adds 0.125 to skill progress, and an Initiate morph skill cycle takes 8 frames to complete. (8 / 40 == 0.2 seconds at normal game speed).
And given as a Battlemage's <time value="75"/>, that means it will take the Initiate 15 seconds ( 75 x 0.2 ) to morph to a Battlemage at normal game speed?

Am I getting all this right?

Correct :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

jda

  • Guest
Skill cycles, and other stuff...
« Reply #7 on: 30 March 2010, 14:17:48 »
THOUGHT: Before going on... could all this discussion about skill cycles & commands be moved to a new topic (it is getting increasingly OT in this thread IMHO)?

Repair is unique, I haven't 'covered' the repair command/skill yet, but I have looked at it, for vanilla glest the amount repaired is, max_hp / production_time + 1, rounded down. So if the Initiate was repairing a Golem, max_hp == 2000 / produciton_time == 150 + 1 rounded down is == 14 hit points repaired.

With GAE you get the same behaviour by default, but you can override the amount with an <amount value="xxx"/> and optionally a <multiplier value="x.x" />. There are also some flags not related to the amount repaired, 'self allowed', 'self only', 'pet only'.
Very interesting, thanks! :)

Quote
Quote from: jda
Quote
Initiate morph skill has a speed of 500, so each update adds 0.125 to skill progress, and an Initiate morph skill cycle takes 8 frames to complete. (8 / 40 == 0.2 seconds at normal game speed).
And given as a Battlemage's <time value="75"/>, that means it will take the Initiate 15 seconds ( 75 x 0.2 ) to morph to a Battlemage at normal game speed?

Am I getting all this right?

Correct :)
:)
Looking forward to further explanations on how this affects EP requirements (which would actually be ontopic, so maybe this shouldn't be moved to a new thread...?  :-\ ).  8)

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Skill cycles, and other stuff...
« Reply #8 on: 30 March 2010, 14:23:34 »
Quote
THOUGHT: Before going on... could all this discussion about skill cycles & commands be moved to a new topic (it is getting increasingly OT in this thread IMHO)?

Ok....where do you guys want it?
Egypt Remastered!

Proof: Owner of glest@mail.com

jda

  • Guest
Skill cycles, and other stuff...
« Reply #9 on: 30 March 2010, 14:55:54 »
I dunno.
It is specially useful to modders, so it probably should go into the Mods section? (better stickied, too! ;D - OR linked to by that thread about "Modding infos from this board" ;) ).

But the continuation of this by silnarm will matter to this thread too. Though... this thread could then link to that other, more generic one, too?...

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Skill cycles, and other stuff...
« Reply #10 on: 30 March 2010, 15:07:05 »
Links.......Links.......and more Links, ok, I can do that. :P

Done.
« Last Edit: 30 March 2010, 15:12:53 by -Archmage- »
Egypt Remastered!

Proof: Owner of glest@mail.com

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Skill cycles, and other stuff...
« Reply #11 on: 30 March 2010, 16:14:37 »
This is incredibly handy silnarm, kudos to you there.

Does this formula apply to ALL skills (with the noted exception of repair)?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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