OpenXcom Forum

OpenXcom => Suggestions => Topic started by: myk002 on May 19, 2015, 03:48:41 am

Title: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 19, 2015, 03:48:41 am
I felt so sorry for Meridian when I saw him manually organizing upwards of 70 soldiers on the Craft -> Soldiers page that I wrote this.

It adds a combo box to the bottom of the screen that allows you to sort the soldiers by any attribute.  Choose "Original order" to restore the order they were in when you entered the screen.

The order of the attributes to sort by is the same as in the soldier info page, but I think some items are more useful than others to sort by.  What do you think?  Which items should go at the top?

Code is up at: https://github.com/myk002/OpenXcom/tree/sort_soldiers   I'll wait for a bit for feedback before I submit the pull request.

Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 19, 2015, 12:33:52 pm
I personally sort my soldier after:
For Rookie Screening:

1. Psi Strength (obviously very important)
2. Reactions (everyone with reaction lower then 56-60 gets sacked automatically)
3. Firing Accuracy (everyone with accuracy lower then 52-70 get sacked automatically)

Thats mostly all i care about.
4. Strenght is also important for Rookies (so you know who can carry heavy weapons from the start).

5. TU's (High TU+High Reactions = high chance to reactionfire and survive, or not get shot when trying to kill a enemy in LOS).

The others are marginal.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: pilot00 on May 19, 2015, 02:32:53 pm
The only soldiers I sack automatically are those with bravery <40. The rest can be trained if they survive long enough and psi str you dont know till in the late game so....

Thats a good mod Op.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 19, 2015, 02:41:33 pm
The only soldiers I sack automatically are those with bravery <40. The rest can be trained if they survive long enough and psi str you dont know till in the late game so....

Thats a good mod Op.

Bravery only has 2 cases when it matters:

1. You are unfortunate enough and let your Soldiers die, because of Enemy fire.
2. Your Soldier get paniced by Aliens Psionics (you can build up there morale, when you kill enemies with others or if not paniced with them, 1 kill really boost them up from 20 morale to 80 or 90)
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 20, 2015, 02:04:52 am
For the record, I find myself sorting most often by:
firing accuracy
time units
reactions
psi strength
psi skill
rank
strength
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: pilot00 on May 20, 2015, 02:41:43 am
Bravery only has 2 cases when it matters:

1. You are unfortunate enough and let your Soldiers die, because of Enemy fire.
2. Your Soldier get paniced by Aliens Psionics (you can build up there morale, when you kill enemies with others or if not paniced with them, 1 kill really boost them up from 20 morale to 80 or 90)

Which are both liable to happen, leading to a squad of ten+ soldiers chain panicking and its "abort mission" from then on.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 20, 2015, 09:09:01 am
@myk002: I think it is OK as it is.

For the record, I sort mostly by:
1. Strength (heavy soldiers for terror missions)
2. Psionic strength (psi resistant guys for sectoid/ethereal missions)

Now when this is available I will maybe also start sorting by TUs and reactions a little bit.

For LP purposes it would be cool, if I could sort by number of missions... but including all clones, not only last incarnation ;-) But I guess that's too much to ask.

2. Reactions (everyone with reaction lower then 56-60 gets sacked automatically)
3. Firing Accuracy (everyone with accuracy lower then 52-70 get sacked automatically)

Chance to get 56-60 reactions is 16% (5 in 31) and chance for 52-70 firing accuracy is 55% (17 in 31). Together, the chance to get your soldier is less than 9% (roughly 1 in 11)... are you telling us that from each 11 hired soldiers you fire 10???
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 20, 2015, 09:32:49 am
ok, submitted as https://github.com/SupSuper/OpenXcom/pull/1025
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 20, 2015, 11:00:37 am
Chance to get 56-60 reactions is 16% (5 in 31) and chance for 52-70 firing accuracy is 55% (17 in 31). Together, the chance to get your soldier is less than 9% (roughly 1 in 11)... are you telling us that from each 11 hired soldiers you fire 10???

Well basically yes. Sometimes it is 3 out of 10 anothertime 1 out of 50.
If i am short an manpower i also accept dudes with Reactions 45+ if their accuracy is 65+ (reactions will be trained with pistols).
My average recruiting cost is around ~380.000 for one soldier. But i like to have reliable shooters/scouts.
This also makes playing on Superhuman Difficulty or higher effectivly possible for me.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: redv on May 20, 2015, 03:57:09 pm
For example, I prefer following template:
- first two place for rookies.
- next places for experienced soldiers.
- last positions for psionics.

I think, each player uses his own tactic. For this tactic need his own template.
This is not just a sorting by strength or reaction etc.

Therefore this addition is useless.

I suggest use another algorithm:
1. collect an statistics about the pattern of soldiers stats (place vs strength, experience, reaction, psi skill, etc)
2. each time when player pressed OK, the statistics will be updated with weight 10% (maybe other; need tests).
3. instead "sort by" use "auto-arrange". Which allows arrange available soldiers by pattern based on the collected statistic.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 20, 2015, 05:21:28 pm
For example, I prefer following template:
- first two place for rookies.
- next places for experienced soldiers.
- last positions for psionics.

I think, each player uses his own tactic. For this tactic need his own template.
This is not just a sorting by strength or reaction etc.

Therefore this addition is useless.

I use EXACTLY the same high-level template as you described above.

That however doesn't mean that the added functionality is useless. On the contrary, "experienced soldiers" for example is a very broad term... and sometimes I need "strong experienced soldiers", sometimes "accurate experienced soldiers" and sometimes "psi resistant experienced soldiers". And for that I use the added sorting functionality.

Edit: this would be a step-by-step example:
1. deselect everyone
2. sort by rank
3. select 2 rookies you like
4. sort by psi strength
5. select 2 psi guys you like
6. sort by strength
7. select 5 strong guys you like
8. sort by accuracy
9. select 5 accurate guys you like... now you have 14 soldiers selected
10. (optional step) select original order
11. use right-click to move two rookies on the top
12. use right-click to move two psi soldiers on the bottom
13. experienced soldiers are already on correct positions... done
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 20, 2015, 05:29:24 pm
I use EXACTLY the same high-level template as you described above.

That however doesn't mean that the added functionality is useless. On the contrary, "experienced soldiers" for example is a very broad term... and sometimes I need "strong experienced soldiers", sometimes "accurate experienced soldiers" and sometimes "psi resistant experienced soldiers". And for that I use the added sorting functionality.

Well i use my own Customized Statstring, and as soon as the soldiers names do have "SMR" behind them those dudes are experienced :). Psionics would be "pkSMR" or "PKSMR".

My setup is somewhat similar:
Early Game:
- Tank
- the two less experienced Soldiers
- 2 Rocketers
- 4 Normal Dudes
- 2 Snipers

Late Game: with #Avenger
- 3 Tanks (mostly 2 Plasma /laser ones and one Rocket tank)
- 6 normal dudes
- 3 Snipers
- 2 Blaster Launchers
- 3 Psi

Fits well together :)
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 20, 2015, 05:37:27 pm
1. deselect everyone
2. sort by rank
3. select 2 rookies you like
4. sort by psi strength
5. select 2 psi guys you like
6. sort by strength
7. select 5 strong guys you like
8. sort by accuracy
9. select 5 accurate guys you like... now you have 14 soldiers selected
10. (optional step) select original order
11. use right-click to move two rookies on the top
12. use right-click to move two psi soldiers on the bottom
13. experienced soldiers are already on correct positions... done
Yeah, this is exactly the kind of workflow I had in mind.  I also tend to sort by TUs so the low TU people can get more experience.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 20, 2015, 05:39:04 pm
Yeah, this is exactly the kind of workflow I had in mind.  I also tend to sort by TUs so the low TU people can get more experience.

hm.. maybe i should give this a try but i usually set up my team manually, and split them from time to time to mix in new Rookies.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 20, 2015, 05:40:33 pm
Well i use my own Customized Statstring, and as soon as the soldiers names do have "SMR" behind them those dudes are experienced :). Psionics would be "pkSMR" or "PKSMR".

You don't need to sort at all ;-)
From what I've seen and read all your soldiers are supermen and wonderwomen anyway.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: hellrazor on May 20, 2015, 06:18:57 pm
You don't need to sort at all ;-)
From what I've seen and read all your soldiers are supermen and wonderwomen anyway.

Well there are enough deaths on the way. But having higher starting stats makes them as you called supermen & wonderwomen like :D
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: redv on May 20, 2015, 06:28:36 pm
Edit: this would be a step-by-step example:
1. deselect everyone
2. sort by rank
3. select 2 rookies you like
4. sort by psi strength
5. select 2 psi guys you like
6. sort by strength
7. select 5 strong guys you like
8. sort by accuracy
9. select 5 accurate guys you like... now you have 14 soldiers selected
10. (optional step) select original order
11. use right-click to move two rookies on the top
12. use right-click to move two psi soldiers on the bottom
13. experienced soldiers are already on correct positions... done
Yeah, this is exactly the kind of workflow I had in mind.  I also tend to sort by TUs so the low TU people can get more experience.

Perfect example! :-))

I suggested another way:
1. select several soldiers.
2. press the "auto-arrange" button. Done. ;-)

The "arrange" as I described before.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 20, 2015, 07:19:52 pm
@redv: sounds cool, but it's far beyond this PR.  If implemented, it could be added as one of the options in the combobox, though.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 20, 2015, 07:56:39 pm
Yes, sounds cool, but it has two problems... to which I don't see any solution.

First problem is step 1 ("select several soldiers").
I have a lot of soldiers and without the sorting functionality, it is difficult for me to decide which ones to select in the first place. It takes ages to manually go through all of them and decide who to take... remember this was meant to help you pick your crew... not to just reorder an existing pre-selected crew.

Second problem is step 2 ("auto arrange").
I work in IT for many years now... and I have never seen any non-trivial algorithm "intelligent enough" to replace my own decisions.... even if this was implemented, in 99.9995% of cases, I would have to make manual changes... which makes it useless.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 20, 2015, 09:31:52 pm
I think I found one small bug/glitch:
If I do some manual changes first... then open the combobox... but don't select anything (i.e. want to close it without applying any sorting), it will still apply the "ORIGINAL ORDER" even though I never clicked on it and the text in the combobox still says "SORT BY..."
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: myk002 on May 20, 2015, 10:52:37 pm
thanks for finding this!  fixed.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: redv on May 21, 2015, 03:01:24 am
Yes, sounds cool, but it has two problems... to which I don't see any solution.

First problem is step 1 ("select several soldiers").
I have a lot of soldiers and without the sorting functionality, it is difficult for me to decide which ones to select in the first place. It takes ages to manually go through all of them and decide who to take... remember this was meant to help you pick your crew... not to just reorder an existing pre-selected crew.

Second problem is step 2 ("auto arrange").
I work in IT for many years now... and I have never seen any non-trivial algorithm "intelligent enough" to replace my own decisions.... even if this was implemented, in 99.9995% of cases, I would have to make manual changes... which makes it useless.

In my games never been more than 20 soldiers per one base.
Therefore most of them I know after several missions.
But if it's a problem, you can use XcomUtil_Statstrings.rul for picking a good crew.

"Sort by" is not intended for picks a crew by design. "Sort by" designed only for reorder.
Therefore you need 12-13 steps and many-many clicks (each time) to get a crew of dream :)
Even if in most cases you need only add 1-2 soldiers instead wounded or dead ones.
Perhaps, manual reorder will be faster. Therefore I think this option is useless.

Described above algorithm not designed for replace your decisions. The algorithm just repeats your decisions. Therefore the statistical model should be trained before use.
This is some kind of expert system, but very simple. I not expect 100% accuracy, but 80-90% will be fine.
The idea is simple:
1. collect stats data of your soldiers and positions which you choose for soldiers. It's easy.
2. when you press "auto-arrange" will be reproduced your decisions: fit the soldiers stats to match to the collected stats data. If you think about it a little, the algorithm will be obvious.
Title: Re: "Sort by" combobox on Craft Soldiers page
Post by: Meridian on May 21, 2015, 09:36:25 am
OK, I respect your opinion, and respectfully disagree with you.

I find it very useful and vote for it to be merged into vanilla.

PS: I have 74 soldiers in my base; I am using this only to pick my new crew... I have a different crew for every mission... and this feature is saving me more than 70% of the time I had to spend before. I am not using this feature for reorder, I do the reorder manually after I am done picking the crew.