Author Topic: [DONE][Suggestion] Rate of rearmament of air defense systems at the player's base  (Read 2280 times)

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
I would like to propose an upgraded algorithm for the air defense systems at the player's base.
For example, suppose there is a simultaneous attack on the player's base by multiple alien missiles (see this topic for a description of this mechanic) - on the geoscape it will look like many UFOs flying to the player's base, which will arrive at the base almost simultaneously. Since in the real world the amount of ammunition in air defense systems is limited, air defense systems can only fire a limited number of shots. And if the number of targets exceeds the number of ammo in the air defense system, the latter targets are guaranteed not to be shot down.

The current air defense algorithm in the game does not take this feature into account: every time an attack is made on the player's base (when the screen of reflection of the attack on the player's base is shown), each air defense system has a full ammo supply, which is instantly reloaded between attacks. Of course, using the "ammoItem" and "ammoNeeded" parameters (see this topic) brings a bit of realism, but still does not take into account the reload speed of air defense systems.

I suggest adding the following parameters for the base modules (similar to the "craftWeapons" parameters):
ammoMax - the maximum amount of ammo that can be loaded into this air defense system. According to the "ammoNeeded" parameter, this parameter can indicate either the amount of ammunition required to operate the air defense system, or the number of shots. For example, with "ammoNeeded: 5" and "ammoMax: 15", in the first case it will mean that the air defense system will be able to fire 15/5=3 shots until the ammo is fully discharged, or in the second case - 15 shots (each of which requires 5 ammo).
rearmRate - how much ammunition will be loaded into this air defense system per game hour. If possible, it is better to make this parameter to describe the amount of ammunition loaded during a game minute.

In addition to the technical implementation of the new algorithm, I think it will be a big problem to display information about the presence or absence of ammunition for each air defense system on the base. At the moment I think it will be enough to display this information in text form on top of the picture of the air defense module on the base screen.

In the attached image, the text "-/-" means that this air defense module has infinite ammunition and does not require rearming (as it works now).
« Last Edit: January 11, 2024, 03:09:17 pm by Kozinsky »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
More micromanagement :(

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
More micromanagement :(
Micromanagement will only happen when the mod developer specifies the "ammoItem" parameter. Otherwise, ammo is an abstract non-existent item (similar to conventional fuel for the player's initial aircrafts) and is loaded automatically as the air defense system's ammo is emptied without any player involvement.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
It's still effectively (more) micromanagement.

If the ammo is limited and has reload time:
1/ you need to be aware of it
2/ you need to learn what's the worst situation you can (safely) handle
3/ if you don't have the safe minimum, you need to man your base and manage everything around it

I'm not here to criticize, you can put as much fluff into your game as you like... but ask yourself, at least once, a question: "Does this feature bring anything to the gameplay?"
(if you think yes, then by all means go for it)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Done.

https://github.com/MeridianOXC/OpenXcom/commit/1ade2a5fec5f45d558566756213db072c1630ee1
https://github.com/MeridianOXC/OpenXcom/commit/8807360cd3477c78222d3c72989f9025126efa9e

Sample ruleset:

Code: [Select]
facilities:
  - type: STR_MISSILE_DEFENSES
    ammoMax: 12                         # default 0 = disabled
    rearmRate: 3                        # default 1, per hour
    ammoNeeded: 2                       # default 1, per shot
    ammoItem: STR_AVALANCHE_MISSILES    # default empty

Less obvious stuff:
- fixed old issue where missing didn't spend any ammo
- dismantling/downgrading/upgrading a facility returns ammo from that facility
- grand total in base stores counts these items (they don't take up any space in stores)
- starting base can have full ammo loaded (modder's decision), but if you build a facility it always starts with no ammo and has to rearm
« Last Edit: January 12, 2024, 08:50:49 pm by Meridian »

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Done.
Wow! That was really fast! :o
Thank you so much! :)

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
What should I configure so that the displayed ammo count text is multicolored? I have only white color in all variants.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
What should I configure so that the displayed ammo count text is multicolored? I have only white color in all variants.

I guess you have not upgraded OXCE correctly.

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
I guess you have not upgraded OXCE correctly.
Just downloaded the latest version of the nightly build "Extended-7.11.1-fdcd1a075-2024-01-14-win32.7z" to check - same situation: only white color.
On another computer with 64-bit support I downloaded the January 14 or 13 version a few days ago - same problem there.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Just downloaded the latest version of the nightly build "Extended-7.11.1-fdcd1a075-2024-01-14-win32.7z" to check - same situation: only white color.
On another computer with 64-bit support I downloaded the January 14 or 13 version a few days ago - same problem there.

Can you link the mods you're using?

And a save file?

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Can you link the mods you're using?

And a save file?
For this save-file: only XCF 3.2 and my submod.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Works fine for me.

Please check again you are upgrading correctly, especially file /standard/xcom1/interfaces.rul

Online Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Works fine for me.

Please check again you are upgrading correctly, especially file /standard/xcom1/interfaces.rul
It's very strange. A full reinstall of the entire game helped. Maybe the old game used the file "/standard/xcom1/interfaces.rul" from some other place.
Thanks for the help! I'll look into what the problem was.

Edit: found what the problem was: I created archives of "standard" and "common" folders in the game folder a long time ago. Deleting them solved the problem.

Edit2: these archives of "standard" and "common" folders are created automatically when OXCE is updated from the main menu.
Is it possible to forbid the game to read data from these archives? Or change their name?
« Last Edit: January 19, 2024, 02:25:29 pm by Kozinsky »