Forged Alliance Forever Forged Alliance Forever Forums 2015-01-25T19:32:09+02:00 /feed.php?f=45&t=9295 2015-01-25T19:32:09+02:00 2015-01-25T19:32:09+02:00 /viewtopic.php?t=9295&p=92156#p92156 <![CDATA[Re: Directional Damage]]>
ckitching wrote:
I think the important point from Sheeo's post that you may have missed is the performance issue. If you start doing vector calculations in Lua whenever there's a damage event you're going to absolutely obliterate performance.

It's unclear that there is a good solution to this problem available from Lua.


That's just it, you don't... This would be called on as needed. All I am saying is the carry the needed info via the projectile's damage table and later pass it to the unit (s).

Statistics: Posted by Resin_Smoker — 25 Jan 2015, 19:32


]]>
2015-01-25T19:28:52+02:00 2015-01-25T19:28:52+02:00 /viewtopic.php?t=9295&p=92154#p92154 <![CDATA[Re: Directional Damage]]>
Because AFAIK, the engine is in c++ but everything else is done via Lua, could be possible to make another "jump"?

Statistics: Posted by zeroAPM — 25 Jan 2015, 19:28


]]>
2015-01-25T18:43:26+02:00 2015-01-25T18:43:26+02:00 /viewtopic.php?t=9295&p=92148#p92148 <![CDATA[Re: Directional Damage]]>
It's unclear that there is a good solution to this problem available from Lua.

Statistics: Posted by ckitching — 25 Jan 2015, 18:43


]]>
2015-01-25T14:11:35+02:00 2015-01-25T14:11:35+02:00 /viewtopic.php?t=9295&p=92125#p92125 <![CDATA[Re: Directional Damage]]>
Resin

Statistics: Posted by Resin_Smoker — 25 Jan 2015, 14:11


]]>
2015-01-25T12:12:46+02:00 2015-01-25T12:12:46+02:00 /viewtopic.php?t=9295&p=92117#p92117 <![CDATA[Re: Directional Damage]]>
Sheeo wrote:
Resin_Smoker wrote:I've been thinking how to best come up with a functional process for this mod considering how using a projectiles / units vector is far from ideal. Then it hit me...

Location, location, location!


What do you mean using a projectiles / units vector? Of course given the projectile impact position and the unit position, it's trivial to compute the orientation of the impact.

What you need to do is modify projectile#DoDamage to pass the position of the projectile to the various damage functions -- but then you run into the issue that Damage, DamageArea and DamageRing are engine functions, so you need to reimplement those in lua.

This isn't impossible and it would help us alleviate the problems with splash damage as well, but we may run into problems with sim speed, since lua isn't an optimal language for matrix multiplication.

Then again we may potentially just skip some hurdles with the reimplementation and get a fast enough result. We can't really profile it though.



Rotational vector...

However there are ways to express the projectiles impact location to the unit or during the damage area operation. Both require that a table in the unit be used to store the location for later comparison once our unit's damage event is triggered.

As for reimplementation, I'm requesting the following be added to Damage:

    Location (impact)
    Complete damage data spec
    Velocity
    Vector (last known direction of movement and facing)
    Game time of launch / impact
    Launching units ID

With that, anything needed can be created or derived. Keep in mind that I had a method to pass all of this from the launcher to the projectile to the impacted unit via a series of table. This was going to be part of the WOF v0.8 that I was never able to finish.

Resin

Statistics: Posted by Resin_Smoker — 25 Jan 2015, 12:12


]]>
2015-01-24T17:07:40+02:00 2015-01-24T17:07:40+02:00 /viewtopic.php?t=9295&p=92077#p92077 <![CDATA[Re: Directional Damage]]>
Resin_Smoker wrote:
I've been thinking how to best come up with a functional process for this mod considering how using a projectiles / units vector is far from ideal. Then it hit me...

Location, location, location!


What do you mean using a projectiles / units vector? Of course given the projectile impact position and the unit position, it's trivial to compute the orientation of the impact.

What you need to do is modify projectile#DoDamage to pass the position of the projectile to the various damage functions -- but then you run into the issue that Damage, DamageArea and DamageRing are engine functions, so you need to reimplement those in lua.

This isn't impossible and it would help us alleviate the problems with splash damage as well, but we may run into problems with sim speed, since lua isn't an optimal language for matrix multiplication.

Then again we may potentially just skip some hurdles with the reimplementation and get a fast enough result. We can't really profile it though.

Statistics: Posted by Sheeo — 24 Jan 2015, 17:07


]]>
2015-01-24T16:21:00+02:00 2015-01-24T16:21:00+02:00 /viewtopic.php?t=9295&p=92074#p92074 <![CDATA[Re: Directional Damage]]> Statistics: Posted by Resin_Smoker — 24 Jan 2015, 16:21


]]>
2015-01-24T14:52:11+02:00 2015-01-24T14:52:11+02:00 /viewtopic.php?t=9295&p=92067#p92067 <![CDATA[Re: Directional Damage]]> Statistics: Posted by nine2 — 24 Jan 2015, 14:52


]]>
2015-01-24T16:20:29+02:00 2015-01-24T12:11:28+02:00 /viewtopic.php?t=9295&p=92057#p92057 <![CDATA[Directional Damage]]>
Location, location, location!

Use the projectiles point of impact relative to the offset position of the unit.

What the hell does this mean you say?

Obviously we'll use the point of impact of the projectile in comparison to the units position. However the units position should be offset by (a negative) amount of the size of the units hit box. Should the projectile impact within 1/2 the width of the units hitbox we can say that the projectile impacted the rear of the unit.

This process would be very quick and thus only requires major modifications to projectile.lua to ensure that the projectiles point of impact is passed the he unit. The unit would make the determination / comparison via its default units.lua \ OnDamage event.

Best of all this would work with splash damage too!

Reisn

Statistics: Posted by Resin_Smoker — 24 Jan 2015, 12:11


]]>