Author Topic: [DONE] New experience award system / accuracy training system  (Read 31669 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
[DONE] New experience award system / accuracy training system
« on: January 16, 2016, 09:22:18 pm »
OK, here goes nothing:

1. vanilla bravery training unchanged
2. vanilla reactions training unchanged
3. vanilla psi strength and psi skill training unchanged (more options added in OXCE v7.0: https://openxcom.org/forum/index.php/topic,4230.msg137247.html#msg137247)
4. vanilla throwing training completely removed!
5. vanilla melee training moved to new common system... mostly unchanged, you cannot train on mind-controlled aliens anymore though
6. vanilla firing training reworked completely
7. vanilla secondary stat (tu, stamina, hp, strength) training unchanged, but is now triggered also by throwing experience gained

General rules:
a/ you can train accuracy (firing / throwing / melee) only if you HIT the enemy
b/ neutrals don't count
c/ enemies under mind-control don't count
d/ friends under mind-control don't count
e/ the hit must be caused by a weapon... i.e. hitting an explosive pipe, which kills the unit doesn't count
f/ you are not limited to firing/throwing/melee only... there is a possibility to override it by 32 new options... more about that later

Default algorithm:
1. if grenade or proxy grenade weapon type => train throwing (+1 for each unit hit)
2. if melee weapon type => train melee (miss is not a hit!)
3. if firearm (or other) train:
3a. if not ranged attack, train melee (e.g. gun butt)
3b. otherwise if arcing shot, train throwing (e.g. flamethrower, javelins, combat bow, grenade launcher, molotov, black powder bomb, stick grenade, acid flask, apple, ...)
3c. otherwise if maxRange > 10, train firing (e.g. panzerfaust, harpoon gun, shotgun, assault rifle, rocket launcher, ...)
3d. otherwise if maxRange between 2 and 10, train throwing (e.g. fuso knives, zapper, ...)
3e. otherwise if maxRange = 1, train melee (e.g. hammer, chainsaw, fusion torch, ...)
3f. otherwise nothing!

Notes:
 - all shotgun pellets fired at the same time count only as one hit only
 - explosive, incendiary, etc. ammo hitting multiple units counts as multiple hits
 - smoke hits too :)
 - stun as well

There is a possibility to skip the default algorithm completely, by adding "experienceTrainingMode" attribute to your weapon.
(this attribute works also when healing fatal wounds using medikits; allies, enemies and neutrals all count)

How it works:
- ignores default algorithm completely
- supports values from 0 to 32 (0 means turned off, i.e. use default algorithm)
- can train all primary skills, but psi strength and psi skill can only be trained if soldier already has psi skill > 0 (without armor buffs!)
- you can only have one override, so weapons with two different attacks are not well suited for that (e.g. rifle's shots and gun butt attack)

A full list of possible overrides:
0 default algorithm -- if nothing is specified
1 train melee
2 train melee 50% chance
3 train melee 33% chance
4 train firing
5 train firing 50% chance
6 train firing 33% chance
7 train throwing
8 train throwing 50% chance
9 train throwing 33% chance
10 train firing and throwing
11 train firing or throwing (coinflip)
12 train reactions
13 train reactions and melee
14 train reactions and firing
15 train reactions and throwing
16 train reactions or melee (coinflip)
17 train reactions or firing (coinflip)
18 train reactions or throwing (coinflip)
19 train bravery
20 train bravery x2
21 train bravery and reactions
22 train bravery or reactions (coinflip)
23 train bravery or reactions (coinflip) x2
24 train psi strength
25 train psi strength x2
26 train psi skill
27 train psi skill x2
28 train psi strength and psi skill
29 train psi strength and psi skill x2
30 train psi strength or psi skill (coinflip)
31 train psi strength or psi skill (coinflip) x2
32 train nothing

Cheers,
Meridian
« Last Edit: March 07, 2021, 11:51:55 am by Meridian »

Offline eisenefaust

  • Sergeant
  • **
  • Posts: 15
    • View Profile
Re: New experience award system / accuracy training system
« Reply #1 on: January 17, 2016, 01:31:23 am »
Hi Meridian, thanks for putting in so much effort into this.
Two quick questions for you though, with override 12 through 18 and 21 would it be possible for you train reactions with an active action rather than on the the opponents turn?
Would mortar have a default override of 10?
Thanks

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: New experience award system / accuracy training system
« Reply #2 on: January 17, 2016, 11:03:57 am »
Two quick questions for you though:
1: With override 12 through 18 and 21 would it be possible for you train reactions with an active action rather than on the the opponents turn?
2: Would mortar have a default override of 10?

1: Yes, as I said this training is applicable only when you hit the enemy. For example you can redefine the Cutlass to train Melee+Reactions on every hit (instead of just Melee)
2: I don't have control over PirateZ code, you'll have to ask Dioxine.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: New experience award system / accuracy training system
« Reply #3 on: January 17, 2016, 11:37:29 am »
Would mortar have a default override of 10?

In your dreams maybe...

Offline eisenefaust

  • Sergeant
  • **
  • Posts: 15
    • View Profile
Re: New experience award system / accuracy training system
« Reply #4 on: January 17, 2016, 11:10:49 pm »
In your dreams maybe...
or 11 maybe for the coin flip?
The point is I think it's rather odd for any weapon to utilize multiple stats for accuracy or damage and no chance or raising some that it uses.
What do you think Dioxine?

Offline hellrazor

  • Commander
  • *****
  • Posts: 2013
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: New experience award system / accuracy training system
« Reply #5 on: January 17, 2016, 11:21:06 pm »
e/ the hit must be caused by a weapon... i.e. hitting an explosive pipe, which kills the unit doesn't count <--

No more Improvisation? Come on! Let me Blow up those pipes.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8597
    • View Profile
Re: New experience award system / accuracy training system
« Reply #6 on: January 17, 2016, 11:30:37 pm »
e/ the hit must be caused by a weapon... i.e. hitting an explosive pipe, which kills the unit doesn't count <--

No more Improvisation? Come on! Let me Blow up those pipes.

You would still get the entry in the soldier diaries ;-) If it was in OXCE.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: New experience award system / accuracy training system
« Reply #7 on: February 25, 2016, 07:52:43 pm »
I would like to suggest a new mechanism for bravery increases.

In normal play, meaning not specifically playing to train a stat, I've only gotten one stat increase so far. And that was because of repeated enemy voodoo use to panic this one gal.
To train bravery, I put an unconscius enemy in a place whithout weapons where I can trap him (cave for example) and then revive him there. Finish rest of the map, then wait 10 turns so low bravery gals panic a lot and then finish off the trapped enemy. This only works for gals with bravery <60 though.
Another method is flag abuse. Have two gals alternate using your flag. Flag use drops your morale under 50 and restores moral for the other gal so she can use the flag next turn.
Both these methods are not fun to do, but bravery is an important stat in XPiratez and stat increases are needed.

Here is my suggestion:
Instead of the resisted panic counter to give a stat increase chance, use the kill counter. Each kill gives a 10% chance to increase bravery. 3 kills, 30% chance to get a bravery increase at the end of the mission. Actual percentages need to be playtested and there could be diminishing returns depending on bravery stat. Like percentage per kill = (10% - bravery/10). But you get the idea I hope.
This mechanic would also force you to make more decisions. Economy wise, you want to stun every enemy to get more money. But to get bravery stat increases, you would need to kill them instead of stunning them. So now decide, stat increase or money?

Edit: fixed typos
« Last Edit: February 25, 2016, 08:59:54 pm by Eddie »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: New experience award system / accuracy training system
« Reply #8 on: February 25, 2016, 08:26:25 pm »
Kills increasing bravery could make sense. A gal who kills lots should be confident.

By opposition, should getting injured give a chance of reducing bravery? If you get injured a lot, you wouldn't be very confident... thjat could create an interesting dynamic bravery.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: New experience award system / accuracy training system
« Reply #9 on: February 25, 2016, 09:30:36 pm »
Well, the opposite can be easily argued. I can't see what killing people has to do with Bravery? It already increases Morale, so it would be a geometrical effect. Conversely, one could argue that getting injured and going back to fight should increase Bravery, as the soldier finds new confidence to fight.
Naturally the issue of Bravery training should be resolved at some point (added Braver training to healing, but medical items do not support training... yet), but privately, I pretty much ignore Bravery - if it's too low, soldier will panic and eventually their Bravery will rise. So unlike with Reactions, I think training bravery by mechanics abuse is a waste of time.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: New experience award system / accuracy training system
« Reply #10 on: February 25, 2016, 09:44:11 pm »
I was just thinking along simple lines:

If you kill most of what you meet, you can be confident that upon meeting more opposition, you'll kill 'em too. (until you meet something significantly stronger than what you met previously!)

If you get injured often in the field, you probably won't like being there and be likely to want to run away.

But in general I agree, many of my best soldiers have very low bravery (see capt'n's log) and they do totally fine. The only time it's an issue is when hunting for the last few enemies on a map, by which point the only question is "how long is it going to take for me to win?"

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: New experience award system / accuracy training system
« Reply #11 on: April 26, 2016, 12:38:22 am »
I may have encountered a bug. I had a gal with combat shotgun on a mission and she had 3 shots with hits, but she got no accuracy experiance from the mission. Is this how it is supposed to be?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: New experience award system / accuracy training system
« Reply #12 on: April 26, 2016, 12:41:19 am »
I may have encountered a bug. I had a gal with combat shotgun on a mission and she had 3 shots with hits, but she got no accuracy experiance from the mission. Is this how it is supposed to be?

AFAIK only the first pellet can award experience. So it's possible that while other pellets hit, the first one missed and therefore no exp.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: New experience award system / accuracy training system
« Reply #13 on: April 26, 2016, 12:55:07 am »
Thanks, thats what I thought. I suppose there is no other way to code this?

Maybe this would work: The hitlog can already tell if shotgun pellet hits are from the same shot or not. So this "shot + any number of hits" data could be used for a more accurate xp calculation
« Last Edit: April 26, 2016, 12:59:28 am by Eddie »

Offline sambojin

  • Captain
  • ***
  • Posts: 78
    • View Profile
Re: New experience award system / accuracy training system
« Reply #14 on: April 26, 2016, 02:11:59 am »
I'm still a bit iffy on grenade launchers, flamers and assault cannons training throwing as the default (I can understand why, to save making two arcing lists, but it doesn't make sense). There's plenty of ways of training throwing now, so I don't really think bows need any more help.

And for bravery training, it's fine. Want more self confidence in your ability to take on anything without whimping out? Turn up in a skimpy outfit, or nothing at all, and survive a few missions. By the end of it that gal won't be scared of anything. Boob-swing induced combat stress is very character building, even to the scaredy cats.

Q: Does the "first pellet" thing only apply to shotguns, or does it apply to auto-fire weapons too? And funny ones like flamers?
« Last Edit: April 26, 2016, 02:14:04 am by sambojin »