If it flies, it dies™.

Image RSS Feed Latest Screens
Reaching for the stars <3 Scenes from MW Mod 4.2 Scenes from MW Mod 4.2
Blog RSS Feed Report abuse Latest Blog: Command to LOS (CLOS) Guidance Implementation

0 comments by blahdy on Oct 26th, 2013

Implementing the Command to Line of Sight (CLOS) guidance method in World in Conflict (also can be ported to other game environments).

YouTube Video:
Link - Youtube.com


python code:
def GCFLINT_Command_to_LOS( msl_pos, launcher_pos, tgt_pos, latax, cre_data, beam_motion_data ):
  """
    Command to Line of Sight (CLOS) Guidance
   
    msl_pos     = (Vector3) missile's current position
    launcher_pos  = (Vector3) launcher's current position
    tgt_pos     = (Vector3) target's current position
    latax       = (Mutable Vector3) mutable object for providing guidance command
    cre_data    = (Mutable dict) dict object for Kalman estimation states on CRE
    beam_motion_data = (Mutable Vector3) mutable object for recording previous
               beam motion
 
    Command to LOS (CLOS) Guidance or "three point guidance" is probably the
    oldest and the first rudimentary form of missile guidance methods.  
    Tracing its roots back to the Nazi Germany's Wasserfall experimental SAM
    and early forms of anti-shipping guided PGMs, it was originally conceived
    as Manual Command to LOS (MaCLOS or MCLOS), where a human operator
    remotely steered the missile along his visible line of sight toward the
    target.
   
    After the World War, MCLOS was further modified with improvements in
    sensors and analog computing technology, spawning new derivatives such as
    Semi-Automatic Command to LOS (SACLOS), Automatic Command to LOS (ACLOS or
    simply CLOS) and Beamriding Guidance.  In case of SACLOS, the operator has
    to maintain his sight on the target and the guidance computer will
    automatically generate the necessary steering commands to the outgoing
    missile -- a good example of this is BGM-71 TOW missile.  Fully automatic
    CLOS (ACLOS) was used on first generation SAMs (i.e. Talos, Nike Zeus, etc).
    Even to this day, ACLOS is widely popular for cheap short-range AA uses
    (i.e. SA-22 Pantsir/SA-19 Tunguska, Crotale, RBS-70, Roland, etc), because
    the missile is very cheap to manufacture (there is no need for seeker and
    complex embedded electronics).
   
   
   
    CLOS works on the premise that the target, outgoing missile and the launcher
    are all on the same Line of Sight (LOS) line.  As missile is outgoing, the
    guidance computer on the launcher will steer the missile to snap it on its
    sightline/LOS toward the target.
   
    The outgoing missile's distance normal to the launcher-to-target LOS (that
    is, how far the missile is off from the LOS line) is known as the
    'Cross Range Error' or 'CRE'.  It is this 'CRE' that the guidance computer
    will have to reduce to zero in order to get the outgoing missile to snap
    back on the LOS line toward the target.  CRE is to be calculated as follows:
   
    CRE = |radar_to_missile| x<cross product> |radar_to_target|
        -----------------------------------------------------
                |radar_to_target|
   
    The guidance computer will calculate the required lateral acceleration to
    bring CRE to zero, where:
   
      required acceleration = K * CRE + Beam_Motion_Term
      K = optional Guidance Gain
   
    Because CLOS relies on the launcher-target LOS as its principal tracking
    reference, it is quite vulnerable to high velocity situations, especially in
    situations where the target is crossing; in such cases, it can behave as bad
    as pure-pursuit/tail-chase homing guidance.  To help mitigate the increased
    acceleration requirements against crossing targets, a "Beam motion" term is
    added after the guidance command.  Beam motion is the target's acceleration
    normal to the launcher-target LOS.
   
    Addition of beam motion term allows CLOS missile to more quickly react to
    changing LOS rate, but ultimately, CLOS is at best, good for producing lot
    of cheap anti-aircraft and anti-slow-moving (i.e. tank) missiles.  For
    intercepting high performance targets with good accuracy, or to achieve
    sophisticated "hit to kill" type of interception, you would want to use one
    of the modern derivatives of Proportional Navigation (PN) family of
    guidance methods.
   
  """

  import wic.common.math as math
  from predictorFCS_flint__includes__ import EXFLINT_Kalman_Filter
 
  launcher_to_msl = math.Vector3( msl_pos ) - launcher_pos
  msl_heading_direction = ( math.Vector3( tgt_pos ) - msl_pos ).NormalizeSafe()
  command_los = math.Vector3( tgt_pos ) - launcher_pos
 
  # Cross Range Error (CRE) -
  # radar_to_msl <X cross product> radar_to_tgt * ( 1.0 / radar_to_target )
  CRE = EXFLINT_Kalman_Filter( cre_data, ( launcher_to_msl.Cross(command_los) * ( 1.0 / command_los.Length() ) ).Length() )
 
  # Beam motion term -- perceived target's inertial acceleration normal
  # to Line of Sight
  Bmp = math.Vector3( tgt_pos ) - beam_motion_data
  beam_motion_data = math.Vector3( tgt_pos )
 
  # Now, calculate the final Lateral Acceleration required for our missile
  # to home into our target.
  latax = msl_heading_direction * CRE + Bmp
 
  # my job is done, it's now up to EXFLINT.Integrate() to steer the missile.
  return True
 
Groups
2010 Mod of the Year Awards

2010 Mod of the Year Awards

Official event with 196 members, must apply to join

Mod of the Year is the largest celebration of hobbyist, amateur and professional modification developers. With record attendance and a massive number...

Air Defence Lovers Group

Air Defence Lovers Group

Hobbies & Interests group with 315 members, open to all members

Do you hate aircraft? Do you hate anything what can fly? Do you want to destroy them? Then you are in a right place! Just join this group, and take control...

Aircraft Lovers Group

Aircraft Lovers Group

Hobbies & Interests group with 1,273 members, open to all members

This group is open to everyone who likes any kind of aircraft

ModDB

ModDB

Official group with 3,692 members, open to all members

If it's information about ModDB and ramblings about mods in general that you are after - then you have come to the right place. Welcome to the official...

United States of America

United States of America

Geographic group with 236 members, open to all members

A group for all of the Americans of Moddb. Join us! We have cookies!

WIC : Modern Warfare Mod Team

WIC : Modern Warfare Mod Team

Developer with 21 members, invitation only

The Team that brought you Fun Mod, now developing Modern Warfare Mod 2. We intend to bring World in Conflict from the Cold War into the Modern Age. We...

Post comment Comments  (0 - 10 of 24)
GeneralKong
GeneralKong Sep 18 2013, 9:39pm says:

hey blahdy, I was wondering there was a way of adding a unit to be spawnable by the anhcheats?

+1 vote     reply to comment
blahdy
blahdy Sep 23 2013, 4:37pm replied:

Any unit is spawnable by anhcheats. Try using shift+alt, and you should see a menu of all available units to spawn.

+1 vote     reply to comment
StrykerNocte
StrykerNocte Mar 25 2013, 5:21am says:

I absolutely love your MW Mod history, it's inspiring, and sad at times. I heard of this mod several years ago, by that time you guys are still in MW 2.0 and I had barely any knowledge about you guys until I heard of the fixed wing aircraft, something new! Since then I followed the mod faithfully until now. And now that you wrote this, I fully know how much struggle had you guys experienced just to get us a wonderful mod for a dead game (worthless is may seem) but WiC had always been my favorite RTS as well, followed by Company of Heroes. By the time I reached the last part of your writing, I felt sad that how could they kill a game so fun and great, not only is it made by the same team behind Homeworld, but it's also the game with best story. I know I have said my thanks to you guys, but now that I know more I want to thank you guys more for this mod. So far the mod had been the best mod for any game out there, better than GMod. Have you guys think of moving to Supreme Commander? The game had mod capabilities, not much I should say. But the upcoming Arma 3 is promising, good luck to you guys :) and once again very big thanks to you guys :) BEST MOD EVER!!!

+1 vote     reply to comment
DEathgod65
DEathgod65 Sep 11 2012, 11:54am says:

After following the WiC: MW Mod, you seem like one of the smartest guys on Moddb to be honest! And have you considered working with the developer of Vector Thrust? Seems that a arcade style flight simulator with realistic missiles and aerial defence seems like the logical next step for the expertise of the MW Developers!

+1 vote     reply to comment
freeders
freeders Jul 29 2012, 8:06pm says:

Hey, I was super impressed to see that you were still around and working on the MW mod after all of this time, nice work. I'm still majorly bummed though that the Black Hawk Down never quite got off its feet and I know there's still players that are interested in it, so I've thought about taking it upon myself to update the mod to the latest WiC patch and maybe get some people back but I want to know where to start. What would of broke the mod after patch 10 came out and what exactly should be done to make it compatible with patch 11 from patch 9?

+1 vote     reply to comment
blahdy
blahdy Aug 8 2012, 9:22pm replied:

So, from patch 9 -> patch 10, they reformatted some components of unittypes_wic.juice (the file that lists all in-game units) which made pre-patch 10 games incompatible.

To fix this, you need to contact the author of the mod to get you the source files (the actual unittypes_wic.juice text file), and you need to manually diff out the differences between pre-patch 10 and post-patch 10 wic, or simply re-add the custom units he created onto a new fresh copy of unittypes_wic.juice.

It's a major pain in the butt, and part of me is glad that WiC is not updated anymore, as modding becomes easier to maintain.

+1 vote     reply to comment
m1a1driver
m1a1driver Mar 24 2012, 6:51pm says:

Excellent work man. very nice. 10 out 0f 10. only little things is some wheels are static on movng vehicles. but thats a simple animation fix form someone like you who develpoed this whole thing. great job

+1 vote     reply to comment
blahdy
blahdy Jul 29 2012, 1:53am replied:

Thanks!

+1 vote     reply to comment
TehSTIG
TehSTIG Mar 4 2012, 10:50pm says:

I recently downloaded this mod and do enjoy it, but I cannot find the UAV or the F-22 (i think that's what it is based on the picture in your videos) in the tactical aid menu. They do occasionally appear as my units on the bottom of the screen but I never called them in (since I can't find them) and I can't control them.

+1 vote     reply to comment
dhannemon13
dhannemon13 May 2 2012, 7:33am replied:

Err......
You can use the FARP to spawn these planes.
And for balancing, blahdy didn't let player to control the planes. Use the JTAC or FAC to give them attack coordinates.

+1 vote     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Level
Avatar
Avatar
Offline Since
Apr 14, 2014
Country
United States United States
Gender
Male
Member Watch
Track this member
Accolades
2010 Mod of the Year Awards ModDB
Statistics
Activity Points
2,654
Rank
491 of 446,256
Watchers
13 members
Time Online
1 minute
Comments
720
Site Visits
6,794
Profile Visitors
14,543 (6 today)
Contact
Private Message
Send Now
Email
Members Only
XFire
blahdy
Sgt.Ghost
Sgt.Ghost friends since Mar 9, 2013
BIGsmalll
BIGsmalll friends since Feb 24, 2012
nightovizard
nightovizard friends since Dec 13, 2011
Tyen901
Tyen901 friends since Sep 2, 2012
Kommandant.12
Kommandant.12 friends since Mar 2, 2012
MarinesRule
MarinesRule friends since Nov 15, 2010
RepublicCommando101
RepublicCommando101 friends since Dec 11, 2010
MoralProfligacy
MoralProfligacy friends since Jul 10, 2011
Keksz
Keksz friends since Aug 1, 2011
Havoc_frost
Havoc_frost friends since Aug 15, 2010