OpenXcom Forum

OpenXcom Forks => OXCE Suggestions NEW => OpenXcom Extended (OXCE) => OXCE Suggestions OK => Topic started by: Solarius Scorch on April 11, 2020, 09:27:32 pm

Title: [Suggestion] Land/Underwater craft attribute
Post by: Solarius Scorch on April 11, 2020, 09:27:32 pm
In XCF, we want to go hybrid (create new textures on our globe to represent the seabed, using the texture property fakeUnderwater: true and setting the terrains of these textures to a depth of > 0). However, we faced a problem:
We want to limit the player's use of crafts to different types of environments. Let's say we have cars and helicopters, and naturally we don't want to use them for submarine missions (where the depth is > 0). But we will also have cargo planes to transport submarines, and it will be quite silly to use it for land deployments and obviously will be quite detrimental for the immersion.

Yes, it is possible to limit the player from using craft with startingConditions, but they were originally designed for more specific scenarios, like special missions in Piratez. In this way, we would have to specify it for absolutely all our deployments, and also change absolutely all existing startingConditions, which are already quite complex. This is not a very elegant solution, so maybe it's possible to make a different addition to the code?
How it would work: when you try to go to the mission, the game checks whether the depth on the deployment is acceptable for this craft. And if not, the game displays a window describing that you cannot use this craft for this mission.
(I have discussed it with Finnik, who offered to code this; basically he is leading this idea, but I confirm that it would be useful.)

Perhaps it would be good to use approximately the same syntax as we already use for craftWeapons. You can make two binary parameters: underwaterOnly and landOnly, or make underwaterOnly, for example, as an integer, where -1 means that the depth is not important (the default), 0 only for deployment with depth = 0 and 1 for depth > 0. The current fakeUnderwater parameter for facilities also works similarly. Of course, naming is not the crucial point, so it can be whatever else is necessary.
Title: Re: Land/Underwater craft setting
Post by: Meridian on April 11, 2020, 10:29:43 pm
Doesn't TFTD already do that?

Some craft cannot go too deep... or is it just for interception?
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 11, 2020, 10:36:38 pm
I am a newbie in tftd modding, and I played tftd once when I was 8, so I can't say for sure. But as far as understood ruleset reference - this is only for interception and only because of craft weapon property. If it is possible, I would very welcome some advice on how to do what we need.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 10:06:55 am
I believe Solarius is doing XCF for UFO, not TFTD. A while ago, I raised a similar feature request regarding Submersible combat. Now, the feature request I made is now aligned with this request.

Enabling negative values for UFO trajectories in fakeunderwater: true terrain and etc.

Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 10:13:15 am
Previous request raised.

https://openxcom.org/forum/index.php/topic,7557.0.html

They want certain craft to use certain terrain like car on land,  sub in sea.

UFO can’t have negative value in altitude on land, in sea, negative means UFO is underwater etc.

Solarius and Finnik welcome to Hybrid modding, the more the merrier...
Title: Re: Land/Underwater craft setting
Post by: Nord on April 12, 2020, 10:47:38 am
Doesn't TFTD already do that?

Some craft cannot go too deep... or is it just for interception?
In fact, no.
Geoscape depth (which a crafts using) in TFTD is checked through "altitude". "Depth" used only for battlescape.
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 12, 2020, 02:32:15 pm
I believe Solarius is doing XCF for UFO, not TFTD.
Of course, that is obvious! I said that because it is based on the same engine, so it does not matter, I can use the same properties, that are used for tftd mods.

Of trajectories, interception and altitudes are not related to the topic. I believe, when deployment is formed and presented on geoscape with its marker, it already has some depth. It can take it from the terrain, or it can be set on deployments rulesets itself. So, deployments on true land would always have depth = 0, like vanilla xcom1. Textures with fakeUnderwater: true would have terrains listed that would have depth > 0. With that, we could split crafts, that are going to land at these deployments, having crafts only for true land operations (car, helicopters, etc), and for underwater operations.

So ufo trajectories, altitude, interception is not related to the topic.
Title: Re: Land/Underwater craft setting
Post by: Meridian on April 12, 2020, 02:39:41 pm
In fact, no.
Geoscape depth (which a crafts using) in TFTD is checked through "altitude". "Depth" used only for battlescape.

Well yes, it's called altitude, because it's called like that in xcom1. Can't be called both :)
But it represents depth in TFTD, see the translations:

Code: [Select]
  STR_VERY_LOW: "SHALLOW"
  STR_LOW_UC: "NORMAL"
  STR_HIGH_UC: "DEEP"
  STR_VERY_HIGH: "VERY DEEP"

It's the same like "fakeUnderwater" would not be fake underwater in TFTD, but fake dry land.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 03:50:08 pm
Of course, that is obvious! I said that because it is based on the same engine, so it does not matter, I can use the same properties, that are used for tftd mods.

Of trajectories, interception and altitudes are not related to the topic. I believe, when deployment is formed and presented on geoscape with its marker, it already has some depth. It can take it from the terrain, or it can be set on deployments rulesets itself. So, deployments on true land would always have depth = 0, like vanilla xcom1. Textures with fakeUnderwater: true would have terrains listed that would have depth > 0. With that, we could split crafts, that are going to land at these deployments, having crafts only for true land operations (car, helicopters, etc), and for underwater operations.

So ufo trajectories, altitude, interception is not related to the topic.

If a solution is to be implement in this, please don't do it just purely for XCF. Please do it for the benefit of all the other Hybrid mods as well. Most of the other Hybrid features implemented prior were designed not for just one mod.
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 12, 2020, 04:01:57 pm
If a solution is to be implement in this, please don't do it just purely for XCF. Please do it for the benefit of all the other Hybrid mods as well. Most of the other Hybrid features implemented prior were designed not for just one mod.

I don't think only XCF could use this feature. In any mode where the developer would like to make different crafts for surface and underwater operations, this property will be very handy to use. I'm just saying that from my point of view, this suggestion is mechanically in no way related to what you want for your hybrid mod. As Nord correctly said, depth is a parameter from battlescape and that's all we need. We don't need to introduce other, much more complex mechanics for that.

Negative UFO trajectory altitudes and underwater intercepts are very different mechanics to what we asked.
Title: Re: Land/Underwater craft setting
Post by: Nord on April 12, 2020, 04:02:29 pm
Well yes, it's called altitude, because it's called like that in xcom1. Can't be called both :)
But it represents depth in TFTD, see the translations:

Code: [Select]
  STR_VERY_LOW: "SHALLOW"
  STR_LOW_UC: "NORMAL"
  STR_HIGH_UC: "DEEP"
  STR_VERY_HIGH: "VERY DEEP"

It's the same like "fakeUnderwater" would not be fake underwater in TFTD, but fake dry land.
Yes, but for division to surface/shallow/deep/very deep (battlescape) used another parameter:  "depth:" in alienDeployment.
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 12, 2020, 05:15:26 pm
Guys, please correct me if I'm wrong. Let's operate on the engine terminology. I understand there are two concepts-- altitude and depth, and they're not related to each other. Altitude is how high an object flies on a geoscape. In TFTD, this parameter works the same way, just for the player in translation its value is turned upside down. And there is depth - this is a property of the terrain and the deployment will take this value from the terrain on which it finds itself. So, as Nord said, these parameters are of different kinds and in fact have no relation to each other, as far as I understand.

If I'm right, our suggestion has nothing to do with either the fakeUnderwater texture property or the altitude (of what? UFOs that are flying around?). It has to do with the depth of the deployment that the XCOM craft is going to fly and land on. This depth of deployment will be obtained either from the terrain of the texture on which it finds itself, or from the terrain that is represented in the deployment itself (for example, missions cargo ships, although they will be on fakeUnderwater, will have their own terrain with a depth 0, so they do not need a submarine). I understand that it is possible to specify depth in the deployment itself, but I do not know how they interact with the depth that comes from the terrain. I think the depth of deployment is used, but that's just my intuition.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 06:28:54 pm
Guys, please correct me if I'm wrong. Let's operate on the engine terminology. I understand there are two concepts-- altitude and depth, and they're not related to each other. Altitude is how high an object flies on a geoscape. In TFTD, this parameter works the same way, just for the player in translation its value is turned upside down. And there is depth - this is a property of the terrain and the deployment will take this value from the terrain on which it finds itself. So, as Nord said, these parameters are of different kinds and in fact have no relation to each other, as far as I understand.

If I'm right, our suggestion has nothing to do with either the fakeUnderwater texture property or the altitude (of what? UFOs that are flying around?). It has to do with the depth of the deployment that the XCOM craft is going to fly and land on. This depth of deployment will be obtained either from the terrain of the texture on which it finds itself, or from the terrain that is represented in the deployment itself (for example, missions cargo ships, although they will be on fakeUnderwater, will have their own terrain with a depth 0, so they do not need a submarine). I understand that it is possible to specify depth in the deployment itself, but I do not know how they interact with the depth that comes from the terrain. I think the depth of deployment is used, but that's just my intuition.

Perhaps it would be good to use approximately the same syntax as we already use for craftWeapons. You can make two binary parameters: underwaterOnly and landOnly, or make underwaterOnly, for example, as an integer, where -1 means that the depth is not important (the default), 0 only for deployment with depth = 0 and 1 for depth > 0. The current fakeUnderwater parameter for facilities also works similarly. Of course, naming is not the crucial point, so it can be whatever else is necessary.

Okay, like Solarius has written, how this terrain binding for relevant vehicles, Car, submarine works is, underwater only and landonly, usind depth.. and craft uses Altitude.

This is very similar to something I propose in the feature request a while ago. If Craft uses altitude=0 can't go higher or lower, it is a car. If Craft use altitude having positive value, say from 0 to above, then it is an aircraft. Altitude negative value, from 0 to negative -5 it is a Submarine.

So if you have two flag for a craft, say, maxAltitude this parameter already exist. So if you have a new parameter like minAltitude, setting BOTH flags as zero. You have a Car.

If maxAltitude=-5 and minAltitude= -1, it is a submarine and so on.

All we need is some kind of texture flag, as to which texture this craft can operate on. Then you got what you need.

If you are going to implement this craft to terrain binding feature. Why not go another step? Having negative waypoints for ufos trajectories?  This will allow craft to intercept certain ufo at certain altitude, it simulate air and underwater combat in a sense. You just need to be able to implement negative values and some check at waypoint 0 on a texture, the ufo is landing or not. If it is on a land then it is, on a sea texture, it is not. Having negative waypoint is an extension to the current waypoints system that's use in ufo.

In TFTD, ufo waypoints are positive, but reflects on the depth it can go. So if you have TFTD and UFO, then UfO and USO can use both positive and negative values for waypoints on sea textures, so they can be in the air if it is positive value or underwater for negative values.

If you want complete Hybrid modding, best to have both, instead of one half done and the other half cast aside.

Title: Re: Land/Underwater craft setting
Post by: Solarius Scorch on April 12, 2020, 08:34:35 pm
Precentor, I'd appreciate if you stick to your thread and not derail this one. Your ideas have little to do with the subject and you're basically hijacking the thread to push your agenda which I am completely uninterested in.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 09:14:32 pm
Precentor, I'd appreciate if you stick to your thread and not derail this one. Your ideas have little to do with the subject and you're basically hijacking the thread to push your agenda which I am completely uninterested in.

Understandable, XCF is your mod. However, enabling general hybrid features for modding is for all modders, not just XCF. I am pushing an agenda that is useful for all modders into hybrid modding, not just for XCF alone. I am sure Meridian will want this important feature available in general for all mods instead for some specialize feature for just XCF alone. Beside, I asked for this feature before XCF is transforming into a Hybrid mod.

Also this tread is not a private tread in the XCF section of the forum but a general section.

Lastly, It is the Dev decision from now on how it is done. I have done what I wanted in pointing out the general need out weight specialization for just one mod.

Title: Re: Land/Underwater craft setting
Post by: Finnik on April 12, 2020, 09:27:46 pm
But your solution with altitude has nothing common to what we suggested here, and it alone would not solve our problem, because those 2 mechanics are not connected. As we can place submarine carrier craft on true land and if limit it to only your "negative" altitude, it would be unable to move anywhere!
Title: Re: Land/Underwater craft setting
Post by: vadracas on April 12, 2020, 09:39:10 pm
If it was possible to merge those two ideas though...

What if mission sites had an altitude assigned to them, also. That would allow for much more complex mechanics of which craft can go where without more complexity on the modding side.

What I mean is if a craft has a max altitude of 80,000 feet and a min altitude of 0, then it can intercept most UFO's and do ground/aerial(If it's implemented this would be possible) missions while a craft with max altitude 1000 feet and min altitude -800 feet or something would be able to do underwater missions and land missions but nothing in the air. Even better, it would also simplify things like space missions or moon missions where craft that can go to them simply need to have a high enough or low enough max/min altitude to get there.


P.S. I think this is a more effective all-round solution, but would probably be more difficult to implement.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 12, 2020, 09:40:03 pm
Let Meridian decide on this, I am just pointing out using some of what the ruleset already have to make the feature possible.

 
As we can place submarine carrier craft on true land and if limit it to only your "negative" altitude, it would be unable to move anywhere!

I am not 100% in understanding of your sentence here, like as a submarine carrier is an aircraft carrying a submarine or a landcraft carrying a submarine. I mention an extra flag is possibly needed to check if the craft is on a land or sea texture while using the negative altitude value.
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 12, 2020, 10:42:32 pm
If it was possible to merge those two ideas though...

What if mission sites had an altitude assigned to them, also. That would allow for much more complex mechanics of which craft can go where without more complexity on the modding side.

What I mean is if a craft has a max altitude of 80,000 feet and a min altitude of 0, then it can intercept most UFO's and do ground/aerial(If it's implemented this would be possible) missions while a craft with max altitude 1000 feet and min altitude -800 feet or something would be able to do underwater missions and land missions but nothing in the air. Even better, it would also simplify things like space missions or moon missions where craft that can go to them simply needs to have a high enough or low enough max/min altitude to get there.


P.S. I think this is a more effective all-round solution, but would probably be more difficult to implement.

To me, it looks like this is a very different story for implementation in code. I mean, what you want with interception is an INTERCEPTION. When you choose to land on a site, it's not a UFO anymore, its a deployment. It has no altitude as a class property, it has depth instead. We already have it and we don't need anything more. What altitude of mission site? Alien base? Why do we need artificially make it if we already have all we need? I really can't understand this.

To me, this altitude think is a very different case in realisation (as I can imagine it) and can be handled separately. I can't see also how that can really change the situation with space missions. We have both space and moon missions, and they are handled ok (well, it could be done better, but only if we would have not only one globe at a time :o :-X )

UPD:
... Even better, it would also simplify things like space missions or moon missions where craft that can go to them simply needs to have a high enough or low enough max/min altitude to get there.

How it could ever help? I mean, we already have maxAltitude. What exactly would be easier? Making mission sites that are floating too high? Cant startingConditions help?
Title: Re: Land/Underwater craft setting
Post by: vadracas on April 12, 2020, 10:57:56 pm
To me, it looks like this is a very different story for implementation in code. I mean, what you want with interception is an INTERCEPTION. When you choose to land on a site, it's not a UFO anymore, its a deployment. It has no altitude as a class property, it has depth instead. We already have it and we don't need anything more. What altitude of mission site? Alien base? Why do we need artificially make it if we already have all we need? I really can't understand this.

To me, this altitude think is a very different case in realisation (as I can imagine it) and can be handled separately. I can't see also how that can really change the situation with space missions. We have both space and moon missions, and they are handled ok (well, it could be done better, but only if we would have not only one globe at a time :o :-X )

UPD:
How it could ever help? I mean, we already have maxAltitude. What exactly would be easier? Making mission sites that are floating too high? Cant startingConditions help?



I apologize. My thought was, as stated here:
P.S. I think this is a more effective all-round solution, but would probably be more difficult to implement.
If code was majorly reworked, where every deployment was given a set of properties similar to a UFO's, then things like aerial boardings, space missions, and underwater missions would be made much simpler in my opinion. My intent was to provide another option, as this discussion has gone on for a while without any decision being made.
Title: Re: Land/Underwater craft setting
Post by: Yankes on April 12, 2020, 11:40:35 pm
Understandable, XCF is your mod. However, enabling general hybrid features for modding is for all modders, not just XCF. I am pushing an agenda that is useful for all modders into hybrid modding, not just for XCF alone. I am sure Meridian will want this important feature available in general for all mods instead for some specialize feature for just XCF alone. Beside, I asked for this feature before XCF is transforming into a Hybrid mod.

Also this tread is not a private tread in the XCF section of the forum but a general section.

Lastly, It is the Dev decision from now on how it is done. I have done what I wanted in pointing out the general need out weight specialization for just one mod.
Could you stop using argument "for all modders"?
This is for one who will implement this or accept it to OXCE to decide, not you. Because you only try push your pet feature. And doing this you try add more "credibility" to your claims. If you repeat multiple of time it make worthless and from developer perspective should be ignored.

beside this, I had same idea.

long time ago I think about how to make more generic way to handle both underwater and over water crafts. And one conclusion is add negative altitudes.
In this way we could easy split all crafts into two layers and allow easy transition between them, this will not allow direct import TFTD rules to UFO but after inversion then we could merge them, as side bonus we could expand this logic to allow more realistic underwater crash sites as you can't case submarine but when it crash you can attack but it should land on deeper part than it dive.

This mean we would need define negative altitude to each under water terrain, it would limit max negative altitude of submarine and its crash site (on shore edges you can attack ANY USO, but on depths you can't clear any crash site even if it was UFO).
By default each terrain have altitude of 0 but "water" by default have -1.

Probably hardest question is how handle USO, as game logic is too dumb to handle different terrain types to correctly find path, and it would need always allow them "hover" over terrains, xcom could have "hard" limit but it would cost lot of pain for paler to manually finding paths, and if USO "hover" then you would need normal crafts to shoot it down.
Title: Re: Land/Underwater craft setting
Post by: Finnik on April 13, 2020, 01:42:13 am
The most stupid thing in TFTD to me was that if USOs can fly over land, why can't they fly over water? It's faster, nothing limits them to hover as much time the RNG wants, so its also not about resources. The only explanation that the game engine does not allow that, and its sad to hear such an explanation for full price game, that was realized by a big dev studio.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 13, 2020, 05:14:24 am
Could you stop using argument "for all modders"?
This is for one who will implement this or accept it to OXCE to decide, not you. Because you only try push your pet feature. And doing this you try add more "credibility" to your claims. If you repeat multiple of time it make worthless and from developer perspective should be ignored.

I don’t take credibility to any claims or this is my pet features. All I care is UFO to mimic TFTD underwater interception mechanics. Nothing more or less. If there’s another way to do it, so be it. I don’t ask for this only for my mod but for all mods. This distinction need to be made.
Title: Re: Land/Underwater craft setting
Post by: Bobit on April 13, 2020, 06:10:16 am
Apollyon not everyone will prefer your solution, don't assume all modders prefer your way, that's just silly. You can say you think your solution is more robust and clean, sure, but everyone agrees? Nah. I do think it's the most ideal solution as you and Yankes say to just have depth be actual negative altitude, but it seems more difficult to implement than a more "hacky" fix where you just fix this one specific problem. I feel I made the same mistake of pushing my pet feature.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 13, 2020, 08:30:16 am
Apollyon not everyone will prefer your solution, don't assume all modders prefer your way, that's just silly. You can say you think your solution is more robust and clean, sure, but everyone agrees? Nah. I do think it's the most ideal solution as you and Yankes say to just have depth be actual negative altitude, but it seems more difficult to implement than a more "hacky" fix where you just fix this one specific problem. I feel I made the same mistake of pushing my pet feature.

Bobit, you need to read what I wrote in the last post carefully, I said best way to mimic TFTD interception mechanics, if there is another way to do it, so be it.
Title: Re: Land/Underwater craft setting
Post by: Meridian on April 13, 2020, 10:09:31 am
More features for hybrid mods are coming.
Slowly.

But since all of them came as "I just need this small hack for my hybrid mod to be complete and I won't ever need anything else"... you can imagine how incompatible and non-robust they are.

So prepare for breaking changes.
Lots of breaking changes.
(breaking current hybrid mods, not other mods)
Title: Re: Land/Underwater craft setting
Post by: Solarius Scorch on April 13, 2020, 11:18:04 am
I'm sure it will be fine. I have confidence in your judgment.
Title: Re: Land/Underwater craft setting
Post by: wcho035 on April 13, 2020, 11:18:53 am
Hi Meridian,

Do you have a list of changes in mind? So I can change my current production schedule of what to proceed and what not in my current Hybrid mod production.