aliens

Author Topic: Other Ways to Modify Aircraft  (Read 2949 times)

Offline ChainsawAardvark

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Other Ways to Modify Aircraft
« on: December 15, 2014, 09:52:45 pm »
Does the code allow for interceptors that modify variables outside of HP/speed etc? For example, a unit with an improved radar system that lets it fire weapons faster and more accurately. Or a stealth craft that has a better chance to dodge enemy fire when you select aggressive interception mode. Rotary launchers/multiple ejector racks that let the plane carry more ammunition than normal also occurred to me.

On a somewhat related note - can research projects affect these variables. You could have a Top Gun dissimilar air combat training (DACT) program that makes your pilots better. It could either add the bonuses above, or give an extra 10% speed as they hunt the aliens more efficiently.

As a final question, could there be craft with built in special weapons unique to them? An F-89 cleared for the genie air to air nuclear tipped rocket, or swarms of rockets, an F-14 with extra long range Phoenix missiles. (I am aware that we try to avoid real world craft, but these were the first one weapon one plane systems I could think of.)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Other Ways to Modify Aircraft
« Reply #1 on: December 16, 2014, 01:17:44 am »
Yankes' OpenXCom Extended supports weapon slots with restrictions as to what can be fitted in slots of different types. It would be possible to define a plain which is the only one to have slot X, which means it would be the only one able to have Weapon Y that requires an X slot. Similarly, some slots can be devoted to hardware that enhances the stats of the craft.

It is expected that some of the features in OXC Extended might be merged in the main branch once work on TftD is done, until then, you would have to use the alternate build.

Nothing as far as I know supports pilot improvement though.

Online GO-shnick

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Re: Other Ways to Modify Aircraft
« Reply #2 on: Today at 04:01:02 pm »
Hello everyone. I'm new here and also have a question about aircrafts. So, before registering here I have studied a forum for quite a some time, but never found out any useful information, so I decided to ask directly. So here it goes.

It seems that I totally cannot understand the fuel/range formula. How craft's range is calculated? It seems that if we have two crafts with equal fuelMax parameter and craft A have speed of 760 knots and craft B have 2100, the latter will have larger operational range. But what is the exact formula? What other parameters are taken into account during the calculations? It don't helps either that speed is measured in knots and range is given in nautical miles and kilometers.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9365
    • View Profile
Re: Other Ways to Modify Aircraft
« Reply #3 on: Today at 04:08:58 pm »
https://github.com/OpenXcom/OpenXcom/blob/master/src/Savegame/Craft.cpp#L663

Code: [Select]
/**
 * Returns the maximum range the craft can travel
 * from its origin base on its current fuel.
 * @return Range in radians.
 */
double Craft::getBaseRange() const
{
return _fuel / 2.0 / getFuelConsumption(_rules->getMaxSpeed()) * _speedMaxRadian;
}

https://github.com/OpenXcom/OpenXcom/blob/master/src/Savegame/Craft.cpp#L630

Code: [Select]
/**
 * Returns the amount of fuel the craft uses up
 * while it's on the air.
 * @param speed Craft speed for estimation.
 * @return Fuel amount.
 */
int Craft::getFuelConsumption(int speed) const
{
if (!_rules->getRefuelItem().empty())
return 1;
return (int)floor(speed / 100.0);
}