xendance 3 Posted April 4, 2014 (edited) Hello I've been working on a CCIP script for aircraft since I hate the fact that no aircraft has any kind of fire control system. I plan on releasing the script for all with permissions to edit it as they see fit. But the plan is to get the script work so that it should work on all vehicles with as minimal configuration as possible. The script uses Euler's method to approximate the trajectories of projectiles, be that bullets, rockets or bombs. As I have no idea how the game engine really calculates the projectile paths, I've been basically guessing and reverse engineering the algorithm. The plan is to release this for everyone so every single modder who makes vehicles can use this in his work. Technical details: Three different solvers for CCIP, one for bullets, one for rockets and one for bombs. Uses Euler method for solving the trajectory. The script start is event based, meaning it doesn't busy-wait for a player to get into a plane. Instead uses getIn event handler for firing up the CCIP solver. Since I haven't figured out how to properly get the model space position of the currently selected weapon, the script requires a file that puts the memory point names into a pairs array (an sqf equivalent of hashmap/dictionary it seems) and returns that pairs-array. Then the script uses the currently selected weapon class name and retrieves the memory point from the pairs-array. The same file is also used to define which weapons are CCIP compatible, so it's possible to tweak this on a per vehicle class basis. The file mentioned above has to be named so that it is *vehicle class name*_ccipProvider.sqf. Example below of such file. //file name: B_Plane_CAS_01_F_ccipProvider.sqf _allowedWeapons = [ "Cannon_30mm_Plane_CAS_02_F", "Rocket_03_HE_Plane_CAS_02_F", "Rocket_03_AP_Plane_CAS_02_F", "Bomb_03_Plane_CAS_02_F"]; _gatlinInfo = "Gatling_barrels_end"; _heRocketInfo = "Rocket_2"; //right rocket _apRocketInfo = "Rocket_1"; //left rocket _bombInfo = "N/A"; _pairs = []; _pairs = [_pairs,"Cannon_30mm_Plane_CAS_02_F",_gatlinInfo,false] call BIS_fnc_addToPairs; _pairs = [_pairs,"Rocket_03_HE_Plane_CAS_02_F",_heRocketInfo,false] call BIS_fnc_addToPairs; _pairs = [_pairs,"Rocket_03_AP_Plane_CAS_02_F",_apRocketInfo,false] call BIS_fnc_addToPairs; _pairs = [_pairs,"Bomb_03_Plane_CAS_02_F",_bombInfo,false] call BIS_fnc_addToPairs; [_allowedWeapons, _pairs]; Anyhow, here's a sneak peek of how it works currently. The first video is also running the projectile path tracing script to visualize the actual trajectories. TODO: Figure out how bomb trajectories are calculated Figure out how sideAirFriction config affects rocket trajectories when they are fired during a sharp turn/bank Testing and cleaning up Edited April 7, 2014 by Xendance Share this post Link to post Share on other sites
Crielaard 435 Posted April 4, 2014 Very good job mate. Maybe my calculations can help you. Look for my manual bombing guide. I'll gladly help you Share this post Link to post Share on other sites
xendance 3 Posted April 4, 2014 Very good job mate. Maybe my calculations can help you. Look for my manual bombing guide. I'll gladly help you Cheers, I'll take a look at the guide. Share this post Link to post Share on other sites
kremator 1065 Posted April 4, 2014 Absolutely brilliant mate ! Very well done so far. With Neptune's guide as well this will be a keeper! If you need testers ... just ask. Share this post Link to post Share on other sites
GieNkoV 30 Posted April 4, 2014 Do you plan to make it appear but only on HUD, so one doesn't have floating pointer around his plane? Share this post Link to post Share on other sites
kremator 1065 Posted April 4, 2014 Actually I don't mind the floating pointer. I do LOVE the way it models all types of weapon ... from bombs to rockets to guns .... GENIUS ! Share this post Link to post Share on other sites
Crielaard 435 Posted April 4, 2014 I have an excel sheet with lots of raw data. PM me if you want it. Share this post Link to post Share on other sites
Jackson Snow 10 Posted April 5, 2014 This is amazing. Share this post Link to post Share on other sites
PenguinInATuxedo 18 Posted April 6, 2014 Help me under stand ccip, it adds to the HUD showing calculated paths of cannon, rockets, missiles and bombs? Share this post Link to post Share on other sites
GieNkoV 30 Posted April 6, 2014 CCIP - Continously Calculated Impact Point. It says for itself. And yeah it should be visible only on HUD, not whole plane. Still good effort. Wysłane z mojego Xperia Live with Walkman przy użyciu Tapatalka Share this post Link to post Share on other sites
kremator 1065 Posted April 6, 2014 Where the crosshairs fall, the rounds/rockets/bombs will land ... VERY cool ! I wouldn't be too restrictive at the start concering when the CCIP can be seen. I'm sure it will be fixed in time to be centre HUD only. I wouldn't even mind if it was a PiP ! Share this post Link to post Share on other sites
warlord554 2065 Posted April 7, 2014 Really great work!!!! A feature I've really missed. You may want to talk to Spartan0536, he has extensive experience with ballistics and airfriction values. May be able to help Share this post Link to post Share on other sites
xendance 3 Posted April 7, 2014 Do you plan to make it appear but only on HUD, so one doesn't have floating pointer around his plane? Actually I don't mind the floating pointer.I do LOVE the way it models all types of weapon ... from bombs to rockets to guns .... GENIUS ! Help me under stand ccip, it adds to the HUD showing calculated paths of cannon, rockets, missiles and bombs? CCIP - Continously Calculated Impact Point. It says for itself. And yeah it should be visible only on HUD, not whole plane. Still good effort.Wysłane z mojego Xperia Live with Walkman przy użyciu Tapatalka Where the crosshairs fall, the rounds/rockets/bombs will land ... VERY cool !I wouldn't be too restrictive at the start concering when the CCIP can be seen. I'm sure it will be fixed in time to be centre HUD only. I wouldn't even mind if it was a PiP ! I don't plan on doing the HUD part. What you see in the videos is just the debug view (rockets even had the trajectory debug lines visible) with the x-hair. The plan is to release the script for everyone to provide modders a CCIP solution that they can use with their vehicles. That way they can handle the HUD themselves and do what they want with the CCIP position. Share this post Link to post Share on other sites
lao fei mao 21 Posted April 7, 2014 CCIP is very helpful for us to drop dumb bomb, especially those with high drag, we don't have to dive. Thanks for your work. Share this post Link to post Share on other sites
Crielaard 435 Posted April 7, 2014 You don't have to dive for dropping dumb bombs bro. Check my manual bombing guide. You will find that you can be quiet accurate even without the help of CCIP/CCRP. http://www.armaholic.com/page.php?id=24728 My full combat fundamentals manual will be released in 3-4 weeks. Which includes Loft bombing and much more aswell! Sure like to have this script aswell for my own addon, I'm about to start! Share this post Link to post Share on other sites
kremator 1065 Posted April 7, 2014 Can't wait for this goodness. Need to make my bombing much more accurate! Share this post Link to post Share on other sites
the_demongod 31 Posted April 16, 2014 Holy crap this looks amazing. Can't wait to try it out. Share this post Link to post Share on other sites
Crielaard 435 Posted May 8, 2014 Still looking forward for the Script to be released. Having some sort of HUD indication can be done by merging it with this CCIP script: http://forums.bistudio.com/showthread.php?173890-CCIP-Script-for-ArmA-3-is-ready! The script above lacks the 'aerodynamics' of the bomb. Which always makes the bomb overshoot the marked impact location. @Xendance I would verymuch like to assist making this happen. Share this post Link to post Share on other sites
xendance 3 Posted June 7, 2014 I'm looking for testers, mainly people who are making their own aircrafts since this script is supposed to be kind of a bootstrap script that the modder can use the implement CCIP. Send me a PM if you're interested Share this post Link to post Share on other sites
PenguinInATuxedo 18 Posted June 7, 2014 Is it only for adding to mods or can it be run in mission for vanilla aircraft? Share this post Link to post Share on other sites
kremator 1065 Posted June 7, 2014 Come on you aircraft modders! If you need other testers Xendance then just ask mate. Share this post Link to post Share on other sites
xendance 3 Posted June 7, 2014 Is it only for adding to mods or can it be run in mission for vanilla aircraft? It's supposed to be some sort of library that you can just add to your project and it'll handle itself. It provides two public client side variables that can be then used for drawing the proper reticles on the HUD for example. Currently the variables are basically the position of the estimated impact point and then a result index. The index indicates how many iterations the algorithm evaluated the flight path. It will return -1 if it hit the max iteration count before finding the impact point on ground. The max iteration count is there because I can't just iterate forever with a fixed time step or it would plummet the FPS. There is an option to enable some certain HUD elements for debugging purposes. You can enable the impact point reticle and the flight path visualization but they are very crude and not really suitable for aircraft HUDs. The script has an MIT license, which means that anyone can modify it and redistribute it if they want. Share this post Link to post Share on other sites
xendance 3 Posted June 8, 2014 (edited) I have bit of a problem with how ArmA 3 converts coordinate spaces and made a post about it in the dev branch scripting thread. If anyone knows what causes the issue mentioned in the post and knows how to fix it, do tell :D http://forums.bistudio.com/showthread.php?160330-Scripting-Discussion-(dev-branch)&p=2706362&viewfull=1#post2706362 Edit: Managed to make a hacky conversion function that seems to be stable during flight hackForConvertingModelSpacePosToWorldSpaceBecauseBISFunctionDoesNotWork = { _model = _this select 0; _modelSpaceGunPos = _this select 1; _dirVector = _this select 2; _magnitude = vectorMagnitude [0, (_modelSpaceGunPos select 1), 0]; _vectorScaleAmount = _magnitude / (vectorMagnitude _dirVector); _vector = vectorMultiply [_dirVector, _vectorScaleAmount]; _vector = vectorAdd [visiblePositionASL _model, _vector]; _vector; }; http://cloud-3.steampowered.com/ugc/558758155460501515/F8B068674EC171B45ECAC9D3800CAE6F382F01C2/ Still gotta displace the x and z dimensions of the _vector, then it should be pretty perfect. Edited June 8, 2014 by Xendance Share this post Link to post Share on other sites
xendance 3 Posted June 12, 2014 Released: http://forums.bistudio.com/showthread.php?179025-CCIP-script-for-aircrafts Share this post Link to post Share on other sites