aliens

Author Topic: [DONE][Suggestion] Missile-crafts  (Read 440 times)

Offline Flaubert

  • Captain
  • ***
  • Posts: 52
    • View Profile
[DONE][Suggestion] Missile-crafts
« on: December 14, 2024, 01:43:23 pm »
Hello,
  I've schemed&coded an idea to create "missile" crafts. It adds the capability of defining a new "missile type" for crafts, so crafts will behave as if they were missiles/kamikaze-drones. So, when Dogfight windows opens, you won't be able to interact with missile-craft controls (select distance, stand-off,...): it will automatically active the AGGRESSIVE_DIST approach and try to reach that distance.
Meanwhile, UFO can try to intercept missile, firing at it. If missile-craft reaches AGGRESIVE_DIST it will explode, autodestructing itself and dealing some damage to -or destroying! - the UFO.

In order to define a craft with this feature, you should add a new characteristic (missilePower) to crafts ruleset. Default missilePower value is 0, so craft will not behave as a missile but will act as a normal-vanilla craft. missilePower > 0 will trigger the missile behavior when entering Dogfight; value of missilePower will be the damage inflicted to UFO when/if it reaches AGGRESSIVE_DIST and explodes.

It is advisable to give an avoidBonus to missile-craft definition as it would be fast and also small, hence difficult to hit. You can adjust all other parameters as maxDamage or speed as in any normal/vanilla craft - even bizarre missiles which fire lasers when approaching!! -

Of course, this basic mechanic could be modified: e.g. adjusting missile speed approach or avoidBonus, depending of missile/UFO speed ratios; or give a chance to faster UFOs to avoid missile, even when it reaches AGGRESSIVE_DIST, depending on UFO and missile speeds. These ideas are still under study/development.

I think this feature could be interesting for modders, so they could add drone swarms against incoming UFOs or even a  -very expensive and scarce -"cruiser missile" against that nasty Battleship which is in-route to terrorize a city. And it neither requires many changes nor is "invasive": crafts can continue behaving as in original OXCE just not defining any "missilePower" key in their ruleset.

Here you can find an initial development of this idea: https://github.com/FlaubertNHR/OpenXcomPruebas/tree/oxce-missile.

And an example MOD to  test it: https://github.com/FlaubertNHR/OXCE-Mod-Collection/tree/main/MissileMOD-WIP

Finally a short video testing its operation: https://youtu.be/VwrkdRKpB6s

Hope you find it interesting!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9230
    • View Profile
Re: [Suggestion - DEV] Missile-crafts
« Reply #1 on: December 25, 2024, 02:25:53 pm »
Looks OK to me.

Here you can find an initial development of this idea

What is missing until it's finished?

Does this replace your previous suggestion (self-destruct at will)? https://openxcom.org/forum/index.php?topic=11511.0
Or is it a separate suggestion?

Offline Flaubert

  • Captain
  • ***
  • Posts: 52
    • View Profile
Re: [Suggestion - DEV] Missile-crafts
« Reply #2 on: December 27, 2024, 05:05:05 pm »
Hi!,
 in current state it can be used already,as main characteristics are coded. When I wrote "preliminary", I was thinking about some improvements that could be made, as changing chances to hit missile depending on UFO speed vs missile speed. Other characteristics, as missile toughness against enemy shots, power of explosion, and speed to reach enemy UFO in Geoscape, can be modded at craft ruleset. 

Quote
Does this replace your previous suggestion (self-destruct at will)? https://openxcom.org/forum/index.php?topic=11511.0
Yes. Talking with many players -and some modder- I realized that a "totally controlled self-destruct" had no reason, except to avoid stall situations -as is currently done in OXCE- Why would you self-destroy a craft full of agents and equipment? And if you're using a missile, it's necessary to manually decide when it is activated?
So, current code is simpler; crafts defined as missiles doesn't allow further actions from player when they reach enemy UFO, and just try to approach enemy UFO to explode near it.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9230
    • View Profile
Re: [DONE][Suggestion] Missile-crafts
« Reply #3 on: January 11, 2025, 12:19:51 pm »
Merged.

https://github.com/MeridianOXC/OpenXcom/commit/8a04edeb4f222a3a04fc8b43c1c38f3fa2731607

Sample ruleset:

Code: [Select]
crafts:
  - type: STR_INTERCEPTOR
    missilePower: 200
« Last Edit: January 11, 2025, 12:24:08 pm by Meridian »

Offline Flaubert

  • Captain
  • ***
  • Posts: 52
    • View Profile
Re: [DONE][Suggestion] Missile-crafts
« Reply #4 on: January 11, 2025, 03:29:03 pm »
Merged.

https://github.com/MeridianOXC/OpenXcom/commit/8a04edeb4f222a3a04fc8b43c1c38f3fa2731607

Sample ruleset:

Code: [Select]
crafts:
  - type: STR_INTERCEPTOR
    missilePower: 200

Wonderful, thanks!!