aliens

Author Topic: Experience and Promotion set as parameters in ruleset  (Read 4395 times)

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Experience and Promotion set as parameters in ruleset
« on: March 30, 2013, 03:42:42 am »
Hi,

Before asking for my request, congratulations again for your amazing job on this remake.
20 years earlier, I could not imagine such a version could be released some day...
In fact, I wonder if you are not some Xcom agents that endly decided to exit virtual life to become living beings  ;)

So, go back to my suggestion...
As I have to learn a lot, before being able to make some adaptations myself, I wonder if it would be difficult/interesting/useful (useful for me, sure !) to set needed experience points (XP) and related promotion points (PP) as parameters in RuleSet
To be more accurate, I am speaking about BattleUnit::improveStat function, and about the fact to add 7 new parameters as described below
   double v = 4;                                                 => STR_PROMOTION_PP4 = 4
   if (exp < 3) v = 1;                                           => STR_PROMOTION_PP1 = 1 ; STR_PROMOTION_XP1 = 3
   if (exp < 6) v = 2;                                           => STR_PROMOTION_PP2 = 2 ; STR_PROMOTION_XP2 = 6
   if (exp < 10) v = 3;                                         => STR_PROMOTION_PP3 = 3 ; STR_PROMOTION_XP3 = 10
   return (int)(v/2.0 + RNG::generate(0.0, v));

I am thinking about how to provide this game more RPG aspects, and this would be helpful for me to reach this goal

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #1 on: May 09, 2014, 03:59:22 pm »
Up (in case someone would be able to include this in a future release)

Offline CoolKid

  • Captain
  • ***
  • Posts: 89
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #2 on: May 09, 2014, 04:28:03 pm »
The main point i'd like to see is display exp needed for promotion also display exp gained from battlescape.

Okay idea! (+1)

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #3 on: May 09, 2014, 07:18:17 pm »
"SavedGame::handlePromotions" is where the big promotions past Squaddie happen.

OXC looks at the size of your army and assigns positions based on that. I did not look over the code too closely, but I am not sure how feasible moving this stuff to the ruleset would be. It sounds like you really want to change how promotions are done, which is entirely possible too.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #4 on: May 09, 2014, 08:45:26 pm »
You are right, I had in mind to make some changes in terms of level advancement

But in fact, just having possibility to change such settings would be a big step

This way, I would be able to slow down level advancement (e.g. set  STR_PROMOTION_XP1 = 10, STR_PROMOTION_XP1 = 20, ...), rather than let statistics raise quickly, then be forced to introduce limits (as 80 in movement and so on)

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #5 on: May 09, 2014, 09:01:26 pm »
Looking closer at the code,

There is only one Commander (oddly enough, I think as soon as you get a Colonel, he will get promoted to Commander right after);
There is one Colonel for every 23 soldiers;
There is one Captain for every 11 soldiers;
There is one Sergeant for every 5 soldiers.
They get promoted based on "score" (SavedGame::getSoldierScore(Soldier *soldier)).

So those are the places where we can move stuff to ruleset. Move the # of soldiers to ruleset, move the Commander cap to ruleset. The rest would probably have to be a source mod.

That being said, the source mod would be pretty easy to implement.

"if (filledPositions < (soldiersTotal / 23) && filledPositions2 > 0)"

could be changed to

"if (filledPositions < (soldiersTotal / 23) && filledPositions2 > 0 && highestRanked->getSoldierScore() > 9999)"

This would work like the old system, except it would also require soldiers to have a baseline amount of "score". This number can be ported to the ruleset, and be set to 0 for vanilla.

Code for the score is this, to give you an idea :

Code: [Select]
UnitStats *s = soldier->getCurrentStats();
int v1 = 2 * s->health + 2 * s->stamina + 4 * s->reactions + 4 * s->bravery;
int v2 = v1 + 3*( s->tu + 2*( s->firing ) );
int v3 = v2 + s->melee + s->throwing + s->strength;
if (s->psiSkill > 0) v3 += s->psiStrength + 2 * s->psiSkill;
return v3 + 10 * ( soldier->getMissions() + soldier->getKills() );


Offline Ted

  • Sergeant
  • **
  • Posts: 23
    • View Profile
Re: Experience and Promotion set as parameters in ruleset
« Reply #6 on: May 12, 2014, 03:36:40 am »
I am thinking about how to provide this game more RPG aspects, and this would be helpful for me to reach this goal

I think this would be pretty cool.  It would be nice when your soldier got promoted that you could pick the traits you wanted to improve to make it more like an RPG.  I don't care much for the way it is done now.  For any soldier I'm not actively fighting with I'm running him around the screen trying to improve his Stamina/MP's.  It would be nice to just select that on promotion.

Ted