Author Topic: Alternative way to display armor-stats in UfoPedia  (Read 1120 times)

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #15 on: December 13, 2023, 10:18:31 pm »
Since this is a non-standard GUI change I would recommend a .rul flag to enable this so that the mod developer or by default this feature is not enabled and explicitly enabled per *.rul file for globally through advanced settings.

Sorry for confusion. There are actually two things there.

The UI change in the code itself is just an addition to what was already there. This alone won't change look and feel for users.

The actual set of articles with alien armor is what needs to be added to ruleset.

One reason is that I think that X-Com Files already provides all the battle and armor stats for enemies and NPCs once researched, but as separate UFOPedia pages.  I would find it real annoying to have the info duplicated on multiple pages from ones that X-Com Files provides and on the Enemy's main graphic page.

Agree. Some ruleset modders may already implement it as article pages. That is why I am asking if this should be in core ruleset. I am fine with any way it goes.

Also, although this is a neat idea, how do you address what Meridian' pointed out about an enemy that can have multiple armor's or stats?

I am just listing actual ARMORS articles for each of them, how many they are. I also assign a title to the article related to which lowest rank this armor is usually encountered in. I think this is intuitive enough but open for suggestions.

« Last Edit: December 13, 2023, 10:25:14 pm by Alpha Centauri Bear »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #16 on: December 13, 2023, 10:28:14 pm »
Omg, did any of you even try it?

@Alpha: modders will sure notice it, you made it incompatible with OXCE (and their mods, e.g. TWoTS)

@0xebjc: XCF will be unaffected, he changed only TFTD-style armor articles

@juku: it's on by default and there is no "extra variable"

@alpha again: users will also definitely notice the look and feel change... I did... just compare before and after picture attached

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #17 on: December 13, 2023, 10:28:35 pm »
As I understand, this is just a capability right now, so 'off' by default. Thus an extra variable to enable things that needs to be implemented separately to work at all will do nothing but sow confusion. And AC Bear is asking if a ruleset mod should be added on top.
No enemy can have multiple armours or stats. One enemy race can have different ranks with different armours/stats. And that's exactly what AC Bear's change handles in the screenshots by having separate articles for Aquatoid Navigators, Commanders etc.

That is correct.

So reiterating once again. The change in the code I just pushed change UI in a minor way. I will put it under the flag to be off by default.

Yes, I am listing armor-rank for each race. Sure multiple ranks may have same armor but I think it is intuitive enough that lowest rank wearing such armor is shown. Of course, all ranks can be shown but this would be super duplication of info.
« Last Edit: December 13, 2023, 10:32:14 pm by Alpha Centauri Bear »

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #18 on: December 13, 2023, 10:31:16 pm »
@alpha again: users will also definitely notice the look and feel change... I did... just compare before and after picture attached

Yep. You are right. Will put it under the flag.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #19 on: December 13, 2023, 10:38:50 pm »
Yep. You are right. Will put it under the flag.

Don't forget to show all 20 OXCE resistances in the compatibility mode, many mods are using them and you are ignoring half of them (e.g. LASER damage type in TWoTS from my example above).

In the non-compatibility mode, I'd recommend at least adding support for translations, instead of hardcoded English texts.

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 178
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: Alternative way to display armor-stats in UfoPedia
« Reply #20 on: December 13, 2023, 10:54:26 pm »
..., did any of you even try it?

@0xebjc: XCF will be unaffected, he changed only TFTD-style armor articles

Sorry for the confusion on my part... I did not try it and was just following the form conversations from here

And which armor would you show for let's say Lobsterman autopsy?

There are several of them.
Do you take one at random?

I missed the following:

Another option is to list multiple armors with their names: (soldier, technician, etc.). Will be a long list.

I do think this is a elegant solution to label each enemy type, soldier, engineer, etc. based off their different stats and or ranges.


@Alpha: modders will sure notice it, you made it incompatible with OXCE (and their mods, e.g. TWoTS)

I haven't played TWoTS yet, I'll have to look at what breaking changes this make to other mods, previously I've appreciated that BRUTAL has been backwards compatible with OXCE mods.



Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #21 on: December 13, 2023, 11:41:32 pm »
Don't forget to show all 20 OXCE resistances in the compatibility mode, many mods are using them and you are ignoring half of them (e.g. LASER damage type in TWoTS from my example above).

In the non-compatibility mode, I'd recommend at least adding support for translations, instead of hardcoded English texts.

Definitely. What's the translation support? Just the tr(label) method?

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #22 on: December 13, 2023, 11:48:48 pm »
@Meridian

I see you are introducing some elements into TFTD article definition but not in the base class. Should I follow the same pattern and modify TFTD only?

Code: [Select]
void ArticleDefinitionTFTD::load(const YAML::Node &node, int listOrder)
{
ArticleDefinition::load(node, listOrder);
_type_id = (UfopaediaTypeId)(node["type_id"].as<int>(_type_id));
image_id = node["image_id"].as<std::string>(image_id);
if (image_id.find("_CPAL") != std::string::npos)
customPalette = true;
text_width = node["text_width"].as<int>(157); // 95% of these won't need to be defined, so let's give it a default
weapon = node["weapon"].as<std::string>(weapon);
}

Offline Juku121

  • Commander
  • *****
  • Posts: 1621
  • We're all mad here.
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #23 on: December 14, 2023, 07:34:57 am »
Erm, if this is essentially just a new layout for TFTD-style armour articles - especially one that needs some extra work to regain other functionality like expanded damage types and multiple languages -, what exactly is the point of it? What does it do that a TFTD armour article does not? I thought perhaps it was the automatic resistance values, but this does not seem to be the case.

@juku: it's on by default and there is no "extra variable"
I meant it's 'off' in the sense that the game does not auto-populate the pedia with these, someone has to go and make the articles and until they do, this feature does nothing. Besides existing TFTD-style stuff, that is, but X-Com armours were never the point of this feature.

My brief spiel was supposed to say an extra variable is undesirable because of the above, but if this is indeed an alternate form of TFTD armours and not its own thing then, yes, a separate flag would be better.
« Last Edit: December 14, 2023, 07:36:32 am by Juku121 »

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #24 on: December 14, 2023, 02:56:49 pm »
Here you go.
https://github.com/Xilmi/OpenXcom/pull/20

Minimal changes.
Existing code is preserved.
New style is off by default.
Turned on by "custom: 1" field in the interface list.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #25 on: December 14, 2023, 03:06:57 pm »
Erm, if this is essentially just a new layout for TFTD-style armour articles - especially one that needs some extra work to regain other functionality like expanded damage types and multiple languages -, what exactly is the point of it? What does it do that a TFTD armour article does not? I thought perhaps it was the automatic resistance values, but this does not seem to be the case.

You are right that this is not a new business functionality. Just a different style of the armor article.

Here is why I think it is needed.
Current armor articles (personal armor, tanks) have info in them regarding the title item itself as it is researchable.
Alien rank armor articles do not as they are just pure armor stats informational thing not adding any more information about aliens themselves.
With this in mind, I would like to utilize whole page real estate to display as much list lines as possible.

Another (pure cosmetic changes) are:

Numbers are right aligned across whole list lines, which makes it look neat, I believe. In fact, I am quite surprised why they are not right aligned in other lists when this functionality already in the code?

Scrollbar is visible inside of the page. Currently it is not possible for user to know that there are more lines in the list just by looking at it.
IMHO user should be presented with scrollbar when it is needed and be able to scroll the article by clicking on scrollbar. I believe UI functionality and user convenience is above clean look. Besides, scrollbar design is pretty neat. I don't understand why it need to be hidden.

Offline Alpha Centauri Bear

  • Colonel
  • ****
  • Posts: 466
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #26 on: December 16, 2023, 07:19:39 pm »
Example of left and right aligned numbers in list.
« Last Edit: December 16, 2023, 07:21:15 pm by Alpha Centauri Bear »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: Alternative way to display armor-stats in UfoPedia
« Reply #27 on: December 17, 2023, 02:43:31 pm »
this discussion was split out into its separate thread