Author Topic: [DONE][SUGGESTION] Alternate loadout system  (Read 19931 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11531
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
[DONE][SUGGESTION] Alternate loadout system
« on: March 31, 2022, 03:16:54 pm »
EDIT: documentation here: https://openxcom.org/forum/index.php/topic,10452.msg149914.html#msg149914

I would like to suggest a new, alternative system for equipment handling (similar to how X-Com Apocalypse did it):
1. You equip soldiers from BASE storage, not SHIP's.
2. If you put a soldier on ship, all stuff this soldier has equipped is moved onto that ship.
3. If you take a soldier off a ship, everything they carry is removed from the ship as well.
4. (optional) An option to limit craft inventory by weight or/and number of items, NOT counting items equipped on soldiers.

The reason I'm requesting this is that mods like Piratez or (to a lesser degree) XCF are fundamentally different from the original game model. In vanilla, your soldiers are highly interchangeable: while they gain stats, they still have the same unit profile. These mods on the other hand - and probably others too - shift their focus more on individual units with specific roles, which begs for a different approach to equipping them.
Saving equipment templates is already very helpful, but the proposed model would further improve the UI.
« Last Edit: October 29, 2022, 07:26:34 pm by Meridian »

Offline Alex_D

  • Colonel
  • ****
  • Posts: 496
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #1 on: March 31, 2022, 05:28:08 pm »
Interesting. So, let me see if I got it right:
1. You would preload the soldiers from the Agent screen (pressing I, for example).
2. You go on to a craft and load it with soldiers.
3. Then on craft inventory, you press a button (or something) and essentially load the craft with whatever else is needed to complete the soldiers load out.

For example: Two soldiers each preloaded with one pistol, one clip, and one knife.
Craft is only loaded with 2 knives and a medkit.
Soldiers are assigned to craft.
Craft is forced to add to the inventory two pistols and two clips, on top of the existing knives and medikit.

Sol, Is this what you had in mind?

Online Yankes

  • Commander
  • *****
  • Posts: 3246
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #2 on: March 31, 2022, 05:48:56 pm »
From my perspective this will be pain in ass to implement correctly as we still need have current inventory handling.
This mean we will have two inventory systems that need live together and as always we will have multiple corner cases to handle.

Question is can we solve this problem without overhauling current system? Like options to clean all inventory in craft and loading items based on templates of selected soldiers in given craft? Could this solve problem?

Offline Alex_D

  • Colonel
  • ****
  • Posts: 496
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #3 on: March 31, 2022, 06:59:16 pm »
Like options to clean all inventory in craft and loading items based on templates of selected soldiers in given craft? Could this solve problem?
Or to "append" items to the craft inventory based on the templates? One could always press CTRL+ALT+X (?) to unload unequipped items from the craft afterwards.

Online Yankes

  • Commander
  • *****
  • Posts: 3246
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #4 on: March 31, 2022, 08:04:41 pm »
"append" have one problem that will duplicate items or will miss some items.
This depend on what exactly will be algorithm used to deciding what item to load and when.

Offline R1dO

  • Colonel
  • ****
  • Posts: 438
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #5 on: March 31, 2022, 10:09:09 pm »
From my own tinkering with OXC code most of the information needed for points 2 and 3 is already present in the item equipscreen of a vehicle.

Once equipped a soldier remembers it's load-out till the next time you visit the (fake) battlescape inventory screen.
This means one can iterate over all assigned soldiers on a craft and (temporally) store the total amount of each "requested" item.
Afterwards one can compare this with the items currently on base and use existing mechanisms to add/substract the amount of a specific item to the craft till it is in balance.

Equipping all soldier can be done using a temporal overflow of all base items on the craft and visiting the inventory screen from that place (as in the current situation) for all soldiers currently on that craft.

Problems with this approach:
1) How to make the balancing functionality available to a player (a button or some global increase/decrease arrows which allows for balancing using some modifier plus mouseclick combo)?
2) Determining how to act on extra items which the player probably put in the craft on purpose.
3) What to do when too little items are available on base to satisfy demand of all soldiers (on the first time you enter the inventory screen afterwards some soldiers will lose their loadout preference)
4) How to communicate to the player when point 2 and/or point 3 is happening on the current ship (item).

Unfortunately i do not think this is possible to do outside the equipment screen unless the add/substract methods become 'shared'. And even then one needs access to information if the amount of items are still below the craft limit, so one can devise a way to prevent such an aircraft to launch.

P.s. If i am correct such a system is already mostly in place (at least the decrease items part) in OXCE, available via some shortcut. This assumption is based on some of Meridian's (older) youtube videos, so i might be incorrect here.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11531
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Alternate loadout system
« Reply #6 on: April 01, 2022, 01:52:13 pm »
Many thanks for the initial responses, guys.

Admittedly I have expected it to be a pain in the ass, so I wasn't in a hurry to post this suggestion, but it's something that has bothered me for so many years that I decided to give it a try. It's just too good to pass. :)

Offline Delian

  • Colonel
  • ****
  • Posts: 281
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #7 on: April 01, 2022, 03:54:22 pm »
If I understand correctly, this suggestion is about not needing to mange the equipment section for crafts anymore, because all the craft items would passively be the ones that are equipped on the soldiers.

In general I don't like this suggestion because, the amount of different weapons and items you have in the base's inventory can be staggering, at least in some large mods like xpz, so when in the inventory screen, it would be a pain in the ass to scroll through all the base items to find the one you want to put on a soldier. The second issue is that, at least in xpz, you would still need to manage craft equipment anyway, because you'd want to bring protective, utility, and other backup items with you, without wearing them by default on any soldier. The third reason is that this would be difficult to implement, as Yankes said, two systems would have to work side-by-side in the mod.

The first issue could be solved with some sort of filtering, hidden items, perhaps.
The second issue could be solved by... not sure. Would have to change the way craft equipment list works, so it would function as a simple "extra equipment list" to bring on the craft.

Hmm... not sure how to solve this.
« Last Edit: April 16, 2022, 01:25:58 am by Delian »

Offline yergnoor

  • Colonel
  • ****
  • Posts: 138
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #8 on: April 01, 2022, 05:03:38 pm »
I have read all of the previously proposed options for the alternative soldier equipment system and thought about how the changes could be minimized so that the new system would be as close to the old system as possible.

So, what is the biggest inconvenience, in my opinion - despite the fact that each soldier now remembers the equipment issued to him (that is, the rudiments of the personal equipment system already exist), when he is assigned to another transport plane, it may not have the right amount of equipment for all soldiers. And if you open the outfitting screen, you see the operatives not fully equipped.
That is, simply assigning soldiers to transport is not enough, because among them there may be specialists who require special equipment.

So I propose that the game itself checks whether there is enough equipment on board, after assigning the crew, based on their previously assigned equipment (summing up their personal equipment and comparing it with what they already have), and asks if they need to supplement the onboard supplies. If there's something missing from the base, it tells what and how much - similar to the lack of equipment screen after the battle. At the same time, if there is a surplus in the transport, it stays there. Also later you can additionally load the necessary reserve ammo and weapons in the usual way.

It would also be good to have a separate option to equip a soldier not yet assigned to the transport. To do this, there should be a separate equip button in his profile. If a soldier is already assigned to a transport, he will be equipped from the stocks of that transport, but if he's still free, he will be equipped from the base's store.
That is, if you want, you can give him rare equipment at the base, and then assign him to the transport and then the game will ask whether to load his necessary equipment after him, if it does not appear on board a free replacement.

I understand that my option does not cover all possible situations.
For example, I do not propose to unload rare equipment in the warehouse base, following the departed fighter. This would have to do manually.
But this semi-automatic loading transport necessary equipment, as I think should make the game with mods, where there is a lot of different equipment.

P.S. There may be inaccuracies in the text as it is a machine translation. Sorry.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8713
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #9 on: April 01, 2022, 05:28:42 pm »
Hard to believe this is a machine translation.
Machines are getting too smart :)

Anyway, this is so far the most painless proposal.
We could start here and see if that's enough.

It would also be good to have a separate option to equip a soldier not yet assigned to the transport. To do this, there should be a separate equip button in his profile.

There is a "hidden" button for this already.
Press `I` in the Soldier List UI.

Offline yergnoor

  • Colonel
  • ****
  • Posts: 138
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #10 on: April 01, 2022, 05:52:26 pm »
There is a "hidden" button for this already.
Press `I` in the Soldier List UI.
Thanks for the advice. Yes, it works, although it is not so convenient to do it on Android, you need a special keyboard, which can be called on the screen at any time.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5439
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: [SUGGESTION] Alternate loadout system
« Reply #11 on: April 13, 2022, 11:21:43 pm »
I fully support Solar's request - the Apocalypse system is simply better. But I see the problem with code implementation and too drastic changes which could make UFO into not-UFO (which we don't want), so let's break it to bare bones - what I'd consider "minimum" implementation that'd make me happy:

An option selectable per mod or per user, which causes:
1) When you move a soldier onto a craft, the game automatically loads equipment on craft to be able to fill that soldier's autosaved loadout;
2) When you remove soldier from a craft, the game removes all the items they were carrying (in other words, their autosaved loadout) from the craft.

Prompt optional but there should be warning popup if base stocks are insufficient (with options to cancel, proceed, and cancel+ go to buy/manufacture screen like after-battle)?

This, combined with the already existing option to equip soldiers at base, not at craft (it does exist, right?), would allow to move soldiers between crafts freely, without all the annoying and time consuming micro associated with manually loading up the crafts (and unloading them).

Maybe we can thus achieve the desired effect with minimum interference in the existing code, and with maximum reuse of already existing OXCE elements.

Online Yankes

  • Commander
  • *****
  • Posts: 3246
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #12 on: April 13, 2022, 11:48:21 pm »
Could be this function enabled when you assign soldier to craft using some modifier?
Like if you click `shift` when you assign/remove solder then game try add/remove items from load.
Without it game behave same way as it now work.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11531
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Alternate loadout system
« Reply #13 on: April 14, 2022, 12:32:29 am »
Could be this function enabled when you assign soldier to craft using some modifier?
Like if you click `shift` when you assign/remove solder then game try add/remove items from load.
Without it game behave same way as it now work.

From the player's perspective, it would be just tedious...
If I (as a player) want to use this system (and why wouldn't I?), then this Shift would always need to be pressed.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8713
    • View Profile
Re: [SUGGESTION] Alternate loadout system
« Reply #14 on: April 14, 2022, 09:28:27 am »
I'll give it a try.

Removing things from the craft may be tricky in corner cases though.
For example from soldiers who are not at base, e.g. wounded after mission.