1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

Implemented Task: Stamina expenditure and regeneration

Discussion in 'Data' started by Istrebitel, Apr 5, 2017.

  1. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    3/28

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    It is observed that soldiers without stamina cannot run, and soldiers spend stamina when running. They also supposedly regenerate it. How precisely is what we need to know to implement it.

    Questions:
    - How does stamina regenerate in RT and in TB?
    - What spends stamina? Does movement non-running spend it? Anything else?
    - How much stamina is spent on what? (approximate formula)
     
    makus likes this.
  2. Lord Darius

    Lord Darius Member Researcher
    39/56

    Joined:
    Jul 21, 2014
    Messages:
    18
    Likes Received:
    15
    Best Answers:
    0
    Stamina regeneration sucks at vanilla game....
    If you run at TB, you spend 1 stamina for 2 AP. (Imagine reaching a ship, when its 3-4 rounds away....you end up exhausted, and will suck at combat routines)
    In RT, you can run like a maniac, cause it regenerates with 2 second 1 stamina point.
     
    makus likes this.
  3. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    So every two seconds in RT agent regenerates 1 stamina, confirmed? Weight of equipment has no effect? What about TB? In my experience game considers a turn to be worth 4 seconds, so, does TB regenerate 2 stamina per turn? And question about how agent spends stamina in real time still remains.
     
    makus likes this.
  4. Lord Darius

    Lord Darius Member Researcher
    39/56

    Joined:
    Jul 21, 2014
    Messages:
    18
    Likes Received:
    15
    Best Answers:
    0
    I think it depends only on strength. Even the stuff they carry, the AP will be reduced, but stamina will be spent as like normal. If you put them too heavy stuff, it seems they only use that measure. Will have to work with this, cause humans do pretty casual, hybrids are weak, androids regenerate like Deadpool. Im working with this more, will update!
     
    makus likes this.
  5. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    Thanks. We need exact numbers to implement this.

    EDIT: Made a small test myself. Are you sure you spend 1 stamina per 2 tu? I seem to be spending about 3 stamina per 10 tiles passed (in running mode).
     
    Last edited: Apr 9, 2017
  6. Mustang

    Mustang Megapol Agent Tester Researcher
    31/56

    Joined:
    Aug 23, 2014
    Messages:
    35
    Likes Received:
    19
    Best Answers:
    0
    The US manual states that while walking an agent neither spends nor regenerates stamina
     
  7. The Think Tank

    The Think Tank Active Member Researcher
    19/28

    Joined:
    Mar 2, 2016
    Messages:
    31
    Likes Received:
    12
    Best Answers:
    0
    I can do a real time test by having soldiers (3 different kinds, a Hybrid, a Android, and a Human) and having them run 5 tiles, record Stamina loss, have them run 10, then 15. After each test I can also record how long it takes for stamina to regenerate, although that will be a less precise calculation.
     
  8. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    Yeah, that's the kind of testing we need.
     
  9. The Think Tank

    The Think Tank Active Member Researcher
    19/28

    Joined:
    Mar 2, 2016
    Messages:
    31
    Likes Received:
    12
    Best Answers:
    0
    Yeah, I can probably calculate the initial drain, but it may be best if a separate pair of eyes calculates the stamina regeneration, for security sake.
     
  10. Mustang

    Mustang Megapol Agent Tester Researcher
    31/56

    Joined:
    Aug 23, 2014
    Messages:
    35
    Likes Received:
    19
    Best Answers:
    0
    I'd be surprised if it was a formula more complex than regen X points per second or X% of total stamina per second
     
  11. The Think Tank

    The Think Tank Active Member Researcher
    19/28

    Joined:
    Mar 2, 2016
    Messages:
    31
    Likes Received:
    12
    Best Answers:
    0
    Fair enough, but it may be reliant on armor, strength or other independent variables.
     
  12. Mell

    Mell Member Programmer Researcher Translator/Writer
    3/28

    Joined:
    Apr 15, 2017
    Messages:
    9
    Likes Received:
    10
    Best Answers:
    3
    Turn Based Stamina

    Tested on agents, not civilians, and not aliens, i hope they regen with the same pattern

    Stamina regeneration is based on the unit max. stamina, and seems to be only affected by TUs
    • If < 128, regenerates 2 stamina/turn
    • If >= 128 and < 192, regenerates 4 stamina/turn
    • if >= 192, regenerates 6 stamina/turn

    But, if the unit has spent many TUs in the turn, that regeneration may be altered:
    • If remaining TUs < 9% Max TUs (i think it is after reducing it with Weight penalty), no regeneration applied
    • If remaining TUs <18% and >=9% Max TUs, previous regeneration is halved
    • If remaining TUs >= 18% Max TUs, regeneration is full

    Spending Stamina

    Things to check
    Movement on slopes increases/decreases cost or just is harder to move (more TUs around them)?
    Crossing doors? Fire? Smoke? Flying?
    Any special weapon uses stamina? (Grenades, grapples, swords...)

    Running in straight line (crossing the square edges)
    Every run square costs 0.6 Stamina
    Every run square costs 2 TU

    Running in diagonal (through square vertices)
    Every run square costs 0.6 Stamina
    Every run square costs 3 TU

    Walking in straight line
    No stamina cost
    Every walked square costs 4 TU

    Walking in diagonal
    No stamina cost
    Every walked square costs 6 TU

    Crawling in straight line
    Every crawled square costs 0.85 Stamina (Average was 0.88 but with the avg in diagonal, it may be 0.85)
    Every crawled square costs 6 TU

    Crawling in diagonal
    Every crawled square costs 0.85 Stamina (Average was 0.82 but with the avg in straight, it may be 0.85)
    Every crawled square costs 9 TU

    Realtime Stamina

    Tested on agents, not civilians, and not aliens, i hope they regen with the same pattern

    Stamina regeneration is based on the unit max. stamina
    • If < 128, regenerates 1 stamina/gameSec
    • If >= 128 and < 192, regenerates 2 stamina/gameSec
    • if >= 192, regenerates 3 stamina/gameSec
    • If the unit is moving, does not regenerate stamina
    • Laying on ground, kneeling or standing regenerates the same stamina


    Spending Stamina
    An interesting finding, distance doesn't matter, just the time moving

    Things to check
    Movement on slopes increases/decreases cost or just is harder to move (more TUs around them)?
    Crossing doors? Fire? Smoke? Flying?
    Any special weapon uses stamina? (Grenades, grapples, swords...)

    Running (straight line or diagonal)
    Every second running costs 3 stamina
    No stamina regeneration

    Walking
    No stamina cost
    No stamina regeneration

    Crawling (straight line or diagonal)
    Every second crawling costs 1 stamina
    No stamina regeneration



    t#a is beginning of turn
    t#b is end of turn

    [​IMG]

    [​IMG]

    RT Values
    [​IMG]

    Different distance spent the same stamina
    [​IMG]

    P.S. If you run one square at a time (TB), stamina is not drained
     
    Last edited: May 4, 2017
    makus likes this.
  13. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    Thank you very much. Now just waiting on RT values.
     
  14. The Think Tank

    The Think Tank Active Member Researcher
    19/28

    Joined:
    Mar 2, 2016
    Messages:
    31
    Likes Received:
    12
    Best Answers:
    0
    I am unable to do the RT testing as of now as my recording software has crashed, I am trying to troubleshoot but in the meantime I wouldn't rely on me for this.
     
  15. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    It's fine. Finish it when you can, for now we'll use TB values for RT (sans the penalty for spending TUs)
     
  16. Mell

    Mell Member Programmer Researcher Translator/Writer
    3/28

    Joined:
    Apr 15, 2017
    Messages:
    9
    Likes Received:
    10
    Best Answers:
    3
    Added stamina in realtime
    This was much simpler than expected.

    I may have a look at this another day

    Things to check
    Movement on slopes increases/decreases cost or just is harder to move (more TUs around them)?
    Crossing doors? Fire? Smoke? Flying?
    Any special weapon uses stamina? (Grenades, grapples, swords...)
     
  17. Istrebitel

    Istrebitel Well-Known Member Official Developer Administrator
    39/56

    Joined:
    Aug 8, 2016
    Messages:
    189
    Likes Received:
    80
    Best Answers:
    1
    Thank you very much. This is now resolved. If you find something else then post another reply here.
     

Share This Page