OpenXcom Forum

Contributions => Programming => Topic started by: Roujin on June 28, 2014, 02:29:17 am

Title: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Roujin on June 28, 2014, 02:29:17 am
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)

Title: Re: Showing Soldier stat increases after mission
Post by: Solarius Scorch on June 28, 2014, 02:33:08 am
It's a very nice idea. It works a bit similar in Xenonauts, and why not here?
Title: Re: Showing Soldier stat increases after mission
Post by: Aldorn on June 28, 2014, 05:53:05 am
This would be a useful contribution  :)

What about the possibility to mod the stats improvement ? Could you have a look at it just to have an idea if it would be a lot of work ?

By "modding stats improvement", I mean be able to set the thresholds and resulting values
00-04 XP => +1 Stat
04-12 XP => +2 Stat
12-20 XP => +3 Stat
...
Title: Re: Showing Soldier stat increases after mission
Post by: Roujin on June 28, 2014, 02:49:21 pm
Well, I did see the part of the code where the stat gains are calculated. To change that in code would be easy.
You are referring to linking this with the rulesets though, right? Being able to set some thresholds in a ruleset, that are then used in the stat gain calculation.
I don't have any idea about how these rulesets work yet, so I cannot estimate how easy or hard this is to do. ;)

Title: Re: Showing Soldier stat increases after mission
Post by: Aldorn on June 28, 2014, 02:53:50 pm
Well, I did see the part of the code where the stat gains are calculated. To change that in code would be easy.
Good news

You are referring to linking this with the rulesets though, right? Being able to set some thresholds in a ruleset, that are then used in the stat gain calculation.
Right ! In fact to be able to slow progression / make advancement more rare and precious...

I don't have any idea about how these rulesets work yet, so I cannot estimate how easy or hard this is to do. ;)
I just wanted to have an idea, thanks mate
Title: Re: Showing Soldier stat increases after mission
Post by: Roujin on June 28, 2014, 05:00:31 pm
I have now investigated that topic for a bit and I would say that it would not be very difficult, code-wise (also the part about exposing it to the ruleset).

The more challenging feat would be coming up with a set of values to be set in the ruleset that can
a) match exactly the original / current calculation of stat gains.
and
b) give modders all the freedom they need wrt. changing the behavior.

I have come up with something there, but I will open a new topic for that, since it does not really belong into this one. ;)
edit: here is the thread: https://openxcom.org/forum/index.php?topic=2474.0
Title: Re: Showing Soldier stat increases after mission [patch inside]
Post by: arrakis69ct on July 09, 2014, 02:39:54 pm
How i install this???
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Roujin on December 08, 2015, 05:23:52 pm
Long time no see :)

I noticed the news post about "Soldier Diaries" being adopted into master a few days ago, and figured I would rebase my patch here to current master and see if there is any interest in it.
Unfortunately because I'm a git noob I didn't manage to preserve the patch queue and have only a single patch now. (updated in first post)

Here's a new screenshot from a TFTD game :)
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on December 08, 2015, 05:29:09 pm
+10

This would be really cool to have... now I have to painfully look it up, or even use spreadsheets to track.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Arthanor on December 08, 2015, 06:16:52 pm
Cool stuff! Hopefully it is easy to apply to OXCE as well, then I can track which gals are slacking! ;)
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: niculinux on December 08, 2015, 09:12:07 pm
Cool stuff! Hopefully it is easy to apply to OXCE as well, then I can track which gals are slacking! ;)

Agree! ::)
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Shoes on December 08, 2015, 09:52:57 pm
Long time no see :)

I noticed the news post about "Soldier Diaries" being adopted into master a few days ago, and figured I would rebase my patch here to current master and see if there is any interest in it.
Unfortunately because I'm a git noob I didn't manage to preserve the patch queue and have only a single patch now. (updated in first post)

Here's a new screenshot from a TFTD game :)

Are you familiar with git? You should put your changes up there so that others can use it.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: kkmic on December 09, 2015, 11:54:22 am
Why not simply show only the improved stats?

Something like

Code: [Select]
Ctibor Cernic 2TU 4STA 4HP
Exekiel Eke 1TU 5STA 1HP 3ACC 

I agree that the table format you use lets you quickly see which soldiers improved in one particular field, but it's taking too much screenspace. Can you at least dump the dots?
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: hellrazor on December 09, 2015, 12:37:01 pm
Totally +100!

We already have Soldier Diaries in so why not also put Infoscreens into the Soldier Diaries, to see Statincreases for the Soldier in the Mission that occured.
And maybe a overview for Missions, to see this infofield, not only after battle but also in the diary screen.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Roujin on December 10, 2015, 02:11:39 am
Are you familiar with git? You should put your changes up there so that others can use it.
You mean GitHub? No, haven't used it yet.
Obviously I used git (TortoiseGit to be specific) to clone the code base and make the patch.

Others can already use it though, if they want - just have to download and apply the the patch, right? :)

Why not simply show only the improved stats?
[...]

Hmm, showing only the improved stats is an idea I didn't think about.
I guess it would look a bit unorganized though.
Also a lot of repetition of the stat names (TU, STA, ...) and if one soldier gains stats in all or most categories, it definitely won't fit in the line.

[...]
Can you at least dump the dots?

I had tried several combinations before I decided for this one: with/without dots, yellow or green, zero or dash for unchanged stats.
Just removing the dots looks too empty imo (screenshot 08).
Removing the dots but adding dash for unchanged stats was a close contender though (screenshot 07). Do you think that one is better than the dots?
(note: old screenshots with wrong stat order)


We already have Soldier Diaries in so why not also put Infoscreens into the Soldier Diaries, to see Statincreases for the Soldier in the Mission that occured.
And maybe a overview for Missions, to see this infofield, not only after battle but also in the diary screen.

Sure, that would be a nice addition. :)
Maybe I'll add it some time.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Arthanor on December 10, 2015, 03:33:01 am
hum.. I have to say that I like both more than with the dots. Not 100% sure about which I like more though. The one with just empty spaces looks nicer now, but it might be confusing to read once you get 26 soldiers on an avenger, some of which might not improve in many things. Or just sparse. The one with the dashes is probably the best compromise.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on December 17, 2015, 06:15:11 pm
I've added this to OpenXcom Extended 2.5b.
If anyone is interested, here's the download: https://openxcom.org/forum/index.php/topic,3972.msg56294.html#msg56294
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Arthanor on December 17, 2015, 07:08:10 pm
hum.. I thought the provided patch was for a version of OpenXCom that is more recent than the one used in OXCE.. Was it a lot of work to make it "backward compatible"?
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on December 17, 2015, 07:44:52 pm
It didnt merge automatically, so i just copied everything manually. Didnt find any conflicts. Took about 20 minutes.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Arthanor on December 17, 2015, 09:07:51 pm
Interesting.. I thought it'd be a pain. Glad to know it wasn't! Some stuff to do over christmas break :D
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on January 05, 2016, 10:42:16 am
@Roujin: it crashes, when there are also non-soldiers on the mission (for example tanks).

Need to add one more if...

if ((*j)->getGeoscapeSoldier())
{
  https:// push back stat improvements only for soldiers
  ...
}
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Countdown on January 21, 2016, 04:35:13 am
+1 for the version with dashes instead of dots. Much more pleasing to the eye.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Phoenix7786 on January 24, 2016, 12:28:44 am
Is this thing working with current nightlies?
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on January 24, 2016, 12:35:52 am
Is this thing working with current nightlies?

No, you need to build your own version.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Phoenix7786 on January 24, 2016, 04:07:12 am
Guess I'll have to walk up to a random programmer, use a stun-rod a couple of times and then politely ask them to give me a hand.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: SupSuper on March 12, 2017, 01:46:12 am
It took three long years but this is finally in the nightlies. Let it be known I am not forgetful, just slow. :P
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Meridian on March 12, 2017, 02:19:21 am
Lol, congratulations.

I have to say I didn't expect that... what a nice surprise.
Title: Re: Showing Soldier stat increases after mission [patch - updated 08-12-2015]
Post by: Countdown on March 12, 2017, 03:33:35 am
This is awesome, was excited to see this update. Can't wait to try it out.