OpenXcom Forum

OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Delian on March 09, 2025, 11:54:24 am

Title: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Delian on March 09, 2025, 11:54:24 am
In the original game, it was only Battleships which would attack your base, and the player would always get to see the battleship as it approached the base, so the player would know who was attacking them. However, in modded games, attacks can be instant, done with any ufo, and the player doesn't get to see this crucial info when making a decision of whether to try to shoot down the craft or just let them attack.

I suggest that, when the base defense screen is shown, the player should be shown the name of the enemy ufo and, if Hyperwave Decoder is present, the alien race as well.

The logic behind it is that, even if it's a surprise attack, if the player has enough time to choose between shooting or letting them enter, then they should also have enough time to get a glance at who's attacking the base before making that decision.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 09, 2025, 12:13:22 pm
Why the name tho?
Standard radar shows only the size.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 09, 2025, 12:14:33 pm
Oh, right. Then just the size is fine I guess. And Name+Race if Hyperwave Decoder is present.

What about the dogfight image? You can see that image in any dogfight, so perhaps it would make sense to see it at base defense as well.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 09, 2025, 12:51:53 pm
What about the dogfight image? You can see that image in any dogfight, so perhaps it would make sense to see it at base defense as well.

geoscape and basescape palettes are too different, we'd need to duplicate the images
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 09, 2025, 01:56:55 pm
Hmm. I could write an image/palette converter, so duplicating images wouldn't be needed.

Or, have that screen use a geoscape palette instead.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 23, 2025, 03:55:29 pm
And Name+Race if Hyperwave Decoder is present.

Present in the attacked base?
Or present in other base with enough range?
Or detected already?
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 23, 2025, 04:01:10 pm
If decoder is present in the attacked base, or it was hyper-detected already, show info with 100% chance. But if the decoder is present in a different base and the ufo is not yet detected, then the chance to show info is equal to the detection chance of the HD of the other base.

But even if no decoder is present, I think UFO's image should be shown. I think that's the most important part of this suggestion.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 23, 2025, 04:17:10 pm
And if there is no (even standard) radar present at all and UFO is not detected, show nothing?
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 23, 2025, 04:23:59 pm
I suppose in that case it would make sense to not show anything. It's your choice how to handle this case.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Ethereal on March 23, 2025, 04:56:56 pm
If the base is attacked, the ship is visually noticed and described. I think everything should be standard and the completeness of information should depend only on the presence, or absence, of a decoder on the attacked base.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Yankes on March 23, 2025, 08:59:56 pm
Hmm. I could write an image/palette converter, so duplicating images wouldn't be needed.

Or, have that screen use a geoscape palette instead.
This could be correct only as stop-gap, you can't covert palette images without loose of information.
Adding that some mods use custom palettes result can't be easy predictable. Modder need create graphic that fit both palettes.
This mean best long term solution is use dedicated graphic that perfect fit used palette.

Then as modders need prepare some graphic, why not allow background graphic to be changed?
It will not have information what exactly attack base but have enough hints what it could be.
Plus this could work as some fluff (image picture of radar screen with some embedded green text with some general info).
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 23, 2025, 09:26:38 pm
The path of least resistance will be modding the UI palette to PAL_GEOSCAPE (via `interface:` ruleset) and optionally enable/disable the additional info (via mod or user option).
Background graphic is also already moddable, right?
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 23, 2025, 09:55:59 pm
This could be correct only as stop-gap, you can't covert palette images without loose of information.

Sure, the auto-converted ufo image can be the backup if the modder doesn't provide a custom ufo image. Altho I wouldn't call it stop-gap, because it doesn't matter if the image isn't pixel perfect. Even if an image was converted to grayscale, I think the quality would be good enough for players to get the idea of what the ufo is.

The path of least resistance will be modding the UI palette to PAL_GEOSCAPE

So you're saying that the BaseDefenseState should be modded to use "palette: PAL_GEOSCAPE"? And then no image conversion is necessary?

Also, a question. I think BaseDefenseState is technically a Geoscape State, but the standard (xcom1) interfaces set its palette to PAL_BASESCAPE. Why wasn't this State a Basescape State from the beginning?
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 23, 2025, 10:16:36 pm
So you're saying that the BaseDefenseState should be modded to use "palette: PAL_GEOSCAPE"? And then no image conversion is necessary?

I didn't try it yet, but I am pretty sure it should work.

Also, a question. I think BaseDefenseState is technically a Geoscape State, but the standard (xcom1) interfaces set its palette to PAL_BASESCAPE. Why wasn't this State a Basescape State from the beginning?

Why do you say it is technically a Geoscape state? Because it is in the Geoscape folder? That's just source file sorting... doesn't technically mean anything.

The state is a Basescape state, because in the OG it was also a Basescape state, no other reason.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Yankes on March 23, 2025, 10:56:37 pm
The path of least resistance will be modding the UI palette to PAL_GEOSCAPE (via `interface:` ruleset) and optionally enable/disable the additional info (via mod or user option).
Background graphic is also already moddable, right?
I mean moddable per ufo, not globally, similar how misson screen change based on alien mission.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Meridian on March 29, 2025, 04:02:08 pm
.
Title: Re: [Suggestion] Show ufo info at base defense
Post by: Delian on March 29, 2025, 04:23:11 pm
Both palettes actually look good lol

Hmm. I think it would be better if the image was on top and the ufo info below. Assuming that it's possible to fit the ufo info on the right half of the screen. If not, then nm.

Also, it would be nice if the image experienced some sort of gfx effect when the ufo is hit (if the player decides to fire).
Title: Re: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Meridian on March 29, 2025, 05:23:01 pm
Done.

https://github.com/MeridianOXC/OpenXcom/commit/f741a9abca8b52f4a8b8e1609164fe802a3d03ea
https://github.com/MeridianOXC/OpenXcom/commit/b04d49bbf42097bc4232b8be250f5ab5dd7a50ce

Activate via global on/off switch `showUfoPreviewInBaseDefense`:

Code: [Select]
showUfoPreviewInBaseDefense: true

You can play with colors and palettes of the screen using interface ruleset `baseDefense_geo`, UFO defaults are:

Code: [Select]
  - type: baseDefense_geo
    backgroundImage: BACK04.SCR
    elements:
      - id: palette
        color: 2     # red/orange
      - id: window
        color: 133   # minty green
      - id: text
        color: 239   # bright green
        color2: 138  # yellow
      - id: button
        color: 133   # minty green

UFO preview is displayed always. Even if there are no radars.

Hyperwave info is displayed only if hyper-detected already. Presence of hyperwave decoder in the base is NOT enough (unless enabled per ufo by `instaHyper`, see below).
Title: Re: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Delian on March 30, 2025, 04:17:51 am
Thanks, altho... that's quite a departure from the original suggestion. Can you elaborate on your choice of different implementation (to have instant retaliations never show hyperwave info)? If Dioxine requested it, then fair enough. But then, what if some other modder wants the player to see the hyperwave info?
Title: Re: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Meridian on March 30, 2025, 07:51:35 am
Thanks, altho... that's quite a departure from the original suggestion. Can you elaborate on your choice of different implementation (to have instant retaliations never show hyperwave info)? If Dioxine requested it, then fair enough. But then, what if some other modder wants the player to see the hyperwave info?

It was my decision, I don't have discussions with modders outside of the forum.

The choice was driven by the nature of instant retaliations.
If these retaliations are so stealthy and/or otherwise undetectable by radar (e.g. ground attack) then it makes sense (to me) that base defense also lacks this info.

If modders would want this info, it can be added... configurable on a ufo by ufo basis:

Code: [Select]
ufos:
  - type: STR_SMALL_SCOUT
    instaHyper: true   # Show extra info during base defense even if the UFO was not yet hyper-detected classically?
Title: Re: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Delian on April 06, 2025, 09:41:36 pm
Ok. The way I see it is, instant retaliations may or may not ignore base defenses. If they ignore them, then they were clearly too stealthy to be detected. But if you get to fire on them with base defenses, it means they were not stealthy enough. They were detected, and that's why you get to shoot at them. But fair enough.
Title: Re: [DONE][Suggestion] Show ufo preview/info at base defense
Post by: Meridian on April 06, 2025, 09:52:30 pm
The way I see it is, instant retaliations may or may not ignore base defenses.

I forgot such option even exists.
If they need to be synched somehow, it can be done.
However, we could waste time here forever and add even more options nobody will ever use.
If a modder is interested, let them say what they need.

But if you get to fire on them with base defenses, it means they were not stealthy enough. They were detected, and that's why you get to shoot at them.

Maybe they were not detected by a radar (or hyperradar), but by plain old eyesight?
Dunno.