Author Topic: [Suggestion] Inventory auto-placement priorities/rules (PR attached)  (Read 5180 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8245
    • View Profile
Re: [improvement] Inventory priorities
« Reply #15 on: February 24, 2020, 06:38:27 pm »
Sorry, but I can't discuss solutions, workarounds, improvements and suggestions for something I don't believe is even possible.

As I said, everyone has different expectations, and I don't see why I would add a feature to cover specifically your expectation, no offense intended.

I can be wrong, but that's how I see it.

Offline Derived

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: [improvement] Inventory priorities
« Reply #16 on: February 24, 2020, 08:35:35 pm »
I don't think a fixed priority order approach will work well.  I for one in x-piratez, tend to pick my primary weapon as one of the last items equipped.

Only solution I can think of is that the first equipped weapon is primary, as there always won't be a secondary. Do note that right hand is only ever prioritized for quick-equip of a weapon. Other items are not placed there.

Instead of trying a one size fits all approach, what about a more adaptive method that looks at how the player has previously equipped soldiers and the saved templates (s)he created.
Building an intelligent quick-equip / autoequip would be a larger huge task.
- It would try to learn based on your corrections, saved templates, previous loadouts, available equipment, armor and soldier attributes. That is a lot of variables.
- It would require some kind of AI/neural network.
- AIs always need very large data-sets and learn very slowly. Especially when there are lots of variables. Your play-style will probably evolve faster than any possible AI can learn, resulting in a feature even more useless than the current auto-equip.

I had an idea based on this, though.
- From previous loadouts, use the best matching for auto-equip. This "best match" cost function being somehow weighted with all relevant variables and limitations.
Problems with even this:
- Would be pretty hit-and-miss, even if your playstyle has clearly defined soldier roles.
- Preserving all previous at-combat-start-loadouts would be quite a bit of a size increase to the savefile.
- Defining a useful cost function would be very hard.

Auto-equip is hard. I think the only solution would be to hard code better logic than the current one. But as that wouldn't be vanilla and very subjective, it might not be something that Meridian would be prepared to merge.

As I said, everyone has different expectations, and I don't see why I would add a feature to cover specifically your expectation, no offense intended.

None taken. Vanilla quick-equip works according to your expectations?

I'm using this in my own custom build, but won't start releasing builds. I'm sharing changes here for the potential benefit to others.
« Last Edit: February 24, 2020, 10:28:04 pm by Derived »

Offline Rubber Cannonball

  • Colonel
  • ****
  • Posts: 195
    • View Profile
    • Email
Re: [improvement] Inventory priorities
« Reply #17 on: February 24, 2020, 09:25:59 pm »
Only solution I can think of is that the first equipped weapon is primary, as there always won't be a secondary. Do note that right hand is only ever prioritized for quick-equip of a weapon. Other items are not placed there.
Building an intelligent quick-equip / autoequip would be a larger huge task.
- It would try to learn based on your corrections, saved templates, previous loadouts, available equipment, armor and soldier attributes. That is a lot of variables.
- It would require some kind of AI/neural network.
- AIs always need very large data-sets and learn very slowly. Especially when there are lots of variables. Your play-style will probably evolve faster than any possible AI can learn, resulting in a feature even more useless than the current auto-equip.

I had an idea based on this, though.
- From previous loadouts, use the best matching for auto-equip. This "best match" cost function being somehow weighted with all relevant variables and limitations.
Problems with even this:
- Would be pretty hit-and-miss, even if your playstyle has clearly defined soldier roles.
- Preserving all previous at-combat-start-loadouts would be quite a bit of a size increase to the savefile.
- Defining a useful cost function would be very hard.

Auto-equip is hard. I think the only solution would be to hard code better logic than the current one. But as that wouldn't be vanilla and very subjective, it might not be something that Meridian would be prepared to merge.

None taken. Vanilla quick-equip works according to your expectations?

I'm using this in my own custom build, but won't be releasing builds. I'm sharing here for the benefit of others.

I wouldn't expect an intelligent ai approach.  Merely more adaptive.  Also I wouldn't save all previous loadouts, just look at the ones currently saved.  I think every soldier the player has ever equipped has its last loadout saved.  By not saving earlier loadouts, the algorithm would actually adapt faster as the player progresses.  For instance if the saved loadouts have the vanilla stun rod (weapon) most often in the back pack then I would expect ctrl left click to stick it in the backpack even if it is the first item picked.  On mods that have pages and pages of items, I tend to pick items in the order I come across them.  If the motion scanner happens to appear in the right hand most often in the saved loadouts then the right hand should be the first slot tried when ctrl left clicking the scanner.


Actually I think I have a simpler, better idea:  Why not just have the mouse wheel scroll the ctrl-left clicked item through the available slots that it fits.
Edit:
Except for the hands, slots that are larger than the item should be last in the scroll order.
« Last Edit: February 24, 2020, 09:36:19 pm by Rubber Cannonball »

Offline Derived

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: [improvement] Inventory priorities
« Reply #18 on: February 24, 2020, 10:22:12 pm »
If the motion scanner happens to appear in the right hand most often in the saved loadouts then the right hand should be the first slot tried when ctrl left clicking the scanner.

Good idea, tally up slots the item is placed in from existing loadouts. Prioritize slot selection based on that frequency. Giving highest priority to loadouts of units with same armor as the one currently being equipped.

This may even be partially adapted for auto-equip. At least it gives your preferences for where what kind of items should be equipped. Haven't looked into how auto-equip logic works, or even used it more than once, so I may be completely in the wrong.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8245
    • View Profile
Re: [improvement] Inventory priorities
« Reply #19 on: February 24, 2020, 10:57:30 pm »
Vanilla quick-equip works according to your expectations?

No, absolutely not.
I have auto-equip option turned off; and I use quick-equip (ctrl+click) pretty much only for dropping stuff on the ground, never for equipping stuff (maybe with a small exception every now and then for the main hand weapon).

To streamline equipment process, I have implemented the save/load equipment templates feature, which is what I use today.

Offline R1dO

  • Colonel
  • ****
  • Posts: 427
    • View Profile
    • Email
Re: [improvement] Inventory priorities
« Reply #20 on: February 25, 2020, 01:02:51 am »
...
To streamline equipment process, I have implemented the save/load equipment templates feature, which is what I use today.

Which is probably the sane approach.

Trying to implement an AI (or supervised classification [1]) algorithm that takes into account the user preferences will require a lot of user input per modpack (since items tend to vary a lot between modpacks).

Most likely the computer will only converge to the users preferences (if at all) at the end of a playthrough.
And then you also have to take into account the following points:
* Amount of data that needs to be saved (e.g. what did the computer propose and what did the user override it with, per unique set of inputs).
* Research process (e.g. what was perfect for a certain stage will not be perfect for a later stage).

[1]
When first reading this topic this is what came to mind as a possible solution. I dismissed it as non-practical since the amount of possible solutions  could easily grow out of bounds.

-- edit --
Removed a statement which was based on a wrong assumption.
« Last Edit: February 25, 2020, 11:11:12 am by R1dO »