aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Roujin

Pages: [1]
1
Since Aldorn asked about this being a possibility / how difficult this would be in this post, I decided to investigate that for a bit.

Turns out that it wouldn't be all that hard from a coding standpoint.
However, it is a bit more challenging to come up with what values exactly to set in the ruleset, so that we can
a) match exactly the original / current calculation of stat gains.
and
b) give modders all the freedom they need wrt. changing the behavior.

This is what I have come up with for now (feedback appreciated):
Code: [Select]
    statGain:
      primary:
        bravery:
          requirement: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
          chance: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
          chanceDivisor: 11
          valueMin: 10
          valueMax: 10
        reactions:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
        firing:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
        throwing:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
          enablesSecondary: false
        psiStrength:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
        psiSkill:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
        melee:
          requirement: [1, 3, 6, 11]
          valueMin: [0, 1, 1, 2]
          valueMax: [1, 3, 4, 6]
      secondary:
        tu:
          requirement: [1]
          valueMin: 0
          valueMax: 2
          remainderShareMin: 0
          remainderShareMax: 0.1
        stamina:
          requirement: [1]
          valueMin: 0
          valueMax: 2
          remainderShareMin: 0
          remainderShareMax: 0.1
        health:
          requirement: [1]
          valueMin: 0
          valueMax: 2
          remainderShareMin: 0
          remainderShareMax: 0.1
        strength:
          requirement: [1]
          valueMin: 0
          valueMax: 2
          remainderShareMin: 0
          remainderShareMax: 0.1

If I am not mistaken, this set of values should suffice to emulate the original xcom / current* behavior, while at the same time allowing modders all the freedom with regards to how exactly experience gain translates to stat gain. Note that it is not possible to change WHAT actions cause the experience gain in for one category; that would be a different topic altogether. Only the translation from experience (= successful actions taken) to stat gain is.

* there actually is a slight deviation in current trunk code to what ufopaedia has to say about original xcom calculation.
Code says:
Code: [Select]
return (int)(tier/2.0 + RNG::generate(0.0, tier));
... where tier can be either of 1.0, 2.0, 3.0, or 4.0. Zhis will result in the following chances:
edit - I missed some facts.. turns out the code is off even more than I thought.
Keep in mind that double->int conversion is rounding DOWN, not rounding to nearest int.

tier 1: random between 0.5 and 1.5 -> 50% for each of 0, 1
tier 2: random between 1.0 and 3.0 -> 50% for each of 1, 2
tier 3: random between 1.5 and 4.5 -> 1/6 for 1, 2/6 for 2, 2/6 for 3, 1/6 for 4
tier 4: random between 2.0 and 6.0 -> 25% for each of 2,3,4,5
(note that rounding is done after the random number generation, not to both the min and max value)

I don't know if this is deliberate or an oversight while coding.
It strikes me now that this may also be case in original xcom, just not explained so well in the wiki.
In this case I may revise the ruleset variables for primary stats a bit more...

edit: I once more thought about the code above and think now that it's most definitely a bug.
For example for tier 2 (3-5 successful actions), a random number is generated between 1.0 and 3.0. It is then converted to int (=rounded DOWN), which results in 1 in 50% of the cases and 2 in the other 50%. To be precise there is (maybe) a tiiiiiny tiny chance that the RNG hits exactly 3.0, but that's near impossible. So this code definitely needs a fix.

2
This is my first post here, so hello everyone. :)
I'm a long time fan of the xcom series and have also been involved with some other open source projects like OpenTTD and CorsixTH (thanks for the plug in your recent news post ;)).

First off congratulations on your 1.0 release.
When I got the news of this, I just had to try it out, and ended up sinking a week into the game straight up. So addicting :D
At some point in the game I started being more interested in detail mechanics like how my soldiers gain stats. So I looked that up on the wiki and then thought that it would be nice to have a statistic at the end of a mission that shows which soldier(s) earned how many stat points.

So I figured I could just implement it myself, and contribute it, if you find it a good thing to add.

I added an additional button "STATS" to the debriefing screen, you can use that to toggle between the usual scores and a list of all soldiers that have earned stats, with exactly how many they earned per stat.
Since it is a bit problematic to fit all that data on the screen, I could not use the usual stat names "HEALTH", "STRENGTH" etc., but had to introduce abbreviations HP, STR, etc.
To help clarify what each of these means I made them display a tooltip with the full name if you hover over them.


Find attached a screenshot and the patch.

(edit Dec 08, 2015: rebased to current master)


Pages: [1]