project-navigation
Personal tools

Author Topic: New soldier stat increase system  (Read 45931 times)

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
New soldier stat increase system
« on: February 12, 2008, 12:53:05 pm »
This thread is meant for me to present the new soldier stat increase system and for everyone else to discuss it.

BASICS
The new system is an implementation of this wiki proposal. Soldiers gain "experience" in combat vor performing various actions. As a result, their stats will rise, at an increasingly slower rate. Experience is gained and stored for every individual stat.

ASSUMPTIONS
These are the assumptions I made when writing the proposal and the code. Important to note is that these assumptions ar of the finished version of the game - not 2.2! So if an assumption clearly conflicts with 2.2, don't go off telling me I'm wrong, because I'm not talking about 2.2 here.

- Soldiers have an expected career length of 100 missions. That is to say, a soldier that is in active service, going on a majority of the missions, is expected to participate in about 100 of them over the course of the game, without being killed.
- There will be missions with less than or more than 8 aliens.
- XP will increase even outside missions, as a result of training facilities. Most XP should be earned in combat, however.

CAPS
These are the XP caps. A soldier can never gain more XP on a mission than the XP cap, no matter how much XP he earns from his actions. The caps are based around a "target" increase for the skill over 100 missions. For example, speed is set to increase by 15 points. To find the amount of XP x the soldier must earn to increase by 15 points the calculation is:
log 15 / log x = 0.6
log x = log 15 / 0.6
x = 10 ^ (log 15 / 0.6)
x = 91 (rounded)

This would mean an average of 0.91 per mission. Unfortunately, code limitations disallowed me from using floating point numbers for the XP values, so I do the division by 100 internally, and work with the calculated value.

Laziness, so here's the switch from the code (comments added here only):
Code: [Select]
case ABILITY_POWER:
return 46; //target 10
case ABILITY_SPEED:
return 91; //target 15
case ABILITY_ACCURACY:
return 290; //target 30
case ABILITY_MIND:
return 290; //target 30
case SKILL_CLOSE:
return 680; //target 50
case SKILL_HEAVY:
return 680; //target 50
case SKILL_ASSAULT:
return 680; //target 50
case SKILL_SNIPER:
return 680; //target 50
case SKILL_EXPLOSIVE:
return 680; //target 50
case SKILL_NUM_TYPES: /* This is health. */
return 2154; //target 100

USABLE STATISTICS
In an attempt to prevent people from suggesting unworkable alternatives, here is the struct of statistics that is used to calculate the XP values. If it isn't in here, it isn't counted. I took the liberty of removing a few lines for stuff that can't be used, for the sake of brevity.
Code: [Select]
/* Movement counts. */
int movedNormal;
int movedCrouched;

/** Kills & stuns @todo use existing code */
int kills[KILLED_NUM_TYPES]; /**< Count of kills (aliens, civilians, teammates) */
int stuns[KILLED_NUM_TYPES]; /**< Count of stuns(aliens, civilians, teammates) */

/**
* Hits/Misses @sa g_combat.c:G_UpdateHitScore. */
int fired[SKILL_NUM_TYPES]; /**< Count of fired "firemodes" (i.e. the count of how many times the soldeir started shooting) */
int firedTUs[SKILL_NUM_TYPES]; /**< Count of TUs used for the fired "firemodes". (direct hits only)*/
int hits[SKILL_NUM_TYPES][KILLED_NUM_TYPES]; /**< Count of hits (aliens, civilians or, teammates) per skill.
* It is a sub-count of "fired".
* It's planned to be increased by 1 for each series fo shots that dealt _some_ damage. */
int firedSplash[SKILL_NUM_TYPES]; /**< Count of fired splash "firemodes". */
int firedSplashTUs[SKILL_NUM_TYPES]; /**< Count of TUs used for the fired "firemodes" (splash damage only). */
int hitsSplash[SKILL_NUM_TYPES][KILLED_NUM_TYPES]; /**< Count of splash hits. */
int hitsSplashDamage[SKILL_NUM_TYPES][KILLED_NUM_TYPES]; /**< Count of dealt splash damage (aliens, civilians or, teammates).
* This is counted in overall damage (healthpoint).*/
int skillKills[SKILL_NUM_TYPES]; /**< Number of kills related to each skill. */

int heal; /**< How many hitpoints has this soldier received trough healing in battlescape. */

FORMULAS
Power: Currently fixed at 46. I didn't see a point in coming up with a formula as long as power is unused.
Speed: 1 point for every space moved. 2 points for every space moved while crouched. 1 point for every 10 TUs spent using weapons.
Accuracy: 20 points for every hit scored on an enemy. Only one hit can be scored per use of a weapon, except for splash weapons. 30 points for hits with sniper weapons.
Mind: 100 points for every enemy kill.
Close: 150 points for every hit on an enemy. One hit per weapon use, except splash.
Heavy: 200 points for every hit on an enemy. One hit per weapon use, except splash.
Assault: 100 points for every hit on an enemy. One hit per weapon use, except splash.
Sniper: 200 points for every hit on an enemy. One hit per weapon use, except splash.
Explosive: 200 points for every hit on an enemy. One hit per weapon use, except splash.
Health: The sum of all other experience gained (after caps), divided by two.

CALCULATION
After a mission, the XP counts are calculated as follows. The soldier then receives XP equal to to the earned value or the cap, whichever is smallest. Then the stats are updated as follows:
new value = start value + (total XP / 100) ^ 0.6
Where "start value" is the value the soldier had when he was recruited.

NOTES
- The system is not intended to force the player into action or into a specific strategy. The XP cap is there to prevent "training abuse", and the formulas are intended to allow any soldier who pulls his weight to reach the cap easily. In short, if the player plays normally, his soldiers should grow at an optimal rate. But soldiers sitting around in the dropship will not get free buffs.
- I will not get away from the XP system or the power of 0.6. I like the system, it's flexible and I think it's a good game mechanic. The power of 0.6 makes sure no veteran soldier will ever be surpassed by a newer soldier, even if the newer one had better initial stats, as long as the veteran keeps training.
- I will, however, adjust the formulas according to suggestions made in this thread, if I think it's an improvement. If I do not, no amount of arguing will convince me, so please don't keep hammering on the same idea.
- There is discussion about changing the actual set of abilities. I am aware of this, so please don't bring that into this discussion if possible. If such a change comes to pass, the relevant formulas will be added or removed.
« Last Edit: February 12, 2008, 01:57:56 pm by BTAxis »

DaNippers

  • Guest
Re: New soldier stat increase system
« Reply #1 on: February 12, 2008, 01:04:59 pm »
AWSOME! Can't wait to try it out... lol When Can We have it??? lol *Drools*

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New soldier stat increase system
« Reply #2 on: February 12, 2008, 01:11:53 pm »
It's in the current SVN trunk. It will NOT be in 2.2.1, because of networking and savegame issues. 2.3 at the earliest.

Offline Zorlen

  • Squad Leader
  • ****
  • Posts: 134
    • View Profile
Re: New soldier stat increase system
« Reply #3 on: February 12, 2008, 01:46:57 pm »
Maybe add some very small weapon XP for just shooting? Either per TUs used on firing, or per shots fired. Of course, that may lead to soldiers emptying their clips at nowhere each mission, but with XP reward for such being small and base training facilities available such activity can be made a waste of time and ammo. The good side is that soldiers that provided supressive fire or engaged enemy, but failed to score a hit, would also get some consolation prize.

Also weapon XP could be available once per each alien hit. So hitting the same alien repeatedly with the same soldier wont give you XP. Otherwise the last alien on the map would be constantly flashbanged and fired at with the weakest or least efficient weapons. Or just bombed with flashbangs until those run out, giving soldiers steady Explosive XP bonus.

Also more Mind XP could be given if an enemy is stunned and captured alive. Also kills bonus on Mind are better be limited to enemy kills only, otherwise recruits with poor stats would also be taken to missions to serve as training targets. And maybe give a small bonus for detecting an alien (one bonus per each living alien, none for successive detection of the same ones).

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New soldier stat increase system
« Reply #4 on: February 12, 2008, 01:57:34 pm »
Also weapon XP could be available once per each alien hit. So hitting the same alien repeatedly with the same soldier wont give you XP. Otherwise the last alien on the map would be constantly flashbanged and fired at with the weakest or least efficient weapons. Or just bombed with flashbangs until those run out, giving soldiers steady Explosive XP bonus.

Like I said in the notes, the system is intended so this is not necessary.

Quote
Also kills bonus on Mind are better be limited to enemy kills only

Yes, I meant every enemy kill. Fixed.


nemchenk

  • Guest
Re: New soldier stat increase system
« Reply #5 on: February 12, 2008, 02:13:23 pm »
Nothing for being shot at, or getting hit? I mean, courage under fire and all that...

Also, I'm not sure what the status of panic or mind-control functionality is yet, but it would be nice if those counted to. For example, resisting a panic attack, or successfully mind-controlling an enemy.

As a quick aside, I was thinking it may be nice for n00bs to be able to start their own training missions, perhaps with dummy or baton rounds if those were implemented. This would help total newcomers to UFO and UFO:AI learn Battlescape controls and tactics, and account for (some of?) the "training facility" skill/stat improvements.

Otherwise it looks good to me!  ;D Many thanks,

nemchenk

SpaceWombat

  • Guest
Re: New soldier stat increase system
« Reply #6 on: February 12, 2008, 06:48:01 pm »
Well, some points from my side.

As I understood it the weapon skill/accuracy system relies on different weapon categories and "performed hits" (i.e. successful effective use of the weapon).

My logic would be that the XP bonus should depend on the spread rather than on the category (a weapon with higher spread in the same category is more difficult to use effectively thus training with such a weapon would more likely improve the accuracy than with an idiot-save autoaim rifle  :D ). A sniper rifle will more likely produce a hit than a machine gun at the same distance. Snipers seem to be slightly overpowered to me (even though they have less rounds/TU).

This "a hit rewards" thing in the first step leads to a systematic in which soldiers who are already good at shooting will be rewarded with more XP than a rookie soldier but that is countered because of the logarithmic structure (am I right on that?). The logic of course would be that it is easier to get a poor shooter to an average level than an average shooter to an expert level. That is exactly how it is intended and working using these formulas, right?

Overall I think it is a logic and accurate piece of good work. I'm eager to test it.


nemchenk

  • Guest
Re: New soldier stat increase system
« Reply #7 on: February 12, 2008, 06:50:53 pm »
The logic of course would be that it is easier to get a poor shooter to an average level than an average shooter to an expert level.
I haven't the studies' references to hand, but I believe this is exactly how humans learn. It gets progressively harder to get better at something the better at it you get. If you see what I mean...  :)

Offline eleazar

  • Squad Leader
  • ****
  • Posts: 226
    • View Profile
Re: New soldier stat increase system
« Reply #8 on: February 12, 2008, 07:12:06 pm »
I think it would be sensible if certain occurrences can negate the points in certain areas.

For instance a soldier that panics would loose "mind" XP (amount depending on the length of his panic attack).
It seems reasonable that he could even lower his "mind" stat by killing civilians, or worse fellow soldiers.  This might send a soldier on a downward psychological slide, but wouldn't that really make the alien invasion feel serious?

Also being wounded could negate the "health" XP gained.  This should probably be weighted towards serious wounds.  Being slightly wounded wouldn't matter much, but coming back from a mission nearly dead could erase any "health" gains.


I think these kind of changes would tend to make the soldiers feel more like real people.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New soldier stat increase system
« Reply #9 on: February 12, 2008, 07:17:27 pm »
It seems reasonable that he could even lower his "mind" stat by killing civilians, or worse fellow soldiers.  This might send a soldier on a downward psychological slide, but wouldn't that really make the alien invasion feel serious?

No argument surely, but... How often is a soldier going to kill civilians or own troops? It may happen by accident a couple of times, of course. But how much is that on the bigger picture? Unless the penalty was excessive, it would never get noticed by the player. And I don't see much point including a mechanic that has virtually no impact.

The getting wounded part would probably work, though.

Offline tobbe

  • Rookie
  • ***
  • Posts: 89
    • View Profile
Re: New soldier stat increase system
« Reply #10 on: February 12, 2008, 07:22:45 pm »
The system really looks great. Cant wait to test it!  :)

If I understood it correctly, there is no way to implement it into the current, cause it will break the save options?! I wouldnt mind an occasional crash, just to want to use this system!!

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New soldier stat increase system
« Reply #11 on: February 12, 2008, 07:28:22 pm »
It would mean your saves from 2.2 would not work anymore in 2.2.1. That's unacceptable for a bugfix release. It also would break multiplayer compatibility, I believe.

Offline eleazar

  • Squad Leader
  • ****
  • Posts: 226
    • View Profile
Re: New soldier stat increase system
« Reply #12 on: February 12, 2008, 08:56:44 pm »
No argument surely, but... How often is a soldier going to kill civilians or own troops? It may happen by accident a couple of times, of course. But how much is that on the bigger picture? Unless the penalty was excessive, it would never get noticed by the player. And I don't see much point including a mechanic that has virtually no impact.

The getting wounded part would probably work, though.

"but... How often is a soldier going to kill civilians or own troops?"
I don't know, but i presumed it would happen more often when the psychological side of combat is more thoroughly implemented.

I've only seen it happen once... a guy tossed a grenade, it bounced back, wounded him and killed a bystander.  Then his moral dropped to 0, he went berserk and killed another bystander.  Other than that i've never seen the "moral" have any effect on the game at all.

But i presume "moral" is supposed to have an impact of gameplay, and therefor it ultimately won't be so rare for a soldier to go psycho.   And it would be weird for my grenade-thrower to come out of that mission with a "mind" stat boost simply because he killed a couple aliens earlier in the mission.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: New soldier stat increase system
« Reply #13 on: February 12, 2008, 09:04:16 pm »
But i presume "moral" is supposed to have an impact of gameplay, and therefor it ultimately won't be so rare for a soldier to go psycho.   And it would be weird for my grenade-thrower to come out of that mission with a "mind" stat boost simply because he killed a couple aliens earlier in the mission.

Actually, I also don't know exactly how morale will end up working. It's worth giving some thought to.

SpaceWombat

  • Guest
Re: New soldier stat increase system
« Reply #14 on: February 12, 2008, 09:16:49 pm »
I do not totally agree on the logic behind the hitpoint xp loss on injuries.

While you do not get much training on physical endurability during a single mission but merely by steady training between missions the contribution of psychological stability ("tough guy mentality" to tolerate pain) is more like experience with "getting over something" according to my experience. In this case injuries could rather contribute to more "health". A serious injury could permanently remove some health though - this should not depend on "xp" - as a reflection of permanent/long lasting injury in my opinion.

You often learn more from your mistakes than from your success. That would generally counter most attempts to eradiate XP by collateral damage or whatever incidents. I would suggest PHALANX guys are genrally tough and mentally stable guys and able to learn from things that messed up like every good soldier should do.