tpw 2315 Posted July 3, 2013 (edited) 20130915: THIS MOD IS NOW PART OF TPW MODS AND IS NO LONGER SEPARATELY MAINTAINED. PLEASE USE THE TPW MODS THREAD TO REPORT BUGS AND REQUEST FEATURES. TL;DR - Player and AI will fall to ground after a drop or being hit by bullets/explosions Download (always contains latest versions of all my mods): https://dl.dropboxusercontent.com/u/481663/TPW_MODS.zip Recommended download: https://dl.dropboxusercontent.com/u/481663/TPW_SOUND_100.zip - TPW SOUND, a tiny config patch to replace silent laydown/standup noises. Readme: TPW FALL - realistic falling system for Arma 3 Version: 1.14 Author: tpw Date: 20130914 Requires: Community Base Addons A3 Description ----------- One of my major annoyances with Arma3 is the unrealistic infantry falling simulation. Although things are improving, a falling (not freefalling) unit still looks and behaves like it is made out of styrofoam, with little sense of inertia and no noise. There is essentially no penalty for jumping from heights which would cause stumbling/falling/injury in real life. Similarly, units barely flinch when absorbing damage from bullets and explosions that should at least knock them down. TPW FALL attempts to remedy that by monitoring the vertical distance travelled by a footbound unit not when it is not in contact with the ground, and triggering the appropriate in-built sounds and animations for the different distances. Falling animations (and optional ragdoll effects) are also triggered when a unit takes damage from projectiles and explosions. TPW FALL works for the player and all units on the map, whether editor placed or spawned, combatant or civilian, and is written to cause no discernable FPS hit even with dozens of units on a map. - Unit will react to the ground after falling/jumping. - Standing/crouching unit will fall to the ground, and civilian will additionally crawl, when hit by projectiles or nearby explosions. - Hit unit will fall either using built in animations or ragdoll. Pistol and silenced rounds will not cause ragdoll. - Hit unit will have skills reduced for the duration of the fall. - Hit unit will remain immobilised for a user definable time after fall. - All falls trigger landing sounds, volume dependent on the height of the fall. - Falls into water trigger splashing noises. - Landing from a fall of < 1m triggers sounds only. - Landing from a fall of 1-2m triggers kneeling animations and noises. - Landing from a fall of >2m triggers fall to ground animations and noises. Yells are randomly triggered with greater frequency for longer falls. - A fatigued unit is more influenced by the fall. - A heavier unit is more influenced by the fall. - Fall distance is randomised +/- 10% to simulate slightly different reactions to the same fall. A 2m fall will register between 1.8 to 2.2m. - Unit's fatigue is increased by a fall (approx 10% for a 2m fall). - Units must be within a certain threshold distance of the player to react realistically to falls. - Overall sensitivity of the system may be adjusted. 50% sensitivity = 2m fall will register as 1m fall. A lightly weighed down infantry unit can usually jump from heights of up to 2m without completely falling to the ground. By comparison a heavily weighed down unit with backpack, launcher, and lots of ammo will likely fall to the ground after a jump of 1-2m. Fatigue will further decrease the height that a unit can jump from without hitting the deck. TPW FALL adds a bit more immersion to gameplay since a unit will now behave like it has inertia and react with the ground and bullets. If you attempt to parkour off a 3m high balcony in full kit, you'll be incapacitated on the ground for a few seconds, just like real life. If you take a NATO round in the chest, you'll be knocked over. Installation and configuration ------------------------------ Extract the @TPW_FALL modfolder to your preferred mod location, and call it via command line or mod launcher. You'll need Community Base Addons A3 (CBA A3) for the addon to launch properly. Copy @TPW_FALL\userconfig\TPW_FALL\TPW_FALL.hpp to your userconfig\TPW_FALL\TPW_FALL.hpp. You may edit this file to taste: TPWFALL_SENSITIVITY = 100; //Sensitivity of unit to falls (%). 50 = unit must fall from twice the height to have the same effect. TPWFALL_THRESHOLD = 200; //Distance threshold (m). Unit must be closer than this to player to realistically react to falls. TPWFALL_HINT = 1; //Startup hint. 0 = no hint. TPWFALL_RAGDOLL = 1; //Use ragdoll animations when unit is hit. 0 = no ragdoll. TPWFALL_FALLTIME = 10; //Maximum time (sec) a unit will be incapacitated on the ground after being hit. The script version is in @TPW_FALL\scripts. Instructions for running it are in the header of the script. Please note that if you already have the addon version running, the script version will detect it and quit. Known bugs and shortcomings --------------------------- TPW FALL is in early development so likely contains numerous bugs, as well as scope for numerous improvements. - TPW FALL uses switchmove to allow immediate transition to landing animations, which causes a small glitch in 1st person view depending on where you are looking. - BIS are implementing an in-air falling animation, so I don't need to! Use a later beta development build if you want this feature. - I am limited in the realism I can achieve with the animation resources of the default game (which are admittedly far superior to earlier Arma versions). - I have tried to implement MP compatibility but am not sure if it works properly. - I have implemented a hack to enable apparent ragdolling of live units, but transitions to/from ragdoll state are not seamless. - A ragdolling unit cannot take further damage until it hits the ground. - TPW FALL does not influence a unit's health or behaviour. I prefer to let the engine or other scripts handle this. Feedback -------- My code is like a dancing bear: I'm pleased that it can dance but it's not going to be at the Bolshoi any time soon. If you have feedback, suggestions and improvements then I'll be very glad to hear them. Thanks ------ zapat: coding tips Lifted86: help with sound playing Foxhound: constant support of mod makers McLupo: videography Changelog --------- 20130914: v1.14 - TPW FALL disabled for parachute landings. 20130913: v1.13 - Units periodically reset their fall status to prevent being "stuck" falling. - Introduced "all in one" startup hint for all TPW mods, you'll get the one hint showing all active mods. - Script versions will detect an already running addon and quit. 20130815: v1.12 - Code improvements - Plays better with TPW EBS - Fixed bug that left ragdolled units unresponsive 20130805: v1.11 - Ragdolled hit units will now lie on their backs writhing. - Unarmed large falls now face first onto the ground. - Misc code improvements. 20130803: v1.10 - Player will remain prone after being hit. - Ragdolling should be MP compliant. - Ragdolls assume initial stance of hit unit. 20130728: v1.09 - Total rewrite of code to dramatically reduce thread usage and improve performance. - Hit unit will be incapacitated for a user defined time. 20130723: v1.08 - Optional ragdoll falling implemented for live units. - Skills are reduced for the duration of a fall. - High falls will no longer trigger hit fall animations. 20130717: v1.07 - Now works for all units, combatant and civilian. - Units will be knocked over if hit by bullets or explosions. - Code changes for variable declaration and animation handling in recent beta dev builds. 20130708: v1.06 - Released as an addon only. - Now works for all editor placed and spawned combatant AI. - Further simplification and optimisation of code. - Fall distance is randomised by +/- 10%. - Falls influence unit fatigue. - Units must be within a set distance of the player to react realistically to falls, to reduce CPU overhead. - Overall sensitivity of the system can be adjusted. - Rewritten water fall detection code. 20130706: v1.05 - Total rewrite of the code. Uses istouchingground to determine if infantry has jumped/fallen. Much more precise than monitoring unit speed. - Removed false positives due to running over small objects and rough terrain. Unless unit leaves the ground, a fall cannot be triggered. - Added fatigue influence. A tired unit is more likely to fall after a jump from a given height. - Added weight influence. A heavier unit is more likely to fall after a jump from a given height. - Added more randomness to yells/grunts. A unit will no longer yell after every large fall. - The time taken for a unit to recover from a fall increases with distance. 20130705: v1.04 - Fixed bug where sounds were playing underground(!). 20130704: v1.03 - Replace groupchat yells with real ones. - Fixed bug where AI was always being treated as having no weapon 20130704: v1.02 - Kneeling animations for small falls. - Random left/right large falls. - Landing noises volume is speed dependent. 20130703: v1.01 - First proper addon/script release. 20130702: v1.00 - Initial release, script only. Disclaimer ---------- I totally refuse to accept responsibility for anything that might happen to your game/computer/life as a result of using my mod. If you accept this, then feel free to use and modify this code, on the proviso that you post back changes and improvements so that everyone can benefit from them, and acknowledge the original author (tpw) in any derivative works. My A3 mods: TPW CIVS: Ambient civs and traffic TPW FALL: Realistic infantry falling from height and bullet hits TPW LOS: AI Line of sight system for enhanced CQB TPW EBS: Engine based AI/player suppression TPW HOUSELIGHTS: Automatic house lighting for Altis/Stratis TPW BLEEDOUT: Realistic bleeding system TPW FOG: Foggy breath for Altis/Stratis Edited September 15, 2013 by tpw Share this post Link to post Share on other sites
Sakai 1 Posted July 3, 2013 Now we are talkin :D Kinda hate the "nothing happened lets move on" when you fall from those heights... Amazing work! Share this post Link to post Share on other sites
Remi .A 8 Posted July 3, 2013 not something that I think anyone would really run, tripping over every little box and shit could really get annoying. Just IMO solid work though just needs an insane amount of tweak. Share this post Link to post Share on other sites
bad benson 1733 Posted July 3, 2013 overall i like the realism this adds but i think you should take different fall heights into account and use different animations for them. i have something similar in my upcoming mod where i have different possible outcomes. i use custom animations but for your script you could use for example the stand-to-crouch animation for lower heights. so it's like the character is dampening his fall. you'd have some kind of landing animation then that could be used for small obstacles and the one you have now for higher falls that aren't high enough to trigger ragdoll. just some thoughts i had after watching the video:) good work so far. keep it up! Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2013 not something that I think anyone would really run, tripping over every little box and shit could really get annoying. Just IMO solid work though just needs an insane amount of tweak. Not an insane amount, just a matter of tweaking the fall thresholds to your liking in the script version. I will probably spin some of the variables out into a userconfig shortly. The issue is that if a unit steps off a small rock, occasionally they almost instantly attain -5m/s and trigger the system. By contrast, if a unit jumps off a high ledge, they will accelerate normally and take 1/2 a sec to reach -5m/s. PS - I'd really run it! ---------- Post added at 13:34 ---------- Previous post was at 13:30 ---------- overall i like the realism this adds but i think you should take different fall heights into account and use different animations for them. i have something similar in my upcoming mod where i have different possible outcomes. i use custom animations but for your script you could use for example the stand-to-crouch animation for lower heights. so it's like the character is dampening his fall. you'd have some kind of landing animation then that could be used for small obstacles and the one you have now for higher falls that aren't high enough to trigger ragdoll.just some thoughts i had after watching the video:) good work so far. keep it up! Thanks mate. The system currently does allow for different fall speeds. The lower speed currently just triggers a landing sound, but could be tweaked to add a crouch. Then again, hearing that you have something similar in the pipeline I might as well give up now... Share this post Link to post Share on other sites
bad benson 1733 Posted July 3, 2013 Then again, hearing that you have something similar in the pipeline I might as well give up now... nah man. don't do it. this one is addon free which is a huge advantage in itself. and it's also good to have variety. what i have is just a small part of something bigger including climbing, jumping and eventually melee and other stuff that are meant to improve the game. so i'm just interested in anything similar. my fall detection has also totally different goals than yours. it's more cosmetic than anything. keep at it. i didn't mean to discourage you. i'm anything but a script guru so having an alternative to my stuff that also requires no addons is always good. not to mention the learning experience you'd pass on, if you stop now. just ignore me please.;) Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2013 Sorry BB, I should have put a smiley after my last statement. I'm not really giving up, just acknowledging the excellence of scripters such as yourself. I've been Arma scripting solo and as part of a team on various projects over the years and basically find that I like best the small projects where I focus on a single aspect of the game I'm trying to improve. Once they get too big they become more of a chore. Share this post Link to post Share on other sites
bad benson 1733 Posted July 3, 2013 Once they get too big they become more of a chore. so true! while working alone helps that a little, it also is kind of a whole different workload if you are ambitious. i should consider that before starting my next project ;) you are doing it the right way. Share this post Link to post Share on other sites
McLupo 118 Posted July 3, 2013 (edited) Hello! First of all - congrats for releasing your personel project. Short feedback, but i´m still on it.... Comparing with the first version - much more realistic, smoother animations, less of bugs. In short - thanks for this (your) nice idea i can play now.:cool: Cheers McLupo Edited July 3, 2013 by McLupo Grammar correction Share this post Link to post Share on other sites
adanteh 58 Posted July 3, 2013 Quite cool, but having different ways of falling would be nice. Something like a crouch or so is welcome. Also it might be nice if it somewhat randomizes the directions you're falling in. Instead of just right stanced prone, also have it go left, lower stanced and the same for crouch :D Especially like it because it's a script. Hope it's possible to implement this into multiplayer servers. Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2013 Quite cool, but having different ways of falling would be nice. Something like a crouch or so is welcome. Also it might be nice if it somewhat randomizes the directions you're falling in. Instead of just right stanced prone, also have it go left, lower stanced and the same for crouch :DEspecially like it because it's a script. Hope it's possible to implement this into multiplayer servers. Working on all this! I've got the crouch happening for lower speed falls, and working on randomising falling left/right for larger falls. There's probably a lot of extra work that has to go into synchronising the stance changes for MP, I may think about it more once I've got the essentials ironed out for SP. Share this post Link to post Share on other sites
bad benson 1733 Posted July 3, 2013 just so you know. zooloo75 reported that switchmove seems to be global now. didn't have time to test it myself but you might even have to do any syncing. Share this post Link to post Share on other sites
froggyluv 2136 Posted July 3, 2013 (edited) Is there anything you can do about the too-erect position of the body while still falling? The landing is pretty cool but it still feels like a statue while in air. Maybe not possible but I think most people kind of launch when they step down and tuck their heads/raise shoulders or traps. Maybe one of the crouch positions would work?? Edited July 3, 2013 by froggyluv Share this post Link to post Share on other sites
l etranger 5 Posted July 3, 2013 Is there anything you can do about the too-erect position of the body while still falling? The landing is pretty cool but it still feels like a statue while in air. Maybe not possible but I think most people kind of launch when they step down and tuck their heads/raise shoulders or traps. Maybe one of the crouch positions would work?? Dev version have a falling animation already, for when you fall from small height (then above 100, its the freefall anim which is payed) Share this post Link to post Share on other sites
lordprimate 159 Posted July 3, 2013 can you set up the anims as a few arrays and have them selected at random or according to height and direction of fall, maybe?? Das Attorney, in his @Jump_MF addon has a script that checks your velocity, direction, etc maybe hell let you use it? His addon also works in MP so maybe he can give you some pointers there as well? Share this post Link to post Share on other sites
zooloo75 834 Posted July 3, 2013 just so you know. zooloo75 reported that switchmove seems to be global now. didn't have time to test it myself but you might even have to do any syncing. Yea, I thought they were synchronized. I saw other players in animations set with switchMove, and it showed on my screen, but sometimes it does nothing. Weird :\ Hopefully my finding is correct, if so then :D BTW, I tested your script, it's a good touch - but as said earlier, lacks a variety of animations. I'm sure we're all waiting for that ragdoll command >.< Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2013 can you set up the anims as a few arrays and have them selected at random or according to height and direction of fall, maybe?? Das Attorney, in his @Jump_MF addon has a script that checks your velocity, direction, etc maybe hell let you use it? His addon also works in MP so maybe he can give you some pointers there as well? That's exactly what I am implementing LP. The fruits of my labour will be up here shortly. I experimented with using swimming animations when falling but they looked worse than the statue. I'll keep thinking about this... Share this post Link to post Share on other sites
froggyluv 2136 Posted July 3, 2013 I experimented with using swimming animations when falling but they looked worse than the statue. I'll keep thinking about this... Not sure if you've seen but some new falling animations are in latest Dev Build http://www.youtube.com/watch?feature=player_detailpage&v=7qNZLQcFUMU#t=9s Share this post Link to post Share on other sites
bad benson 1733 Posted July 3, 2013 I experimented with using swimming animations when falling but they looked worse than the statue. I'll keep thinking about this... i ended up using the following one for free fall in my project ("AsdvPercMstpSnonWrflDnon_relax"). it looks really good in my opinion. to me it looks like the default one but with the feet detached from the ground. but that's of course down to taste. but i think you should give it a try. Share this post Link to post Share on other sites
chrisb 196 Posted July 3, 2013 Another great one TPW, gone straight into the ai enhance folder. Thanks for sharing it. :) Share this post Link to post Share on other sites
tpw 2315 Posted July 4, 2013 Download: https://dl.dropboxusercontent.com/u/481663/TPW_FALL_102.zip Changes: Units will kneel after a smaller fall, to simulate taking the shock of the fall with the thighs. Landing noises are speed dependent. Jump from 6m and you'll land with a satisfying crunch. Falling with pistol/rifle will now trigger a random left or right fall. After looking at the BIS implementation of the in air animation, I've taken the lazy way out and decided not to bother with my own! ---------- Post added at 10:13 ---------- Previous post was at 10:12 ---------- Another great one TPW, gone straight into the ai enhance folder. Thanks for sharing it.:) Thanks ChrisB. Ever seen The Castle? "That's going straight to the pool room!". Share this post Link to post Share on other sites
chrisb 196 Posted July 4, 2013 What an update already, he’s only fell over twice..;) Share this post Link to post Share on other sites
lordprimate 159 Posted July 4, 2013 just another question. Any way to make this work for AI as well.. and can you get rid of the typed messages? "mmmph", "there goes my ankle" etc.. I think the AI should have the same effect if they walk off ledge, by accident, or supidity.... BTW's THANKS AGAIN, this makes falling fun! Share this post Link to post Share on other sites
tpw 2315 Posted July 4, 2013 (edited) just another question. Any way to make this work for AI as well.. and can you get rid of the typed messages? "mmmph", "there goes my ankle" etc..I think the AI should have the same effect if they walk off ledge, by accident, or supidity.... BTW's THANKS AGAIN, this makes falling fun! I will get rid of the groupchat stuff, it's there more for my personal taste. In fact I'm busy trawling configs to see if I can access various breathing and grunting noises instead. If you run the script version (see the readme), then you can assign TPW FALL to any units. Caveat: I rarely notice my squad AI falling, so I can't confirm if they'll behave the same way as the player (although I can't see why not). EDIT: OK so TPW FALL does work for squad AI, but for some reason you have to have given them a stance directive first (eg ~ 7 9 copy my stance). If you don't, then they are treated as if they are unarmed, and go to the unarmed animations. I'll going to see if I can work around this. EDIT2: currentweapon returns an empty string on AI unless they've been given a stance directive. What the hell?!? EDIT3: _unit action ["SwitchWeapon",_unit,_unit,0]; , where _unit is the name of the unit, fixes it. Edited July 4, 2013 by tpw Share this post Link to post Share on other sites
CameronMcDonald 146 Posted July 4, 2013 Great work, tpw. :) Share this post Link to post Share on other sites