Jump to content
Sign in to follow this  
zooloo75

Bullet-Wind Interaction System

Recommended Posts

This package will allow you to add wind simulation to bullets, causing the bullet to go off course.

The script uses the wind variable ingame so it is dynamic according to the mission.

> Download "Bullet-Wind Interaction System" <

*Always has the latest version*

You can see the effect either with a bulletcam or with tracer rounds.

Works for both players and AI. Works in both singleplayer and multiplayer environments. Low CPU usage.

To check wind direction I've made a useful piece of code.

private ["_windDir"];
while {true} do
{
if(windDir >= 340 && windDir <= 360 || windDir >= 0 && windDir <= 20) then {_windDir = "North";};
if(windDir >= 20 && windDir <= 60) then {_windDir = "North East";};
if(windDir >= 60 && windDir <= 110) then {_windDir = "East";};
if(windDir >= 110 && windDir <= 160) then {_windDir = "South East";};
if(windDir >= 160 && windDir <= 200) then {_windDir = "South";};
if(windDir >= 200 && windDir <= 250) then {_windDir = "South West";};
if(windDir >= 250 && windDir <= 290) then {_windDir = "West";};
if(windDir >= 290 && windDir <= 340) then {_windDir = "North West";};

hint format ["Wind Direction: %1",_windDir];

sleep 2;

Possible solution for wind synchronization on multiplayer.

while {true} do 
{
publicVariable "wind";
publicVariable "windDir";
sleep 10;
};

===========================================================================================

Update 4/27/2013

Created AWIS (Aerial-Wind Interaction System)

Adds wind simulation to aerial vehicles.

Sharp changes in velocity will shake screen.

*Currently WiP*

Update 4/24/2013

Fixed certain tracer rounds not being registered. Added possible solution to wind synchronization for multiplayer.

Update 4/21/2013

Coriolis effect implemented (very simple - just shifts the bullet's velocity towards the west very slightly); Raised the divisor of bullets from 10 to 30 (weaker).

Update 4/20/2013

Proper wind simulation on grenade launchers.

Update 4/19/2013

Included a minimal demo mission to demonstrate wind direction indication and simulation system.

Update 4/18/2013

Added in solutions for servers and clients. Fully MP and SP compatible. Just put the new SQF's in the mission folder.

===========================================================================================

The server will automatically add the simulation to any newly spawned units too (scans for AI continuously), ensuring full compatibility with any mission.

This will work for both SP and MP missions.

Get it from Armaholic!

news_download_a3_3.png

Edited by zooloo75

Share this post


Link to post
Share on other sites

Added an example of adding the simulation to all units for singleplayer.

Share this post


Link to post
Share on other sites

I like this idea, it will make the m107 with a 2000m shot almost impossible without a spotter. (and a Kestrel --- hint hint, nudge wink!)

I have a feeling this will be in final though, if not it should be.

Share this post


Link to post
Share on other sites
Is it MP compatible mate?

If so, its amazing :D

It is MP compatible. Just depends on how one implements it in their mission. The server can handle wind simulation for AI, and players can handle it for themselves.

---------- Post added at 02:35 PM ---------- Previous post was at 01:23 PM ----------

Update - Added in solutions for servers and clients. Fully MP and SP compatible. Just put the new SQF's in the mission folder and add these lines to you init.sqf

if (isServer) then {execVM "bulletWindServer.sqf";};
execVM "bulletWindClient.sqf";

The server will automatically add the simulation to any newly spawned units too, ensuring full compatibility with any mission.

Share this post


Link to post
Share on other sites

Ok thanks mate, i will pass it along :) It really does sound nice hehe.

Need to test it myself.

Share this post


Link to post
Share on other sites
Ok thanks mate, i will pass it along :) It really does sound nice hehe.

Need to test it myself.

If the effects are too strong/weak, it can be adjusted easily by changing the value of the divisors in the line. (the 10's)

_bullet setVelocity [_velX+(random _windX)/10, _velY + (random _windY)/10, _velZ + (random _windZ)/10];

Share this post


Link to post
Share on other sites

Thank you friend for this addon.

Thanks for helping ARMA to be no1 on it's kind

Share this post


Link to post
Share on other sites
Thank you friend for this addon.

Thanks for helping ARMA to be no1 on it's kind

It's what I do :) (Or try to do atleast :3)

Share this post


Link to post
Share on other sites

Updated OP with code to display wind direction and included a demo mission.

Edited by zooloo75

Share this post


Link to post
Share on other sites

seems to work very well with bullets,

i'm experiencing strange behavior with the grenade launcher. it's as if the grenades have too little weight, they just get taken in the wind never to be seen again. is there a way to change this??

thanks for the mod,

Share this post


Link to post
Share on other sites
seems to work very well with bullets,

i'm experiencing strange behavior with the grenade launcher. it's as if the grenades have too little weight, they just get taken in the wind never to be seen again. is there a way to change this??

thanks for the mod,

Ah yeah, forgot to add Grenade Launcher exclusions. I will fix that!

EDIT - Grenade launchers have wind applied to them correctly now.

Edited by zooloo75

Share this post


Link to post
Share on other sites
If the effects are too strong/weak, it can be adjusted easily by changing the value of the divisors in the line. (the 10's)

_bullet setVelocity [_velX+(random _windX)/10, _velY + (random _windY)/10, _velZ + (random _windZ)/10];

yes the setting are very strong...

Edited by Mariodu62

Share this post


Link to post
Share on other sites

Does everyone have the same wind when playing on the same server?

Greetings!

---------- Post added at 11:55 AM ---------- Previous post was at 10:45 AM ----------

Could you pls specifiy your installation guide?

Ive never altered my init.sqf before and since I find at least 6 different init.sqfs in my Arma directory I would appreciate more information on the instalment;)

Keep in mind that there are many players that dont know nothing of how to get mods running.

A detailed installment guide is therefore obligatory!

Best regards and thanks for this addon;)

Share this post


Link to post
Share on other sites
Does everyone have the same wind when playing on the same server?

Weather synchronisation has always been a but lacking in some areas, especially wind unfortunately. It can be synched, but it requires a script/addon in the past. However, I see that BIS are doing good things with weather, so maybe MP synched weather will be one of them :)

But, bear in mind it's not actually critical in a solution like this solution. As long as you as a player can know the wind direction & strength, you can adjust for it. Only exception to this would be when you have a sniper-spotter combo working together, then it would be more difficult.

Could you pls specifiy your installation guide?

Ive never altered my init.sqf before and since I find at least 6 different init.sqfs in my Arma directory I would appreciate more information on the instalment;)

Each init.sqf is unique to it's mission folder. An init.sqf isn't created automatically so if there isn't one on your mission folder, you make one.

Keep in mind that there are many players that dont know nothing of how to get mods running.

A detailed installment guide is therefore obligatory!

Best regards and thanks for this addon;)

This isn't an addon, it's a mission scripted solution, so it just "comes" with the mission, nothing for the player to do :)

@Zooloo75:

Great stuff :) this could easily become a standalone eventually I expect? One question - if wind dispersion is applied to AI rounds, would it be possible to ramp that dispersion down with AI skill? (I haven't actually tried the scripts yet - just askin' :))

Share this post


Link to post
Share on other sites
Weather synchronisation has always been a but lacking in some areas, especially wind unfortunately. It can be synched, but it requires a script/addon in the past. However, I see that BIS are doing good things with weather, so maybe MP synched weather will be one of them :)

But, bear in mind it's not actually critical in a solution like this solution. As long as you as a player can know the wind direction & strength, you can adjust for it. Only exception to this would be when you have a sniper-spotter combo working together, then it would be more difficult.

Each init.sqf is unique to it's mission folder. An init.sqf isn't created automatically so if there isn't one on your mission folder, you make one.

This isn't an addon, it's a mission scripted solution, so it just "comes" with the mission, nothing for the player to do :)

@Zooloo75:

Great stuff :) this could easily become a standalone eventually I expect? One question - if wind dispersion is applied to AI rounds, would it be possible to ramp that dispersion down with AI skill? (I haven't actually tried the scripts yet - just askin' :))

As for weather MP synchronization, I've been unable to test this out - although the server could easily send out its own wind variable across the network to ensure that everything will look right.

Also you are right - this is not a mod for the average user, it is a script package for mission developers to implement into their own missions if they want a quick solution to wind simulation for bullets.

Wind dispersion based on skill for AI can be easily implemented by dividing the skill amount to the divisor (since it ranges from 0-1) it would act as a percentage. So for example, the default divisor is 10, and let's say that a certain AI's skill is 0.5, it would makes the dispersion multiply to 20. An AI with a skill level of 1 would have the default 10.

divisor/unit's skill = wind dispersion

Does everyone have the same wind when playing on the same server?

Greetings!

---------- Post added at 11:55 AM ---------- Previous post was at 10:45 AM ----------

Could you pls specifiy your installation guide?

Ive never altered my init.sqf before and since I find at least 6 different init.sqfs in my Arma directory I would appreciate more information on the instalment;)

Keep in mind that there are many players that dont know nothing of how to get mods running.

A detailed installment guide is therefore obligatory!

Best regards and thanks for this addon;)

I plan on making an addon version of this once it's polished up and I find out what exactly I'd have to do to turn this into an addon (never made a mod before.)

But as I stated earlier, this is not for the average user, it is for mission developers.

yes the setting are very strong...

Nothing is stopping the user from changing the divisors to their own liking.

Edited by zooloo75

Share this post


Link to post
Share on other sites

Currently replicating/recreating the Coriolis effect! :)

P.S. Can a mod rename this thread to "Bullet-Wind Interaction System" please!

---------- Post added at 02:21 AM ---------- Previous post was at 01:48 AM ----------

Update - Coriolis effect implemented (very simple - just shifts the bullet's velocity towards the west very slightly); Raised the divisor of bullets from 10 to 30 (weaker).

Share this post


Link to post
Share on other sites

I have been waiting for something like this for a while, Arma just doesnt feel complete without it.

Is it possible however to have an item like a kestrel to be necessary to see windage? Or at least a keybind to turn the wind tip on/off?

Share this post


Link to post
Share on other sites
I have been waiting for something like this for a while, Arma just doesnt feel complete without it.

Is it possible however to have an item like a kestrel to be necessary to see windage? Or at least a keybind to turn the wind tip on/off?

Well, I'm no modeler or pbo-mod person, but scripting I can do!

You can make wind check via keypress *something like using your finger to check which direction wind is coming from or something*.

Remember, anything is possible in ArmA! :)

Share this post


Link to post
Share on other sites

I think it would be a good feature because not every soldier would be able to say "oh yea, the wind is traveling 30 knots is this direction," this would bring the need for a dedicated unit to be able to tell the rest of the team what the wind is doing, and I personally like the idea of having advanced roles other than basic "Machinegunner" and "Rifleman". Theres sure to be plenty of people around the forums who would gladly help, unfortunately, I am not skilled in models or anything of the sort. Loving it so far though, cant wait to see what you will do in the future!

---------- Post added at 09:41 ---------- Previous post was at 08:23 ----------

I seem to be having an issue with the script, all the .sqf's are in the right place, the init lines are correct, but the wind just doesnt seem to be taken into account when a shot is made. I load into a mission, it says "Bullet wind interaction system initialized ...

Wind: South" but when I shoot, no change is made to the bullets trajectory. Am I missing something very simple here?

EDIT: I found my issue, it just doesnt seem to work with the standard Stanag tracer belts. Ive tested this with the standard 30 mag tracer rounds and it works, but not with 100rnd stanag belts..... Just reporting it.

Edited by shredergenetix

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×