Page 1 of 3

Fast lasers

Posted: 2013-09-11 13:10
by Mats391
I managed to speed up the laser projectile with out it jumping off the target (or atleast not more than it does currently)
Video:
[XFIRE]6100ac[/XFIRE]
My projectile flys at 1450+ m/s where as the current one only at 250m/s.
Changed Code:

Code: Select all

rem For weapon:
ObjectTemplate.projectileTemplate simrad_Projectile
ObjectTemplate.keepProjectiles 15
ObjectTemplate.velocity 1450
ObjectTemplate.itemIndex 7
ObjectTemplate.delayToUse 1.5

rem for projectile:
ObjectTemplate.create GenericProjectile simrad_Projectile
ObjectTemplate.createNotInGrid 1
ObjectTemplate.setNetworkableInfo BasicInfo
rem ---BeginComp:StickyCollisionComp ---
ObjectTemplate.createComponent StickyCollisionComp
ObjectTemplate.collision.bouncing 1
ObjectTemplate.collision.maxStickAngle 360
ObjectTemplate.collision.stickToStaticObjects 1
ObjectTemplate.collision.stickToVehicles 1
ObjectTemplate.collision.stickToTerrain 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
ObjectTemplate.penetrate.allowLiquidPenetration 0
rem ---EndComp ---
ObjectTemplate.mass 9999
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.gravityModifier 1
ObjectTemplate.physicsType RotationalPoint
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 0
ObjectTemplate.acceleration 10
ObjectTemplate.maxSpeed 1500
rem -------------------------------------
ObjectTemplate.addTemplate S_laser_gun_Projectile_Looping
ObjectTemplate.addTemplate LaserTarget_simrad
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/15/0/0
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.localPredictOnClient 1
ObjectTemplate.damage 0
I stumbled across this by accident while trying to make realistic gtld that requires you to keep aim over the target. My approach for that was to have a wireguided projectile that doesnt explode on impact, but it always lost the guiding when it hit the ground. Does someone have an idea how to make it work?

Re: Fast lasers

Posted: 2013-09-11 13:49
by Rudd
was this on a dedicated or local server?

Re: Fast lasers

Posted: 2013-09-11 13:50
by Rhino
looks good, but have you tested it on dedicated?

EDIT: damn ninja

Re: Fast lasers

Posted: 2013-09-11 14:03
by Mats391
[R-DEV]Rudd wrote:was this on a dedicated or local server?
video is from local, but i also tested it successfully on dedicated.
After bit more experimenting it turns out you only need to change the physics type from Point to RotationalPoint and it works for all speeds.
I also made sure the laser actually sticks to the vehicle, but i did not try shooting it onto moving targets.

Re: Fast lasers

Posted: 2013-09-11 14:08
by Rhino
Sounds awesome :D

From what I could tell from watching your video is that it also bounced off the vehicles less than it dose now too which should really help, nice work! :D

Re: Fast lasers

Posted: 2013-09-11 15:17
by Mats391
[R-DEV]Rhino wrote:Sounds awesome :D

From what I could tell from watching your video is that it also bounced off the vehicles less than it dose now too which should really help, nice work! :D
It still trys to jump of but gets put back into place causing it to jitter a bit. Very visible at the first lase, it jumps of and back on. Also sometimes it doesnt stick and i cant find the laser anywhere, i guess in those cases it fly somewhere into the sky.
Anyway from testing on ground, slopes, statics and vehicles it seems to be equal or better than the current system.
I will try it on coop later to see how it reacts to moving targets.

Re: Fast lasers

Posted: 2013-09-11 16:16
by Wheres_my_chili
Mats, you're so cool.

Re: Fast lasers

Posted: 2013-09-11 16:46
by Mats391
Works fine with moving targets. Maybe even too good as i was able to lase a flying chopper :p
[XFIRE]610118[/XFIRE]
This is also from a dedicated server.

Re: Fast lasers

Posted: 2013-09-11 20:03
by Pvt.LHeureux
It's because this is a chopper piloted by a bot, slow as hell :razz:

Re: Fast lasers

Posted: 2013-09-12 07:31
by Mats391
Pvt.LHeureux wrote:It's because this is a chopper piloted by a bot, slow as hell :razz:
the difficulty of hitting mid air choppers is comparable to shooting them with tanks, just that you have way better angle/faster aiming.

since i dont want to see choppers getting bombed out of mid air, i tried fixing this by making the projectile explode when it comes close to an aircraft. I just copied the code from an AA missile and adjusted the damage values, but it doesnt work :(

added detonation comp from stinger missle:

Code: Select all

rem ---BeginComp :D efaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 0
ObjectTemplate.detonation.explosionRadius 0
ObjectTemplate.detonation.explosionForce 0
ObjectTemplate.detonation.explosionDamage 0
ObjectTemplate.detonation.detonateDistanceToTarget 22
rem ObjectTemplate.detonation.endEffectTemplate e_exp_air
ObjectTemplate.detonation.useMMOnEndEffect 1
ObjectTemplate.detonation.detectionRadius 100
ObjectTemplate.detonation.maxDepthForExplosion 2
ObjectTemplate.detonation.triggerRadius 40
ObjectTemplate.detonation.triggerType MTYVehicle
ObjectTemplate.detonation.triggerVictimMinSpeed 10
ObjectTemplate.detonation.radiusDetonateWithAirVehicles 32
rem ---EndComp ---

Re: Fast lasers

Posted: 2013-09-12 11:41
by M42 Zwilling
Why would you want to do that? You know, an F-15E shot down a helicopter with a laser-guided bomb in the Gulf War... :-P

Re: Fast lasers

Posted: 2013-09-13 19:45
by Jafar Ironclad
Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).

Re: Fast lasers

Posted: 2013-09-13 20:07
by Moszeusz6Pl
The problem is, if lase disappear when missile/bomb is already in air, it might lose lock during critical phase and miss target. It need to be enough for CAS to come, launch missile and to missile hit target. If we reduce it, it can cause problems if CAS is called by another squad and all coms goes through FAC, because they will need more time to prepare strike.

Re: Fast lasers

Posted: 2013-09-13 20:09
by Mats391
[R-DEV]Jafar Ironclad wrote:Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).
one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.
Edit: and the gravity modifier should be removed, so even w/o new lase it lands where the last laser was instead of going into the sky.

Re: Fast lasers

Posted: 2013-09-13 20:09
by Celestial1
Is it possible to trigger the destruction of the laze object when the operator leaves the GLTDs (as in, right clicks)?

Re: Fast lasers

Posted: 2013-09-13 20:22
by Jafar Ironclad
Mats391 wrote:one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.
Edit: and the gravity modifier should be removed, so even w/o new lase it lands where the last laser was instead of going into the sky.
I don't see any problems with that. The relock delay might be to prevent wild laze jumps on expiration, but removing grav modifier shouldn't be an issue; its already done on jet AGM's anyway.

Re: Fast lasers

Posted: 2013-09-13 20:39
by chrisweb89
Reducing the lase time to 100 seconds even with these changes would make doing CAS for people not in your squad way more difficult than it already is, and depending on the team getting a lase to stick at the proper time on a target is very difficult for a lot of people.

Re: Fast lasers

Posted: 2013-09-13 20:55
by Mats391
[R-DEV]Jafar Ironclad wrote:I don't see any problems with that. The relock delay might be to prevent wild laze jumps on expiration, but removing grav modifier shouldn't be an issue; its already done on jet AGM's anyway.
then get to it :p
Reducing the lase time to 10 seconds even with these changes would make doing CAS for people not in your squad way more difficult than it already is, and depending on the team getting a lase to stick at the proper time on a target is very difficult for a lot of people.
The only thing that should change is that you keep eyes on the target and relaze when needed. Relasing before the attack so it stays during the attack should no longer be required.

I also found one bug with this, when you hit the target in a very sharp angle (seen from surface) on short distances it wont stick and simply disappear.

Re: Fast lasers

Posted: 2013-09-13 21:40
by Rhino
[quote=""'[R-DEV"]Jafar Ironclad;1949323']Looking like great promise here.

If we can get this to work successfully, I wonder if it'd be worth reducing the lase duration (from GTLD's and maybe chopper optics) to something like 5/10 seconds, so that whatever entity is lasing the target has to continuously re-laze until weapons release (I.E. realism, a little more balance so that entities that know they are being lazed can hide from the spotter and potentially avoid getting airmailed).[/quote]
[R-DEV]Moszeusz6Pl wrote:The problem is, if lase disappear when missile/bomb is already in air, it might lose lock during critical phase and miss target. It need to be enough for CAS to come, launch missile and to missile hit target. If we reduce it, it can cause problems if CAS is called by another squad and all coms goes through FAC, because they will need more time to prepare strike.
The main problem is locking onto the laser in the first place. Like if a jet pops flares when trying to lock on with missiles, if the lock is interrupted by a new target coming closer, the locking timer starts all over again from scratch. The same is true for locking onto ground targets.

This can only change if we make the lock on time 0, or super short, but then you don't need to spend any time trying to get a lock, unless we change the entire way we lock onto ground targets from the air, which might be something to consider.

[quote="Mats391""]one problem with reducing it to much would be that the missile cant lock onto a new lase replacing the old one. I dont know why the relock time is so high (60seconds), but that would have to be reduced alot as well when reducing laser duration.[/quote]

Ye the relock time of an "armed" weapon that's already flying should be made to 0, at least for most Air to Ground weapons but that code might be the lock time for when your trying to lock onto a target, before launch.