OpenXcom Forum

OpenXcom Forks => OXCE Suggestions NEW => OpenXcom Extended (OXCE) => OXCE Suggestions OK => Topic started by: Pendra37 on May 30, 2024, 06:27:52 pm

Title: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on May 30, 2024, 06:27:52 pm
Facilities have the "crafts" value to set how many crafts the facility can hold. So far so good.
How about giving crafts a "size"? With this, you could set a hangar's capacity 2, and the small interceptor size 1. You could hold 2 interceptors there. Or make a heavy fighter size 2 so only 1 such craft could he housed in the hangar.

XCom Files come to my mind where this could be very helpful. Now you can park a single car in a massive hangar. After this, the hangar could be set to craft = 8. And the car is size 1, the van size 2, the tank is 3 and the actual planes like 6-8. 
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: remiz on June 01, 2024, 10:52:53 am
and it could be useful for Piratez and other mods
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Meridian on June 01, 2024, 12:19:55 pm
I will be adding craft/hangar slot types.

I will likely not be adding craft/hangar size.
(at least not until I see how the types features will work out)
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 01, 2024, 02:45:33 pm
I will be adding craft/hangar slot types.

I will likely not be adding craft/hangar size.
(at least not until I see how the types features will work out)

This is exactly what I wouldn’t want. It would make sense if it were possible to increase the total area of ​​the base, but within the boundaries that exist it will only create a lot of inconvenience.
"CraftSize" is a completely different matter. I've been waiting for this for a long time.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Juku121 on June 01, 2024, 02:55:09 pm
What exactly is this inconvenience? You'd still be able to put multiple craft in one hangar, so in theory one hangar could fit an armada of 100 fighter jets, while no hovercars are allowed - if you so desired.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 01, 2024, 10:18:43 pm
What exactly is this inconvenience? You'd still be able to put multiple craft in one hangar, so in theory one hangar could fit an armada of 100 fighter jets, while no hovercars are allowed - if you so desired.

The inconvenience is that you will have to put an additional hangar in place where there could be radars or defensive structures. I understand that no one builds a defense by fighting back with ships, but in my TFTU the situation is different. No ships will help completely secure bases from attacks.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 01, 2024, 10:49:55 pm
The craft size is somewhat more generic of a solution. You have a hangar where you can fit a chopper for 6 space and a van for 2. Meanwhile the type solution would make you build a parking lot for the two cars and a hangar for the chopper. You would not allow cars to a hangar even if it is empty.

The size solution would still allow types. Such as make a "parking lot" 4 space and make the smallest flyer 5 size.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Meridian on June 01, 2024, 11:26:39 pm
Type is IMO more generic solution than size.
(You can have hangars with all kinds of different slot types, no problem combining choppers and vans.)

Whereas size solution fails already at the simplest use case of separating submarines from aircraft.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 02, 2024, 06:04:55 am
The hangar can be made universal. But the size can't be helped. Yes, you can use small hangars only for small crafts, + a universal large one, which means both functions are needed.

With types, it turns out that transport ships must be divided into at least 4 types - small, large, small space, large space. And if you divide them into underwater/surface, the number of types increases to at least 8.

It seems to me that the ships shown below are slightly different sizes, but of the same type.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 12:52:54 pm
Size can have two "types". Above water with a +sign and below water with a - sign. Facility with -4 capacity can hold only below water crafts.
If we go purely type, you can go pretty nuts twisting the system to have some consistency.
You either have a large number of different facilities which would not allow cross parking. Or you allow cross parking, say a van can park a hangar but an interceptor cant be placed into a parking lot. Then you will be back to square one because only 1 craft can be in s hangar regardless of craft size.

I was thinking an analogy and the General Stores came to my mind. Now there are 2 types, general and live storage. Imagine if you added like general, gun racks, blast proof, refrigirated, live psionically shielded, live reinforced, live because a dead muton is like 6x the size of a heavy plasma but instead of assigning it a size of 9, you just want to count it as 1 since it is one piece of stuff. No, we happily accepted the typeless nature of stores if favor of size. Why is it an issue to have the same logic applied to crafts?

You may say like you can build 3 separated parking lots and then the sum capacity would allow a heavy transport plane to land. You cut the big craft into 3 parts or what? That would be  weird. I agree on that, so just fill craft size descending order into facility capacity ascending order.
You have a transport 7s, interceptor 5s, 2xAPC 3s, 2xVan 2s, 3xCar 1s. And you have 2xHangars 8c, 3xParking lots 4c.
Transport check parking 1-2-3 doesnt fit. Hangar 1 fit. Hangar 1 capacity is 1 now.
Interceptor, Hangar 1-parking 1-2-3 doesnt fit. Hangar 2 fits, cap is 3 there.
APC1 goes parking 1.
APC2 goes parking 2.
Van 1, 2 goes to parking 3.
Cars go hangar 1, parking 1, parking 2.
Hangar 2 has 3 more capacity for crafts.
Subs do this but they do everything with Abs()
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 02, 2024, 01:43:33 pm
Something is too difficult.   :D
There is a small single hangar for small ships, and there is a large one with 4 places, where you can place 4 small ships, or 2 large ones. This requires division into types and at the same time different sizes of ships.

And all these underwater/surface - in TFTD, all ships could fly over land, which means their hangars were not very different in equipment from conventional aircraft hangars.

By the way, about vans, APCs and other land vehicles - it’s very funny to watch them drive on water. It’s just that this type of equipment is alien to this game and its mechanics are not designed for such things. I don't use this and don't plan to.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Juku121 on June 02, 2024, 01:45:45 pm
Size can have two "types". Above water with a +sign and below water with a - sign.
And when the modder wants spacecraft and tunnelling craft that are different from either (real example, these already exist), what then? Complex numbers and then quaternions? :-\

Then you will be back to square one because only 1 craft can be in s hangar regardless of craft size.
No, why? Hangar size is going to be independent of hangar/craft types, as I understand it.

[stores]

Why is it an issue to have the same logic applied to crafts?
Because we want to differentiate between crafts, but do not care about what exactly is getting stored. If we didn't, this whole feature would be close to pointless, since we already have stores-like hangars. AFAIK, people who want hangars based on whether the crafts are fighter jets, submarines, cars or space shuttles considerably outnumber those who want to build 7 garages and then store their fighter jets inside.

What you're proposing is having both stores-like and type-based hangars at the same time.

You have a transport 7s, interceptor 5s, 2xAPC 3s, 2xVan 2s, 3xCar 1s. And you have 2xHangars 8c, 3xParking lots 4c.
As I understand it, even the types version is kind of a pain in the ass to implement, both due to performance and all sorts of corner cases. Look at WarStalkeR's attempt (https://openxcom.org/forum/index.php?topic=11493.0) at craft sizes.

When we have type-based hangars and Meridian has a better idea of how things shake out, then we can have a proper discussion of whether to try craft sizes, too.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 02:36:44 pm
Hm, how about doing some old timey range divisions? Take the size and divide by 16. Integer part is type, remainder is size.
Size 0-15 is type 0. Size 16-31 is type 1 etc. Size 0 is type 0, size1. Size 18 is type 1, size 3. Simple no quaternions or whatever.
If you dont care about size just type, use 0, 16, 32 etc. If you do care, go for other numbers. Size can be type but type cant be size. Unless you want a different facility for different types/sizes. Also, it still doesnt solve the issue of allowing 1 tiny craft in a massive hangar. Unless  you also add another value say can hold 4 type 1 crafts or 2 type 2 crafts or 1 type 3 craft. At this point you implemented craft size, just not from the craft's perspective but from the facility's.

I don't care about type, I still dont. The alternate proposal was called a compromise. Meridian pointed he would prefer type. Instead of bashing type as stupid and pointless idea, because size is the only true way, I merely mentioned, why not both? It is not that they are mutually exclusive or something. Being a dev and a software architect, I picked up a few ideas how to propose features in a non aggressive way.

Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Meridian on June 02, 2024, 02:45:17 pm
Yes, both can be implemented.

I just said I will do type first and then reevaluate.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 02:48:44 pm
Land vehicles over sea, well I consider the agents buy plane tickets. Then drive to an airport, get on a plane, fly to the other continent and rent another car.
For the APCs, they fly as cargo on a chartered C130 or similar slow plane.
An underwater base with a car driving out would be some wild James Bond stuff like the white Lotus.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 02:51:41 pm
Yes, both can be implemented.

I just said I will do type first and then reevaluate.

That is good enough for me, thanks! If you want a hand, I can chime in. The code doesn't look too complicated compared to FPS or Unreal games.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Delian on June 02, 2024, 05:15:25 pm
My opinion is that, the original proposed idea is not good in that it's both too complicated and not customizable enough. And it wouldn't work well with drawing crafts in basescape so it wouldn't look good.

Hmm. Let's look at how similar problem was solved with other base facilities.
Alien Containments have type.
Laboratories have type through services.
Workshops have type through services.

The main problem with Hangars is that they're non-fungible, so a solution with services wouldn't work. But other than that, Alien Containments already use type and it works well.
Other facility types can be larger than 1x1, so technically they're already a size+type solution. But I'm not sure if Hangars can be 1x1 or 3x3. If they can be, then only type has to be added (plus allowedHangarTypes on crafts), and that should be enough to cover most uses.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 06:11:52 pm
The base issue is: I have 2x2 Hangar with Craft = 1.
I have a tiny car. Since the hangar is craft = 1, I can fit either a car, or an Osprey chopper or a massive space dreadnought because all of them are exactly 1 craft.
How can I make the game realize that a car is smaller than 747 jumbo jet, therefore I should be able to put more than 1 car sized craft into a 747 sized hangar.
You say car is type 1, 747 is type 2. Make the 747 hangar accept only type 2. Ok, but that raises the question, why on earth cars are not allowed into a 747 hangar? What is the logic behind that real life or game? You say, ok type 1 cars are allowed into the 747 hangar. Nice, problem solved. Except, I can still park a single car into that massive hangar.

Type works one way, big thigs dont fit into small facilities but it say nothing about small things taking the exact same size as big things if allowed into big facilities.

General stores vs Containment are the example how Type AND Size work together. Everything in game have Type AND Size. Even manufacture. Except crafts. They have neithet Type nor Size. They are single crafts. Adding type is one part of the concept adding size is the other.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Juku121 on June 02, 2024, 07:09:09 pm
Except, I can still park a single car into that massive hangar.
A hangar is not just a space to fit vehicles, it's the in-game representation of the logistics network required to maintain that craft and its interception/transport missions. It very much makes sense that you cannot park your global car rental agreement in the sub pen.

General stores vs Containment are the example how Type AND Size work together.
Except they don't. No matter if the alien is a tiny brainsucker or a giant sloth creature, they all take the exact same amount of containment 'space'. This is an example of type and size working in parallel, not together.

Everything in game have Type AND Size. Even manufacture. Except crafts. They have neithet Type nor Size. They are single crafts. Adding type is one part of the concept adding size is the other.
But nothing actually uses type and size together. Scientists are a number, there are no special scientist types. Or engineer types. Or item storage types. Or alien containments with sizes that can house multiple types of captives.  Etc.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 02, 2024, 08:21:59 pm
There is no need to equate the game with reality. The game must have gaming conventions, for which we love them. Excessive realism only harms the gameplay. In such matters, you need to approach the matter from the point of view of playful expediency.

And the expediency is such that we have ships that should emphasize their importance with increased sizes.

Actually, to enter a new parameter (size) it takes about 10 seconds per couple of lines of code. Just don’t come up with stupid calculation formulas and other unnecessary complications. But introducing types for ships will not be very easy. It will be even more difficult to force different hangars to display only the types of ships allowed specifically for them.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 08:53:50 pm
A hangar is not just a space to fit vehicles, it's the in-game representation of the logistics network required to maintain that craft and its interception/transport missions. It very much makes sense that you cannot park your global car rental agreement in the sub pen.
Pave over? Put a metal sheet on the pen? Or how about making it fly? Or maybe put it onto the sea using cranes? So many options.


Except they don't. No matter if the alien is a tiny brainsucker or a giant sloth creature, they all take the exact same amount of containment 'space'. This is an example of type and size working in parallel, not together.

It is usually not the same because containment has either infinite space or some very high number, like 50. Hangars have neither of those stats. But I agree that if a single 2x2 hangar could hold 50 crafts, then this would be a non issue.
 
 
But nothing actually uses type and size together.
How about, I don't know, dead aliens? They have a Type ("CORPSES") AND a Size (0.4). Imagine if the stores worked like you said, no type and size. Muton corpse 1 space, pistol mag 1 space, Eleriumm crystal 1 space. Have fun fitting all the equipment and material into a single base...
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Ethereal on June 02, 2024, 09:08:34 pm
It is usually not the same because containment has either infinite space or some very high number, like 50. Hangars have neither of those stats. But I agree that if a single 2x2 hangar could hold 50 crafts, then this would be a non issue.

The capacity of the hangars is adjustable and, if desired, can be done like this:

Code: [Select]
facilities:
 - type: STR_HANGAR
    crafts: 999
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Pendra37 on June 02, 2024, 09:12:18 pm
...

XCom is a more or less realistic tactical game. Realistic planet, environment, weapons and situations. As realistic as the capabilities of the contemporary computers and style of game allow. Heck, if you replace the aliens with terrorists, you can call it Rainbow Six tactical.
The realism in the game even hurt the gameplay experience. Like soldier inventory management, buying mags and reloading the weapons manually, come on. XCOM'12 streamlined all the excess "realism" away.

Anyhow Type isn't all that hard to implement. If you want to buy a Craft Type 2, the can can interate through the facilities and check:
Can fit craft? Yes/No
Can fit Type 2? Yes/No
Does have enough free capacity? Yes/No

The game doesn't really care which craft is stored in which facility. Just like it doesn't care in which General Store you hold what item. You have free space for the craft at the time of purchase, you are good.

I know the Craft nr can be modified and I did that. I could fit 8 cars and that was cool. I could also fit 8 space dreadnoughts, which was a bit weird. That was the point I realized, a Craft size would be a good addition.
   
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: Juku121 on June 02, 2024, 09:51:16 pm
I hardly think being unable to park cars in sub pens is 'excessive realism'. If you're so unconcerned about 'realism', just make your hangars 1x1 and with 'crafts: 10 000 000', boom, your original space problem is solved.

Goes for Pendra's universal paved-over sub-pens/crane harbours, too.


As to the rest, I'm trying to be not too confrontational these days, and I don't think the arguments here are conducive to that. So I'll just skip further conversation. Meridian will likely do as he said, anyway.


For the record, OXC has fixed the containment bug, and nowadays containment space is quite limited. 10 aliens total, not even different types, is the vanilla limit. Ethereal already told you about hangar capacity.

At least two people have already implemented hangar changes, one with sizes and one with types. The latter is available in BOXCE. Neither is nowhere near as simple as you two try to portray it, and Meridian has more potential problems to solve than either of the two, due to OXCE being the modding standard these days.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: WarStalkeR on June 07, 2024, 09:46:25 am
At least two people have already implemented hangar changes, one with sizes and one with types. The latter is available in BOXCE. Neither is nowhere near as simple as you two try to portray it, and Meridian has more potential problems to solve than either of the two, due to OXCE being the modding standard these days.
Yeah, I had to go along with sizes (which also can be granulated into classes/types, if you want), because otherwise there is no way to sort and allocate them algorithmically in a proper manner.
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: zee_ra on August 18, 2024, 12:43:00 am
Yeah, I had to go along with sizes (which also can be granulated into classes/types, if you want), because otherwise there is no way to sort and allocate them algorithmically in a proper manner.

We can go either with sizes or exclusive categories, and we could have one type of multi-vehicle hangar per base.  Check out my comments here https://openxcom.org/forum/index.php?topic=10870.msg165711#msg165711 (https://openxcom.org/forum/index.php?topic=10870.msg165711#msg165711).
Title: Re: [Suggestion] Craft size and Hangar capacity
Post by: zee_ra on August 18, 2024, 12:58:21 am
Yes, both can be implemented.

I just said I will do type first and then reevaluate.

We actually could have both more-or-less.  We really don't need size, but rather an ordering (an ordered sequence) of size-types.  That is, sizes are just points, they are not additive.

For some units, we need to have them confined to their type (e.g. vehicles need a garage, period).  That could be done with a flag that would prevent these vehicles for being considered for higher size types.

For some units we may want to consider placement to into larger sized containers.  A specific example would be placing two fighters into a spacedock (or it could be a transport ship dock).  That could be done by setting the flag to confine to size to false.

With submarines and other entirely disjoint types, the key aspect is that these types are truly disjoint.  Thus, it would suffice to introduce an additional parameter to designate the category.  The land crafts could have 0 (which would include cars, confined to their garages, fighters that could inhabit larger hangars based on their type-size ordering, larger vessels and space-crafts residing in top-tier type-size).  The submarine crafts could have 1.  The difference here is:


I think this approach is very natural and covers almost all use cases that are encountered in practice.

Check out discussion at https://openxcom.org/forum/index.php?topic=10870.msg165711#msg165711 (https://openxcom.org/forum/index.php?topic=10870.msg165711#msg165711) as well.

My aim with designing these rules has been to avoid the pitfalls associated with the unrestricted assignment of subsets or intervals to hangars or vehicles.  One of the relevant counterexamples is noted by the WarStalkeR at the https://openxcom.org/forum/index.php?topic=10870.msg162989#msg162989 (https://openxcom.org/forum/index.php?topic=10870.msg162989#msg162989).  He spoke of pitfalls with assigning arbitrary subsets to hangars, but the same kind of problems and counter-examples arise when we assign arbitrary subsets to vehicles.  In fact, the problem remains if we assign not just arbitrary subsets, but only arbitrary intervals to vehicles.

The only place where we may assign arbitrary subset (and it is highly desirable for this to be a subset rather than a wildcard, including all possible values) in the specifications is only when we have one hangar type with such assignment present at a base (e.g. two space-ports on a base that could take fighters and larger transports is feasible, and also at the same time another base could have a repair dock that may hold more craft types, but may either cost more or require a special workshop, etc.).  What is important is that the types of multiple housing should not be mixed.

The dilemma is that there needs to be one base with hangar admitting multiple types (workshop base making fighters and heavy transports).  It is not necessary to use the system of unrestricted sizes in order to have this, since both within the system of exclusive categories, sizes, and a system of sizes with per-vehicle optional category restrictions, it is still possible to have one type of hangars with explicit multi-vehicle configuration (that could admit an arbitrary subset of vehicle types).