OpenXcom Forum

Modding => Released Mods => XPiratez => Topic started by: yrizoud on January 11, 2016, 03:35:01 pm

Title: throwing experience for weapons which rely on throwing skill
Post by: yrizoud on January 11, 2016, 03:35:01 pm
Piratez includes several different weapons which rely on throwing skill when you "shoot" them : black powder bombs and molotovs, bows, knives. I really like how it lets you use recruits who have a bad shooting accuracy. Even weaker ones can be bowwomen with unlimited ammo.

However, there is the issue that these weapons don't train the right stat... The standard experience system gives "shooting experience" when you hit a hostile target with any ranged weapon (either directly or with splash damage), and this increases firing accuracy, not throwing.
So my suggestion would be for Extended to modify the experience system accordingly.
1) Ranged weapons which rely more on "throwing" than "shooting" should give throwing experience when hitting a hostile, instead of shooting experience.
2) In this case it should still trigger secondary experience gains (TU, energy,..)
Such rules can be hard-coded, because it only triggers in games/mods that include such weapons.

Now, personnally I wouldn't stop there, but I know this gets far from vanilla...
3) Grenade/proxies explosions which hit a hostile would give throwing experience instead of shooting experience. And still provide secondary experience, like in 2)
4) Throwing random stuff would stop giving throwing experience once the character has reached the average stat of a hired soldier.
5) For equity, I would give "shooting experience" to soldiers who shoot at a hostile target (even if they miss) if their shooting accuracy is under-average. This should not trigger secondary experience gain, because it's too easy to abuse.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Solarius Scorch on January 12, 2016, 10:18:33 am
I agree, but:

4) Throwing random stuff would stop giving throwing experience once the character has reached the average stat of a hired soldier.

How about: when any damage is dealt? Or at least when an enemy is hit?

5) For equity, I would give "shooting experience" to soldiers who shoot at a hostile target (even if they miss) if their shooting accuracy is under-average. This should not trigger secondary experience gain, because it's too easy to abuse.

It would still be abused though. "Let everyone shoot everywhere for points." Nah.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: yrizoud on January 12, 2016, 03:53:16 pm
How about: when any damage is dealt? Or at least when an enemy is hit?
Rule 3 handles it (in vanilla it gives shooting accuracy and secondary gains, my proposal is to change the reward to throwing accuracy + secondary gains)
This rule 4 is about the experience you normally get from just throwing flares and such, I propose to stop giving it to soldiers who have reached the average stat. At this point, only two things will keep improving the stat : Hitting hostiles with timed explosives and proxies (rule 3) or direct hits with throwing-based weapons (rule 1)
It would still be abused though. "Let everyone shoot everywhere for points." Nah.
This is only a boost for sub-average soldiers, the ones that you would have sacked and replaced immediately if you had the cash. If such underdog sees enough action to shoot 40+ times at aliens, surviving 5+ missions, IMO they deserve to reach the status of "barely useful".
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 12, 2016, 03:58:28 pm
Piratez includes several different weapons which rely on throwing skill when you "shoot" them : black powder bombs and molotovs, bows, knives. I really like how it lets you use recruits who have a bad shooting accuracy. Even weaker ones can be bowwomen with unlimited ammo.

However, there is the issue that these weapons don't train the right stat... The standard experience system gives "shooting experience" when you hit a hostile target with any ranged weapon (either directly or with splash damage), and this increases firing accuracy, not throwing.
So my suggestion would be for Extended to modify the experience system accordingly.
1) Ranged weapons which rely more on "throwing" than "shooting" should give throwing experience when hitting a hostile, instead of shooting experience.
2) In this case it should still trigger secondary experience gains (TU, energy,..)
Such rules can be hard-coded, because it only triggers in games/mods that include such weapons.

Now, personnally I wouldn't stop there, but I know this gets far from vanilla...
3) Grenade/proxies explosions which hit a hostile would give throwing experience instead of shooting experience. And still provide secondary experience, like in 2)
4) Throwing random stuff would stop giving throwing experience once the character has reached the average stat of a hired soldier.
5) For equity, I would give "shooting experience" to soldiers who shoot at a hostile target (even if they miss) if their shooting accuracy is under-average. This should not trigger secondary experience gain, because it's too easy to abuse.

1/ agreed, but I would modify the condition a little bit ... "rely more on throwing" is hard to define... I would distinguish between arcing shot (trains throwing) and normal shot (trains firing)
2/ agreed
3/ this is hard-ish to do currently, oxc doesn't know about the weapon at this moment anymore, just knows the damage type (i.e. don't know if it was rocket launcher or grenade)
4/ I would limit this to throwing of primed grenades or proxies; or disposable items with clipsize = 1 (i.e. molotovs, powder bombs, acid flasks, ...)
5/ no

I am currently working on this... we'll see what I can do until evening.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 12, 2016, 05:16:57 pm
OK, here's my proposal, already implemented.

Throwing training 1:
 - anytime a primed grenade is thrown anywhere
 - e.g. primed frag grenade, primed smoke grenade, ...

Throwing training 2:
 - anytime a primed proxy is thrown anywhere
 - e.g. primed landmine, ...

Throwing training 3:
 - anytime a disposable (weapon's clipSize=1) weapon with arcing trajectory is "fired" (i.e. not thrown!)
 - e.g. molotovs, black powder bombs, acid flasks

Throwing training 4:
 - anytime a non-disposable (i.e. stays in hand after fired) weapon with arcing trajectory is fired and enemy unit is hit (mind-controlled also count)
 - e.g. combat bow

Firing accuracy training 5:
 - anytime a non-disposable (i.e. stays in hand after fired) weapon with non-arcing trajectory is fired and enemy unit is hit (mind-controlled also count)
 - e.g. fuso knives, x-bow, sniper rifle, rocket launcher

There are no other ways to train throwing or firing accuracy.

Comments are welcome... but I cannot guarantee your wishes will be fulfilled.

PS: there are still ways to spam... but at least it either consumes the items (unlike flares previously) or burdens the soldier and endangers others (throwing heavy proxies)
PS2: bow finally trains throwing, yay!
PS3: fuso knives train firing though (based on rule 5), it's not so bad, and could be "fixed" by giving them arcing trajectory
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 12, 2016, 05:50:08 pm
Meridian's solution seems the most sensible, although I'd add the condition of hitting an enemy to 1-3 as well (which I think would mean 2 would be gone), especially with decent Throwing training using bows available. Easier Throwing training isn't really needed, as Piratez starting/early game teams are supposed to be composed of specialists with weaknessess, not all-round-good soldiers. Yrizoud arguments about soldiers staying "useless" are unfounded, since the Dojo (training facility) has been moved down the science ladder and it can make every soldier from zero to hero within 2-3 months (it trains everything but psi, reactions and bravery).
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: yrizoud on January 12, 2016, 06:23:08 pm
The fuso knives are indeed the reason why "weapon is arcing" didn't seem like the perfect criteria.
Meridian, did you modify the code that grants secondary stats? It should now count, otherwise the amazons will never improve rank/TU/stamina/health/strengh
It should look like the following, in BattleUnit.cpp
Code: [Select]
if (_expBravery || _expReactions || _expFiring || _expPsiSkill || _expPsiStrength || _expMelee)
Dioxine, sorry I didn't even know about Dojo :-[ And my resentment about "bad shooting accuracy = useless" is a leftover from vanilla UFO. Piratez provides ways for several other stats to come to the rescue.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 12, 2016, 06:28:49 pm
Meridian, did you modify the code that grants secondary stats? It should now count, otherwise the amazons will never improve rank/TU/stamina/health/strengh
It should look like the following, in BattleUnit.cpp
Code: [Select]
if (_expBravery || _expReactions || _expFiring || _expPsiSkill || _expPsiStrength || _expMelee)

No, I forgot to add the throwing, dang it!
Thanks for the reminder; I'll fix it tomorrow.

Btw. the change is here if you want to see it: https://github.com/MeridianOXC/OpenXcom/commit/1e39183b919bcf1963eb8e2b6c8c18a834d8be6e
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 12, 2016, 07:46:10 pm
Arcing weapon is a good criterium, even if knives won't train the right skill - there are plenty of ways to train it anyway, and knives are powerful as hell. Naturally the best would be an item-based override, but... it'd involve tons and tons of work. At least that way you will be rotating soldiers (mortar -> knives, knives -> guns etc.)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: eisenefaust on January 13, 2016, 04:10:23 am
Rather than kluging together all these special cases, how hard would it be to add flags for which stat to handle experience point gain on events? It seems like it would be easy to add another variable to when filling out the weapon information from the file and check which stats are used in calculating accuracy and/or damage. That would also be cleaner implementation for a generic OXCE implementation imo.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: yrizoud on January 13, 2016, 11:22:27 am
Yes the code would be straightfoward, but there is like a hundred items in Piratez, I understand Dioxine's reluctance : It's one more piece of information to maintain forever.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 13, 2016, 11:52:41 am
Yes the code would be straightfoward, but there is like a hundred items in Piratez, I understand Dioxine's reluctance : It's one more piece of information to maintain forever.

Just a hundred? Don't be ridiculous, it's over 500 :) But yeah that's the reason for my reluctance.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Boltgun on January 13, 2016, 11:59:55 am
Giving throwing for arching trajectory is a simple solution that take out a lot of flare throws. Grenade launchers will also train throwing and that makes sense.

I am also thinking about melee 'guns' like chainsaws or hammers, should they give melee experience? Perhaps making all guns with a range of 1 give such experience would easily fix that.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 13, 2016, 12:50:22 pm
I am also thinking about melee 'guns' like chainsaws or hammers, should they give melee experience? Perhaps making all guns with a range of 1 give such experience would easily fix that.

Seconded. And the knive problem? And! non-arcing guns with max range 2-10 should give Throwing experience. Any thrown weapons with better range are Arcing afaik, and there are no real guns with such limited range, with just a very few oddities (like the Whip... which should train throwing anyway!)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 02:07:58 pm
Fair enough.
I have split Rule 5 (https://openxcom.org/forum/index.php/topic,4220.msg57516.html#msg57516) into 4 sub-rules

Rule 5a:
 - same as rule 5 with maxRange > 10, trains firing accuracy
 - e.g. x-bow

Rule 5b:
 - same as rule 5 with 1 < maxRange <= 10, trains throwing accuracy
 - e.g. fuso knives

Rule 5c:
 - same as rule 5 with maxRange = 1, trains melee accuracy
 - e.g. hammer

Rule 5d:
 - same as rule 5 with maxRange < 1, trains nothing
 - e.g. ???
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 13, 2016, 02:33:37 pm
Awesome! How about rules 1-3? I'd like the condition to hit the enemy with these to be in, best would be optional - so you either play as intended - no experience without scoring actual hits - or have even easier time upgrading Throwing, as you wanted (mind you, that even smoke grenades will grant you Throwing when you hit the enemy with the smoke cloud).
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 02:38:30 pm
Awesome! How about rules 1-3? I'd like the condition to hit the enemy with these to be in, best would be optional - so you either play as intended - no experience without scoring actual hits - or have even easier time upgrading Throwing, as you wanted (mind you, that even smoke grenades will grant you Throwing when you hit the enemy with the smoke cloud).

I don't see a way how to easily do it.
I would have to change a lot in the source code... unless someone has an idea how to do it in the current framework.

EDIT: the events of throwing a grenade and grenade exploding are just too disconnected... but I will try for rule 3 (weapons with immediate effect like molotovs, etc.)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 13, 2016, 02:56:47 pm
All righty then, so your solution seems the best we can have. Deeper modifications, in addition to being difficult, can lead to further bugs... So, how about this:

- Rule 3. is fine.
- For rule 1 & 2, the explosive needs to be primed for 0 or 1 (else someone just could replace training flares with HE grenades pre-primed for 23 turns...). There's scarcely any practical reason to prime them for more than 1 turn, anyway (well, in 95% cases, you prime them for 0...).
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 06:50:33 pm
EDIT: the events of throwing a grenade and grenade exploding are just too disconnected... but I will try for rule 3 (weapons with immediate effect like molotovs, etc.)

I couldn't make this work either.

- For rule 1 & 2, the explosive needs to be primed for 0 or 1 (else someone just could replace training flares with HE grenades pre-primed for 23 turns...). There's scarcely any practical reason to prime them for more than 1 turn, anyway (well, in 95% cases, you prime them for 0...).

This doesn't help against spam.
You can prime it for 0 and have two soldiers throw it to each other like a hot potato.
You can even throw it on the tile you're standing on and constantly pick it up.

I think we've done enough for now... let's test how it works out.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: eisenefaust on January 13, 2016, 10:04:00 pm
Maybe I wasn't describing my thoughts accurately.
What I was thinking was when reading in the ruleset for accuracy you use that to determine experience points. You could also do something for calculating bonus damage. I haven't taken a close look at the source code, but if those places are too far separated from experience gain, then add a tracking variable in the weapon class that's built up during ruleset parsing from the accuracy and bonus damage. No special cases, no need to have lots of extra handlers per weapon.
What do you guys think?
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 11:01:36 pm
Maybe I wasn't describing my thoughts accurately.
What I was thinking was when reading in the ruleset for accuracy you use that to determine experience points. You could also do something for calculating bonus damage. I haven't taken a close look at the source code, but if those places are too far separated from experience gain, then add a tracking variable in the weapon class that's built up during ruleset parsing from the accuracy and bonus damage. No special cases, no need to have lots of extra handlers per weapon.
What do you guys think?

I assume you are referring to projectile weapons (the ones that "hit").
The ruleset is available at all times, no problem there... but there are logical difficulties.
For example, what if your theoretical weapon has accuracy = firing*0.5 + throwing*0.5 ? Which experience point would you award?

If you're talking about grenades/proxies/etc. (things that don't "hit"), there is a whole number of other issues... mostly code being rather complex (and shared with other things that can "explode"), requiring a lot of reading/understanding before I can even think of making a change.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: eisenefaust on January 13, 2016, 11:27:38 pm
If it had both firing and throwing like the mortar then it increases both. How about iterating over the accuracy and bonus damage modifiers when damage is dealt. Anything that affects accuracy or damage gets awarded experience. Since only handling at damage dealt (would have to be before armor and resistances), this removes training via flares all together. This would also handle primed things, proximity, and guns all the same.
 I suppose I also assume which actor tried to deal damage is tied tightly to the damage already or else proximity and primed grenades awarding experience properly is more convoluted than I thought.
Thoughts?
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Yankes on January 13, 2016, 11:33:29 pm
I think better is made proper skill grain system. Each action would have separate list what it grain. Additional we could made it percent value that will determine what effective it would be.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 11:39:40 pm
If it had both firing and throwing like the mortar then it increases both. How about iterating over the accuracy and bonus damage modifiers when damage is dealt. Anything that affects accuracy or damage gets awarded experience. Since only handling at damage dealt (would have to be before armor and resistances), this removes training via flares all together. This would also handle primed things, proximity, and guns all the same.
 I suppose I also assume which actor tried to deal damage is tired tightly to the damage already or else proximity and primed grenades awarding experience properly is more convoluted than I thought.
Thoughts?

Training both is too much in my opinion.

Dealing damage with grenades (in vanilla) doesn't award any throwing experience at all... if I understand the code correctly. Only the act of throwing the grenade (or anything else) does.

For the rest, everything is possible... the question is if you can do it and if it is worth it... I won't be looking at that at the moment.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: eisenefaust on January 13, 2016, 11:47:25 pm
From: https://www.ufopaedia.org/index.php?title=Grenade

Quote
Throwing Grenades improve Throwing Accuracy, and also Firing Accuracy when enemies are caught by explosions. All enemies (if not mind controlled) caught in the blast will give experience toward firing accuracy, even if undamaged (i.e., their armor absorbed it) - see Experience.

All in all. I like Yankes idea. And this seems to me to be a feature that should be brought into OXCE to support other mods.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 13, 2016, 11:58:17 pm
All in all. I like Yankes idea. And this seems to me to be a feature that should be brought into OXCE to support other mods.

And what does "each action" mean exactly?
If it's just the battle action (e.g. BA_THROW or BA_AUTOSHOT) that's far away from being enough.
And from the other side, is exploding grenade even an action?.... in my opinion not, as it doesn't require anyone to (directly) act (in game's terms).... it just happens.

I am not against improvements, but it needs to be very carefully and precisely defined... and if possible should be easy to understand.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Yankes on January 14, 2016, 12:22:59 am
And what does "each action" mean exactly?
If it's just the battle action (e.g. BA_THROW or BA_AUTOSHOT) that's far away from being enough.
And from the other side, is exploding grenade even an action?.... in my opinion not, as it doesn't require anyone to (directly) act (in game's terms).... it just happens.

I am not against improvements, but it needs to be very carefully and precisely defined... and if possible should be easy to understand.
Basic would be current place where skill grain is awarded. Next event like grenade or proxy explosion. Question is that values would be shared (between places) or if there should be special cases (in one place).
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: yrizoud on January 14, 2016, 12:41:03 am
For example, what if your theoretical weapon has accuracy = firing*0.5 + throwing*0.5 ? Which experience point would you award?
From looking at the file, Piratez does include a mortar which uses 0.5 throwing and 0.5 shooting.
No matter what you decide to code in case of a tie, the mod itself can choose to set one of the accuracyMultipliers to 0.5 and 0.501, to explicity state the tie-breaker.

About the existing experience given by grenades/proxies : It works because battle items have a _previousOwner field, it points to who threw or dropped it.
 If/when item sets off, this field is passed to the new ExplosionBState()as the last (optional) argument. In turn, when ExplosionBState::explode() calls TileEngine::explode(), it passes this unit as the last (optional) argument.
There are two cases where TileEngine::explode() receives a unit : when a fired weapon causes AOE, and when an explosive item which was carried by someone sets off. It's tricky because at this point in the code, there's no longer any track of HOW the damage was caused.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 14, 2016, 10:21:59 am
About the existing experience given by grenades/proxies : It works because battle items have a _previousOwner field, it points to who threw or dropped it.
 If/when item sets off, this field is passed to the new ExplosionBState()as the last (optional) argument. In turn, when ExplosionBState::explode() calls TileEngine::explode(), it passes this unit as the last (optional) argument.
There are two cases where TileEngine::explode() receives a unit : when a fired weapon causes AOE, and when an explosive item which was carried by someone sets off. It's tricky because at this point in the code, there's no longer any track of HOW the damage was caused.

Yes, that's exactly how far I got as well.
And since there was no track of what weapon caused the damage, I gave up.

But reading this now, my changes will probably have some funny effects... like soldier throws a proxy... which goes off 5 turns later, in the meantime the soldier is already holding something else in their active hand (e.g. hammer) and I will therefore give them melee experience.

I'll have to test it... if so, I may as well do the big changes I wanted to avoid.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Yankes on January 14, 2016, 08:41:18 pm
I think proper solution is propagate unit action instead only unit. In case of proxy & grenade create dummy one with filled unit and battle action (throw or custom new BA?).
Another thing is replacing ammo with weapon when passing to explosion function (currently melee weapons with ammo work that way).
This is important step for other future possibilities like weapon giving boost to damage (only problem is when ammo is used and unloaded, if done to fast it will be lost for damage function).

With this two steps you will always have correct battle action and weapon that cause it. This will require lot of work and testing but in long run it will simplify code and create new opportunists for new functionality.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: eisenefaust on January 14, 2016, 11:03:02 pm
Awesome! That sounds great Yankes!
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Yankes on January 14, 2016, 11:49:12 pm
Awesome! That sounds great Yankes!
That was only possible solution and is bit long way to made it working :) It always possible that something will go wrong and every thing will be pointless.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: sambojin on January 16, 2016, 03:50:36 am
Just throwing in something. Arcing weapons and explosive weapons may not be a good criteria for extracurricular throwing training.

Assault Cannons w/Expl. Cannonballs do exist.

They're cheap, they arc, they explode. They're pretty accurate. They're early game weapons which entirely replace grenade launchers, and most other things of that nature. Cheap and light ammo too, that is quick to manufacture. They last all campaign as perfect hand-me-downs, but are also good for experienced gals.

I'm fine if the intention is for one of the best workhorse weapons in the game to *also* train throwing, but I don't think that's the case. But it could be.

Every noob with 20+ str can get one and two reloads with runt duds on, and maybe a backup bow (or set of fuso knives) if they're strong enough, until they're worthy. Or if they're awesome anyway.

Flamers arc too, and have a blast radius. A Gym Suit or Bikini and they're great. Another perfect workhorse weapon, for noobs and bosses alike. But for training other skills too? 8 potential hits a shot, and most things require a few direct hits to go down. Would synergize perfectly with bows too, even with an accuracy drop for two-handed.

They'll get some hits, some kills, and will now also train throwing. Intended?

Not a biggy, because they already get hits or kills with these weapons. It just gives them an extra skill to tick upwards. Probably for their backup weapon anyway (aside from a cattle-prod). But they're belt, QD or offhand weapons, with essentially unlimited ammo, that come on pretty early and are cheap as well. Knives for cannoneers, bows for cooks.

I can see a couple of "perfect warrior" builds coming out of this, if the above weapons train throwing as well. Add a backpack prod after strength gets high enough and there's nothing you can't try to do with these gals.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 16, 2016, 08:58:28 am
They are not training throwing "as well", but "instead of" firing. Btw. until now you could train throwing just by throwing anything anywhere, so with this change, it is certainly harder to train throwing. And it will become even harder once I finish complete rework of training system configuration.
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 16, 2016, 11:26:06 am
I think the praise levelled at Assault Cannon is overt, the Grenade Launcher is a better weapon in every aspect (well it doesn't have the Balls of Steel, but who uses them), and the ammo for it is only like, twice or thrice more expensive. Once you get to Elerium Explosives, it becomes devastating with HE 90 grenades. If someone wanted to spam an arcing weapon, he'd use that. Or even better... Flamethrower, with 8 shots per attack (10 with Heavy)? Man.

What do you think about flamethrowers Meridian? Won't they train Throwing at an insane speed? Maybe arcing autoshot should count as a single attack for throwing training? Or maybe arcing weapons below arbitrary 30% accuracy shouldn't train anything at all?

Unless you're making a more advanced system already :)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 16, 2016, 01:38:45 pm
Unless you're making a more advanced system already :)

I am making it right now... and I am being quite successful.
Still many hours of testing in front of me though.

I am at a point where also points 1/2/3 work as you suggested, i.e. only when grenades actually hit.

Now I am adding a possibility to override the algorithm-based training with a custom training (per weapon)... and no, the "formula" will not be freely definable by ruleset, you will only have (more than enough) options to choose from (see spoiler, feel free to propose other options, I promise to consider them :) ):

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
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 16, 2016, 01:53:51 pm
Looks like there are indeed more than enough override options. I just hope the basic formula will be good enough to skip overriding for most cases :)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Yankes on January 16, 2016, 02:35:58 pm
I am making it right now... and I am being quite successful.
Still many hours of testing in front of me though.

I am at a point where also points 1/2/3 work as you suggested, i.e. only when grenades actually hit.

Now I am adding a possibility to override the algorithm-based training with a custom training (per weapon)... and no, the "formula" will not be freely definable by ruleset, you will only have (more than enough) options to choose from (see spoiler, feel free to propose other options, I promise to consider them :) ):

This look good, probably best balance between customization and simplicity. I will probably steal this functionality to my branch :)
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Meridian on January 16, 2016, 09:29:17 pm
This look good, probably best balance between customization and simplicity. I will probably steal this functionality to my branch :)

Hope my code won't be too bad, I haven't touched C++ since 2001 or so, with very small exceptions.
Commits:
- default algorithm: https://github.com/MeridianOXC/OpenXcom/commit/43053e2e78e00718adc709010ef865e056ec71c3
- overrides: https://github.com/MeridianOXC/OpenXcom/commit/98670473a90f8ea3121989930fbd26fe13e47027

Anyway, totally exhausted, after 20 hours (1 hour development + 19 hours testing), here's the result: https://openxcom.org/forum/index.php/topic,4230.0.html

PS: big thanks to Dioxine for extracting the weapon pack for me... without it, it would take at least 5x longer
Title: Re: throwing experience for weapons which rely on throwing skill
Post by: Dioxine on January 16, 2016, 09:43:38 pm
Looks awesome. I will put it to tests immediately when I can look upon this game again (0.97C developement was hectic and I need a break myself).