OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Derived on February 10, 2020, 12:37:43 am
-
Problems with current mechanics of quick equip (CTRL-clicking items in inventory):
- when belt is full, items are placed in backpack
- pistols are placed in backpack even if they would fit to the belt
- high explosives rapidly block pistol slots from belt
- items are not prioritized to the slot where in-combat use (moving it to hand) is fastest.
Thus here is a change for:
priority order:
* place item into hand slot using previous rules
* shoulder slots (3 TimeUnits)
* leg slots if 2 wide item (e.g. high explive) (4TU)
* belt (4TU)
* leg slots (4TU)
* backpack (8TU)
* where-ever it fits (custom mods may have other slots, so just iterate all of them)
Some mods may cause this to be suboptimal, though.
Edit 2020-02-12: attached patches updated.
Edit 2020-02-22: small tweaks, patches updated
Edit 2020-02-24: clarified that this patch doesn't change how quick-equip works if current code placed item into a hand slot
-
Right what i ever missed. Thank you.
-
Things I still may want to do before submitting for merging:
- Test using also other mods than Final mod pack.
- Handle optimal item placement better when there are modded custom slots.
- Optimize ammo placement reload, other items for grabbing to other hand
I guess the absence of a "No" post from Meridian is a good sign :)
-
I guess the absence of a "No" post from Meridian is a good sign :)
I didn't answer, because there is no question anywhere.
(also, absence of feedback is usually a bad sign)
As for the feature, this is an unsolvable problem... actually, I think it doesn't even qualify as a problem, because you can't clearly define the requirement.
So, from my side a clear no.
There is no such thing as "optimal placement", every person has completely different preferences, just check a few LPers.
Even the same person has different preferences in different situations.
Or even same situation, just wearing different armor.
Or playing a different mod.
Or or or...
Not to mention vanilla purists coming at you with pitchforks and torches.
-
Others have expressed some interest and I have a working proof-of-concept, so let's see if this is salvageable?
I've outlined some problems with current placement priorities in the first post. What I'm looking for is a smoother playing experience for most play-styles (including yours). Yes, "optimal placement" is impossible, so let's just call it better placement.
For trying to come up with a cohesive requirement for can I assume:
- Items are equipped to be used?
- Lower TU cost to using an item is better?
- Current heuristic for when to place the item in a hand slot is good?
Quick-equip is not a vanilla feature, right? So changes shouldn't be a problem from a purist point of view?
-
For trying to come up with a cohesive requirement for can I assume:
- Items are equipped to be used?
Not always, there are passive items, which you just need to have in the inventory to work.
- Lower TU cost to using an item is better?
Yes, but you use more than just one item... which one gets priority for the "best" slot?
- Current heuristic for when to place the item in a hand slot is good?
As many opinions on this as there are people on Earth.
I just saw Quickmind complaining about it (twice) on yesterday's stream.
Quick-equip is not a vanilla feature, right? So changes shouldn't be a problem from a purist point of view?
Nope, it's vanilla.
You can also try to PR vanilla, if you convince them, it would be automatically merged into OXCE...
-
Indeed various people have different priorities. Still, I think a good common ground would be one simple rule: don't put into backpack any stuff which fits on the belt, unless there is no space.
-
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. I suspect this would better reduce the amount of rearranging the player would have to do in a game. And it would adjust itself to the mod, the player's style, and new items as the player progresses through a game. IIRC, every soldier's last loadout is saved as well as the player saved loadout templates.
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. I'll start with the previous loadout for the soldier or load a template, strip it down to what will be mostly common and copy/paste to other soldiers. Then I'll go back through and finish them up. I find the autoequip that occurs if i leave a soldiers inventory empty to be completely worthless in x-piratez. In vanilla, I could probably just get by with the templates.
-
Not always, there are passive items, which you just need to have in the inventory to work.
Default such items to backpack / slowest to access slot. But maybe such a corner case it won't be a problem? Also see next assumption.
Yes, but you use more than just one item... which one gets priority for the "best" slot?
Assume player start equipping with items intended for best slots.
As many opinions on this as there are people on Earth.
I just saw Quickmind complaining about it (twice) on yesterday's stream.
Any improvement suggestions that could be added as well?
Nope, it's vanilla.
How about binding to ALT-click, leaving the vanilla CTRL-click as is?
-
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.
-
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.
-
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.
-
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.
-
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.
-
...
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.
-
Description of the current OXC algorithm for CTRL+click an item on the ground:
1. (A1) - first try a slot depending on the battle type of the item
2. (A2) - if not possible to place the item, try every other slot in alphabetical order
Details on A1:
- place firearms (battle type = 1) into right hand
- place mind probes, psiamps, melee and corpses (battle types = 8, 9, 3, 11) into left hand
- place everything else into the back pack if vertical size > 2, otherwise place into the belt
Details on A2:
- place into the first available slot in the following (alphabetical) order:
STR_BACK_PACK, STR_BELT, STR_LEFT_HAND, STR_LEFT_LEG, STR_LEFT_SHOULDER, STR_RIGHT_HAND, STR_RIGHT_LEG, STR_RIGHT_SHOULDER
--
Description of the current OXC algorithm for auto-equip:
a/ happens when player inventory is opened and option is not disabled
b/ happens when you press the Z hotkey (option disabled or enabled doesn't matter)
c/ happens when aliens (and civilians) are equipped before mission
1. (C1) - place firearms and melee into right/left hand, don't try any where else
2. (C2) - place psiamp into left hand for aliens, don't try anywhere else
3. (C3) - place everything else into free slots based on listOrder
Details on C1:
- firearms and melee (battle type = 1, 3) are equipped into the right hand
- a second firearm and melee (battle type = 1, 3) are equipped into the left hand for aliens and civilians (in OXCE also for player units with a corresponding armor attribute enabled)
Details on C2:
- a psiamp (battle type = 9) is equipped into the right or left hand for aliens only
Details on C3:
- every other item (which is not firearm or melee) is equipped into a free slot based on listOrder of inventory slots (i.e. NOT alphabetically!)
- default listOrder in OXC/OXCE is:
STR_RIGHT_HAND, STR_LEFT_HAND, STR_BELT, STR_RIGHT_LEG, STR_LEFT_LEG, STR_RIGHT_SHOULDER, STR_LEFT_SHOULDER, STR_BACK_PACK
- listOrder can be overridden by modders (already for a long time)
-
New features in OXCE (since v7.11.8 ):
CTRL+click extended to:
1. (B1) - first try the default slot per item
2. (B2) - second try slot based on the item category, in the order defined by the modder
3. (A1) - third try a slot depending on the battle type of the item
4. (B3) or (A2) - fourth every other slot in alphabetical order (A2) or listOrder (B3) -- modder can globally choose between (B3) and (A2)
Auto-equip extended to:
1. (C1) - place firearms and melee into right/left hand, don't try anywhere else
2. (C2) - place psiamp into left hand for aliens, don't try anywhere else
for everything else:
3. (D1) - (standard player units only!) try the default slot per item
4. (D2) - (standard player units only!) then try slot based on the item category, in the order defined by the modder -- the first item category that actually contains any inventory order will be used
5. (C3) - lastly try all free slots based on listOrder
-
Examples of all new attributes and options can be found in the new standard mods for UFO and TFTD called "Smarter Equip", which are distributed together with OXCE.
Disclaimer:
These two mods are based on my personal preferences.
I am aware that other people have other preferences.
Feel free to tinker with the mods to adjust them to your needs.
Disclaimer 2:
The mods work with vanilla UFO and vanilla TFTD items... any other items added in mods and megamods may need to be updated by the respective modders.
(even though rule (B3) will already do quite a good job even for uncategorized items)
(mods changing inventory slots should probably redefine also (B3) ruleset)
If you're really crazy, you can define a different custom equip order for every single item in the game, but I'd recommend grouping similar items into categories to preserve sanity.
If you don't want any/some/all categories to be visible in the game, you can mark them as hidden.
--
UFO version copypasted below (for forum keyword search purposes):
# 1. Use inventory slots defined by individual items
items:
- type: STR_HIGH_EXPLOSIVE
defaultInventorySlot: STR_RIGHT_LEG
- type: STR_MOTION_SCANNER
defaultInventorySlot: STR_BELT
- type: STR_MEDI_KIT
defaultInventorySlot: STR_BELT
- type: STR_BLASTER_BOMB
defaultInventorySlot: STR_LEFT_HAND
# 2. Use inventory slots defined by item categories
displayCustomCategories: 1
itemCategories:
- type: OXCE_CRAFT_WEAPONS
- type: OXCE_HWPS
- type: OXCE_MAIN_WEAPONS
invOrder: [STR_RIGHT_HAND, STR_LEFT_HAND, STR_BACK_PACK]
- type: OXCE_SIDE_WEAPONS
invOrder: [STR_LEFT_HAND, STR_BELT, STR_BACK_PACK, STR_RIGHT_HAND]
- type: OXCE_AMMO
invOrder: [STR_BELT, STR_LEFT_LEG, STR_RIGHT_LEG]
- type: OXCE_GRENADES
invOrder: [STR_RIGHT_SHOULDER, STR_LEFT_SHOULDER, STR_BELT, STR_LEFT_LEG, STR_RIGHT_LEG, STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
- type: OXCE_ARMORS_AND_CORPSES
invOrder: [STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
- type: OXCE_PRISONERS
invOrder: [STR_LEFT_HAND, STR_RIGHT_HAND, STR_BACK_PACK]
- type: OXCE_COMPONENTS
invOrder: [STR_LEFT_HAND, STR_BELT, STR_BACK_PACK]
# 3. Use inventory slots ordered by listOrder (instead of alphabetical order)
constants:
extendedInventorySlotSorting: true
invs:
- id: STR_RIGHT_SHOULDER
listOrder: 10
- id: STR_LEFT_SHOULDER
listOrder: 20
- id: STR_BELT
listOrder: 30
- id: STR_LEFT_LEG
listOrder: 40
- id: STR_RIGHT_LEG
listOrder: 50
- id: STR_BACK_PACK
listOrder: 60
# let's keep the hands low (or at least after the backpack, so that aliens don't auto-equip things like mind probes in hands)
- id: STR_RIGHT_HAND
listOrder: 70
- id: STR_LEFT_HAND
listOrder: 80
- id: STR_GROUND
listOrder: 90
And a few examples of the item categorization (file shortened):
items:
- type: STR_PISTOL
categories: [OXCE_SIDE_WEAPONS]
- type: STR_PISTOL_CLIP
categories: [OXCE_AMMO, OXCE_SIDE_WEAPONS]
- type: STR_RIFLE
categories: [OXCE_MAIN_WEAPONS]
- type: STR_RIFLE_CLIP
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_HEAVY_CANNON
categories: [OXCE_MAIN_WEAPONS]
- type: STR_HC_AP_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_HC_HE_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_HC_I_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_AUTO_CANNON
categories: [OXCE_MAIN_WEAPONS]
- type: STR_AC_AP_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_AC_HE_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_AC_I_AMMO
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_ROCKET_LAUNCHER
categories: [OXCE_MAIN_WEAPONS]
- type: STR_SMALL_ROCKET
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_LARGE_ROCKET
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_INCENDIARY_ROCKET
categories: [OXCE_AMMO, OXCE_MAIN_WEAPONS]
- type: STR_LASER_PISTOL
categories: [OXCE_SIDE_WEAPONS]
- type: STR_LASER_RIFLE
categories: [OXCE_MAIN_WEAPONS]
- type: STR_HEAVY_LASER
categories: [OXCE_MAIN_WEAPONS]
- type: STR_GRENADE
categories: [OXCE_GRENADES]
- type: STR_SMOKE_GRENADE
categories: [OXCE_GRENADES]
- type: STR_PROXIMITY_GRENADE
categories: [OXCE_GRENADES]
- type: STR_HIGH_EXPLOSIVE
categories: [OXCE_GRENADES]
- type: STR_MOTION_SCANNER
categories: [OXCE_SIDE_WEAPONS]
- type: STR_MEDI_KIT
categories: [OXCE_SIDE_WEAPONS]
- type: STR_PSI_AMP
categories: [OXCE_SIDE_WEAPONS]
- type: STR_STUN_ROD
categories: [OXCE_SIDE_WEAPONS]
- type: STR_ELECTRO_FLARE
categories: [OXCE_GRENADES]
-
Lastly, since there are new item categories and thus new translations needed, I'd like to ask for help with translations for the following strings:
en-US:
OXCE_CRAFT_WEAPONS: "Craft weapons"
OXCE_HWPS: "HWPs"
OXCE_MAIN_WEAPONS: "Main weapons"
OXCE_SIDE_WEAPONS: "Side weapons"
OXCE_AMMO: "Ammo"
OXCE_GRENADES: "Grenades"
OXCE_ARMORS_AND_CORPSES: "Armors & Corpses"
OXCE_PRISONERS: "Prisoners"
OXCE_COMPONENTS: "Components"
en-US:
OXCE_HWPS: "SWSs" # TFTD version of HWPs (heavy weapon platforms) is SWSs (submersible weapon systems)
I'm interested mainly in the following languages:
- Finnish, Hungarian, Italian, Japanese, Korean, Polish, Portuguese, Spanish, Russian
Other languages are of course welcome too.
-
Russian:
ru:
#xcom1:
OXCE_CRAFT_WEAPONS: "Бортовое вооружение"
OXCE_HWPS: "ТБП"
OXCE_MAIN_WEAPONS: "Основное оружие"
OXCE_SIDE_WEAPONS: "Вспомогательное оружие" # or shorter version: "Вспом. оружие"
OXCE_AMMO: "Боеприпасы"
OXCE_GRENADES: "Гранаты"
OXCE_ARMORS_AND_CORPSES: "Броня и трупы"
OXCE_PRISONERS: "Заключённые"
OXCE_COMPONENTS: "Компоненты"
#xcom2:
OXCE_HWPS: "ПБС"
Ukrainian:
uk:
#xcom1:
OXCE_CRAFT_WEAPONS: "Бортове озброєння"
OXCE_HWPS: "ВБП"
OXCE_MAIN_WEAPONS: "Основна зброя"
OXCE_SIDE_WEAPONS: "Допоміжна зброя"
OXCE_AMMO: "Набої"
OXCE_GRENADES: "Гранати"
OXCE_ARMORS_AND_CORPSES: "Броня та трупи"
OXCE_PRISONERS: "В'язні"
OXCE_COMPONENTS: "Компоненти"
#xcom2:
OXCE_HWPS: "ПБС"
-
Italian (of course felle free to modify/improve!)
en-IT:
OXCE_CRAFT_WEAPONS: "Armi da vascello"
OXCE_HWPS: "Piattaforma per armi pesanti"
OXCE_MAIN_WEAPONS: "Armi principali"
OXCE_SIDE_WEAPONS: "Armi secondarie"
OXCE_AMMO: "Munizioni"
OXCE_GRENADES: "Granate"
OXCE_ARMORS_AND_CORPSES: "Armature & Cadaveri"
OXCE_PRISONERS: "Progionieri"
OXCE_COMPONENTS: "Componenti"
en-IT:
OXCE_HWPS: "Sistemi armi sommergibili" # Le versioni TFTD HWP (piattaforma armi pesanti) sono le SWS (sistemi d'arma sommergibili)
-
Added cs, de, it, pl, ru and uk translations.
-
In case it can be of any help, french translation below
fr:
OXCE_CRAFT_WEAPONS: "Armement de vaisseau"
OXCE_HWPS: "PALs"
OXCE_MAIN_WEAPONS: "Armes principales"
OXCE_SIDE_WEAPONS: "Armes secondaires"
OXCE_AMMO: "Munitions"
OXCE_GRENADES: "Grenades"
OXCE_ARMORS_AND_CORPSES: "Armures & Corps"
OXCE_PRISONERS: "Prisonniers"
OXCE_COMPONENTS: "Composants"
I don't know about TFTD