Forged Alliance Forever Forged Alliance Forever Forums 2017-07-02T20:47:05+02:00 /feed.php?f=41&t=14827 2017-07-02T20:47:05+02:00 2017-07-02T20:47:05+02:00 /viewtopic.php?t=14827&p=151573#p151573 <![CDATA[Re: Rear or flank attacks]]>
For the test, i did -25% front damages, + 15% sides damages, +25% rear damages.
There a little random function.

object

Statistics: Posted by Franck83 — 02 Jul 2017, 20:47


]]>
2017-07-02T13:17:56+02:00 2017-07-02T13:17:56+02:00 /viewtopic.php?t=14827&p=151561#p151561 <![CDATA[Re: Rear or flank attacks]]>

EcoNoob wrote:That mod looks very interesting though, what are ya making? :D

BattleTech? :P


don't know battle tech, maybe there are some similitaries :) ?

I take a look at battle tech, and right, you can control upgrades with slots...

In battle tech you control 1 unit, but with forged alliance, you can do it for all units ;) !

Statistics: Posted by Franck83 — 02 Jul 2017, 13:17


]]>
2017-07-02T13:35:05+02:00 2017-07-02T13:16:39+02:00 /viewtopic.php?t=14827&p=151560#p151560 <![CDATA[Re: Rear or flank attacks]]>

There might be some problems with the targeting system then as not all units 'aimpoint' is at the center of mass, it is the head for some units, top or bottom floor for some buildings, etc.
This isn't a problem if you don't have too many units ofc. You can just mod that but if you have to mod it for every unit, it's a pain


The option i tried to do is to calculate the middle x, y, z of the collision box (il may be circle collision in some cases). Since i got the projectile coordonates at the impact, it seems possible to locate impact without editing any unit. You can call the collision box coordonates at any time in the sim side. That's very cool, but i got some incoherent results. May be i will try again later. But i fell stucked at this time.



That mod looks very interesting though, what are ya making? :D


Said simple, it allows upgrading, training and promoting for any kind of unit in the game. You want to protect and level up your little tech 1 bot ? It s possible, not easy, but with time, micro and mass you can. Choosing class grants skills. Skills grants powers (in current dev). Powers and skills can be trained at the player choice.
So you can craft any kind of unit you want. for example, you can make some tech 3 bot with anti experimental armor capabilities. A specialized unit is stronger against some and weaker against others. Or you can get high dodging aircrafts or high damage bombers. You can train your eegineers for combat, building or large passive repairing.

For now, the mod is working fine with some mechanics and some formulas (defense rating (chance to negate damage), attack rating (chance to hit), building skill...

It take me more 1 year and a half and 3 complete reboot coding to find the right flexible architecture. Now any upgrade, any power is a callback script file that can be coded for any kind of result. You can create a armor that grants % damage converting in energy without touching the mod engine. So it's very easy to long term mod maintenance.

There is some work to do, i'm not focused on upgrades or balancing now, but i'm trying to integrate any kind of cool game mechanic possible.

Theses are screenshots from the mod.

Image

Image

Image

Image

Statistics: Posted by Franck83 — 02 Jul 2017, 13:16


]]>
2017-07-02T12:28:12+02:00 2017-07-02T12:28:12+02:00 /viewtopic.php?t=14827&p=151554#p151554 <![CDATA[Re: Rear or flank attacks]]>
Franck83 wrote:
You're right. we can do front / right / side parts of the armor. It is a less good but still good solution.

On the other side, i would like better damage localization accuracy. That's why i'm trying to go deeper in searching. This open solutions.
For example, some functions like Entity:GetCollisionExtents() give us the mini / maxi collision box. It will be cool to be able to know where the unit is hit : head, chest, arm, rear...
I'm ok with projectile impact coord but i didn't succeed in localizing the damage impact on the unit by using collision system. So i'm using a unit/projectile direction system.

This features can bring us very cool epic game mechanics. Imagine we can add head, arm, legs, chest armor parts to bots. This may open fantastic micro solutions during battles.

There might be some problems with the targeting system then as not all units 'aimpoint' is at the center of mass, it is the head for some units, top or bottom floor for some buildings, etc.
This isn't a problem if you don't have too many units ofc. You can just mod that but if you have to mod it for every unit, it's a pain.

EcoNoob wrote:
That mod looks very interesting though, what are ya making? :D

BattleTech? :P

biass wrote:
Make a reverse move 1st ;)

Hmph, clearly a false believer, repent and experience enlightenment with the glorious Aurora, always facing it's opponent head on as the righteous knight of our faith!

No really though, we shouldn't get a reverse move, we should have unit AI that always retreats with the front facing the enemy as long as there's an enemy in scanning range or you give a move order close enough.

Statistics: Posted by JoonasTo — 02 Jul 2017, 12:28


]]>
2017-07-02T11:33:00+02:00 2017-07-02T11:33:00+02:00 /viewtopic.php?t=14827&p=151552#p151552 <![CDATA[Re: Rear or flank attacks]]>

Statistics: Posted by EcoNoob — 02 Jul 2017, 11:33


]]>
2017-07-02T10:19:44+02:00 2017-07-02T10:19:44+02:00 /viewtopic.php?t=14827&p=151551#p151551 <![CDATA[Re: Rear or flank attacks]]>

Statistics: Posted by biass — 02 Jul 2017, 10:19


]]>
2017-07-02T10:11:04+02:00 2017-07-02T10:11:04+02:00 /viewtopic.php?t=14827&p=151550#p151550 <![CDATA[Re: Rear or flank attacks]]>
RocketRooster wrote:
The trigonometric functions operate using degrees and not radians? Interesting. I suppose it allows the use of lookup tables for speed.


There is a conversion from radian

Code:
math.floor(a * (180 / math.pi) + 0.5) + 180

Statistics: Posted by Franck83 — 02 Jul 2017, 10:11


]]>
2017-07-02T10:03:42+02:00 2017-07-02T10:03:42+02:00 /viewtopic.php?t=14827&p=151549#p151549 <![CDATA[Re: Rear or flank attacks]]> Statistics: Posted by RocketRooster — 02 Jul 2017, 10:03


]]>
2017-07-02T09:57:45+02:00 2017-07-02T09:57:45+02:00 /viewtopic.php?t=14827&p=151548#p151548 <![CDATA[Re: Rear or flank attacks]]>
On the other side, i would like better damage localization accuracy. That's why i'm trying to go deeper in searching. This open solutions.
For example, some functions like Entity:GetCollisionExtents() give us the mini / maxi collision box. It will be cool to be able to know where the unit is hit : head, chest, arm, rear...
I'm ok with projectile impact coord but i didn't succeed in localizing the damage impact on the unit by using collision system. So i'm using a unit/projectile direction system.

This features can bring us very cool epic game mechanics. Imagine we can add head, arm, legs, chest armor parts to bots. This may open fantastic micro solutions during battles.

Image

Statistics: Posted by Franck83 — 02 Jul 2017, 09:57


]]>
2017-07-02T01:09:03+02:00 2017-07-02T01:09:03+02:00 /viewtopic.php?t=14827&p=151544#p151544 <![CDATA[Re: Rear or flank attacks]]>
Also, aside from the extreme 0,90,180 degree angle cases the projectile can always hit two(three if you count the top and bottom) sides of the unit. Even a projectile coming in at a 5 degree angle, could hit one side or the rear. Similarly one at 185 degrees could hit the other side or the front.

Of course those would be glancing blows in most cases, so utilising that information could be interesting indeed...

Statistics: Posted by JoonasTo — 02 Jul 2017, 01:09


]]>
2017-07-01T21:26:31+02:00 2017-07-01T21:26:31+02:00 /viewtopic.php?t=14827&p=151541#p151541 <![CDATA[Rear or flank attacks]]>

I would like to do different damage amount depending off the target impact area (front, rear, left, right of the unit). This can add very cool game mechanisms ;) (strenghening parts of the armor, bonus when flank or rear attacks, projectile dispersion at some angles...)

I tried several solutions but one is partialy fonctional.


The following code detects the projectile orientation and the target orientation at the impact. It calculates the difference between the two.

If the difference is near to 0, the unit and the projectile are sharing the same direction. It means that the projectile hit the target from rear.
When the difference is near 180°, it means that the projectile hit the target from front.

But, when the target is hit from flank, i got near switching 90° or 270° random results. So i don't know if the projectile hit from left or right flank.

My skills in mathematics are not good enough to correct my code. Is somebody is enough skilled in math to help me :!: ?


Code:
local oldprojectile = Projectile
Projectile = Class(oldprojectile) {
   
   oldOnImpact = Projectile.OnImpact,
   OnImpact = function(self, targetType, targetEntity)
      if targetEntity and self then
         local qx, qy, qz, qw = unpack(targetEntity:GetOrientation())
         local a = math.atan2(2.0*(qx*qz + qw*qy), qw*qw + qx*qx - qz*qz - qy*qy)
         local current_yaw = math.floor(a * (180 / math.pi) + 0.5) + 180
         -- LOG('Target orientation : '..current_yaw)
            
         qx, qy, qz, qw = unpack(self:GetOrientation())
         a = math.atan2(2.0*(qx*qz + qw*qy), qw*qw + qx*qx - qz*qz - qy*qy)
         current_yaw2 = math.floor(a * (180 / math.pi) + 0.5) + 180
         -- LOG('Projectile orientation : '..current_yaw2)   
            
         LOG('Difference : '..math.abs(current_yaw2 - current_yaw))   
      end
      Projectile.oldOnImpact(self, targetType, targetEntity)
   end,
}

Statistics: Posted by Franck83 — 01 Jul 2017, 21:26


]]>