Author Topic: Blast radius calculations in OXCE  (Read 1375 times)

Offline zee_ra

  • Colonel
  • ****
  • Posts: 213
    • View Profile
Blast radius calculations in OXCE
« on: November 18, 2023, 01:34:45 am »
I would like to start using dynamic radius more widely in a mod that I am working on.  I would like to inquire, how is the dynamic blast radius calculated as a function of damage power?  Would it be possible to post a table of this somewhere on the wiki?  The table is going to be much more useful than a direct formula.

The forum search reveals little w.r.t. this issue.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Blast radius calculations in OXCE
« Reply #1 on: November 18, 2023, 03:02:52 am »
Best is simply show code how its done:
Code: [Select]

int radius = 0;

if (_damageType.FixRadius == -1)
{
radius = getPowerBonus(attack) * _damageType.RadiusEffectiveness;
if (_damageType.FireBlastCalc)
{
radius += 1;
}
// cap the formula to 11
if (radius > 11)
{
radius = 11;
}
if (radius <= 0)
{
radius = 1;
}
}
else
{
// unless a blast radius is actually defined.
radius = _damageType.FixRadius;
}

return radius;


Offline zee_ra

  • Colonel
  • ****
  • Posts: 213
    • View Profile
Re: Blast radius calculations in OXCE
« Reply #2 on: December 05, 2023, 04:38:55 am »
Best is simply show code how its done:
Code: [Select]

int radius = 0;

if (_damageType.FixRadius == -1)
{
radius = getPowerBonus(attack) * _damageType.RadiusEffectiveness;
if (_damageType.FireBlastCalc)
{
radius += 1;
}
// cap the formula to 11
if (radius > 11)
{
radius = 11;
}
if (radius <= 0)
{
radius = 1;
}
}
else
{
// unless a blast radius is actually defined.
radius = _damageType.FixRadius;
}

return radius;


So, basically, setting up a FixRadius to 19 results in the largest possible blast radius in the game?

Sometimes, the animations (e.g. with Mummy Matriarchs) gives me an impression that the blast radius is much larger than mere 11 cells.


Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Blast radius calculations in OXCE
« Reply #3 on: December 05, 2023, 11:30:38 am »
Yes, if you set fixed you probably can make explosion on whole map, some XPZ weapons do this.
If it use calculated radius then it caped on 11, check rulesets what case this weapon use.

Offline zee_ra

  • Colonel
  • ****
  • Posts: 213
    • View Profile
Re: Blast radius calculations in OXCE
« Reply #4 on: December 06, 2023, 12:36:53 pm »
Yes, if you set fixed you probably can make explosion on whole map, some XPZ weapons do this.
If it use calculated radius then it caped on 11, check rulesets what case this weapon use.

Thank you for clarifying this.

I'm curious, if it is indeed possible to have a blast that covers the entire map?  Also, is it possible to have the blast go through walls freely?  The scenario I'm thinking about is e.g. a badass mummy matriarch creating an ultra-powerful blast.