Jump to content
tortuosit

[New] Dynamic Weather script and addon, V2: @tort_DynamicWeather2

Recommended Posts

Very interesting following this!

 

@Neo, you guys talking goes way over my head, but let me ask/suggest this.  This mod to the point made earlier was controlled via UI in map view by the player.  Is it possible to allow this to be controlled by the Admin of the DED server?  So the ADMIN has the UI in the map, and this is what controls the MOD/Settings for all clients?  Obviously this would probably require that the ADMIN is running the mod...

 

IDK, maybe what i'm suggesting doesnt make sense, but wanted to throw it out there  :)

Share this post


Link to post
Share on other sites

@Neo, you guys talking goes way over my head, but let me ask/suggest this.  This mod to the point made earlier was controlled via UI in map view by the player.  Is it possible to allow this to be controlled by the Admin of the DED server?  So the ADMIN has the UI in the map, and this is what controls the MOD/Settings for all clients?  Obviously this would probably require that the ADMIN is running the mod...

 

That is quite simple and only requires one additional "if then else"-clause.

And when the script is mission side, nobody needs to run a special mod for this.

Share this post


Link to post
Share on other sites

Rain without clouds above, yeah if you don't supress it, the engine tends to do this. I will not check for cloud above player, but script helps by a) surpressing rain at all and B) a threshold for rain, i.e. you can tell it to rain only on very high overcast, so you are more safe from rain without cloud effect.

 

I didn't realize you removed it from Escape mission but that's because it's too much for my computer.

 

@jcae, that makes perfect sense. I was hoping it could work this way, Admin as a kind of "weather Zeus"... And if weather progression goes wrong he can simply correct it.

But guys MP not now, I will return to it later. Much RL, RL job survival mission, etc.

 

A problem I see is the f*** security thing in new ArmA version, which requires "-filePatching flag and code to be inside pbo/ no absolute paths. I guess this may be an issue with MP.

I don't want to put things into pbo and mess with paths again...

I see A LOT of mod trouble after they introduce this.

 

re: "Another idea: Why don't you use the function library? That would make everything much more portable!"

I must admit I never really looked into this. My only knowledge is, there are some BIS made libraries and functions. Don't know much more.

Share this post


Link to post
Share on other sites

Currently experimenting/balancing fog decay vs. players altitude level. The more compressed[1] it is, the more unlikely at will exceed player altitude on any checks. Altitude checks are randomized to reasonable time frames. It's all a bit about realism vs. playability. I think it works pretty well. It's of course unrealistic that fog behaves dependent on where your position is. But I make it so that you should not really recognize that dependency.

I will make player altitude dependent fog the default. This way compressed fog can be used (in ArmA setfog array: high decay values). If MP (not yet implemeted) or player dependent fog is off, normal fog is used.

 

[1] I mean the fog with sharper edges, which you may see in valleys, but you are not affected at higher altitude.

 

Also doing some variable and array changes, error prone thing, I want to update mod end of next week.

  • Like 1

Share this post


Link to post
Share on other sites

Just a playground, I come up with something more balanced and documented next week - please don't upload onto SIX/Armaholic. Link not on first page. Probably a lot of balancing needed. Also parameters, arrays, orders will change and are not 100% documented any more.

 

https://www.dropbox.com/s/8zjsp0tdms0k8u9/%40tort_DynamicWeather2_0.98test.7z?dl=0

 

- quite a few calculation changes

- Reworked fog, some changes to turbulence factor. Again usage of advanced features (decay/base level), they are being used by default, currently in a more random manner. Results are sometimes not as easy to understand as with normal fog, its not as simple. If sharp fog is produced, it may end some meters below your feet, you have clear vision and depending on the terrain, you may not even see fog below you, in case of elevated plains or if you have no FOV to valleys. Those features are only used if player (altitude) dependent fog is used.

- Started making it possible to run "script only" (i.e. no mod loading necessary), not finished.

- Some tuning to existing island definitions. E.g., gave Chernarus_Winter some nicely bad and foggy weather. Love that map. As I have no snow, I turned rain off for this map.

 

Files of interest btw are:

\@tort_DynamicWeather2\script\config\islands.sqf (per island weather definitions)
\@tort_DynamicWeather2\script\config\templates.sqf (Template definitions which appear in the map menu)
- reworked template definitions and gave them the same Syntax as island definitions.
- wind array refinement, there are simple parameters like [.., random 360,..., -60, 60, ...] which means, wind comes initially from a random direction X and moves 60° +/-.
 

Things are balanced differently, numbers have changed. As for the fog, maybe things run to fast, I will see how numbers work. Use with caution :) But it's definitely beautiful at times to see some dense fog in valleys.

 

Its this array in above mentioned files:

tort_island_fog2 = [0, 0.1, -10, 0, true];

It uses DECAY and BASE from https://community.bistudio.com/wiki/setFog_array

 

My script as always defines upper and lower bounds and moves in between. And in above case that means:

[DECAYMIN=0, DECAYMAX = 0.1, BASEMIN -10, BASEMAX 0, PLAYERDEPENDENT=true]

 

A decay value of 0 means fully spread fog (normal ArmA fog). Decay 0.1 is already pretty condensed, usually you don't use higher values, which make fog border sharper. But probability for sharper fog is lower.

Base in case of player dependent fog means relative to player vertical position. So very sharp fog here will end somewhere -10 to 0m below player. If player isn't flying. I've put thought into updating the player vertical level, so fog does not instantly follow the player, that would look stupid.

 

No work on MP yet, things will have to be settled first, definitely not this year, but it's on my agenda.

  • Like 1

Share this post


Link to post
Share on other sites

OK as I already have expected I cannot simply set the fog decay values at certain times in a complete random range, result is waaaaaay too quick changes. Will have to let them cycle smoothly as well.

Share this post


Link to post
Share on other sites

v 0.9.8.3: https://www.dropbox.com/s/nxw57bodb7dhson/%40tort_DynamicWeather2_0.9.8.3.7z?dl=0

 

- Island specific pseudo random wind directions

- Existing templates (except "Shuffle") do not change wind direction

 

This is an idea I had for navigation/survivalist like missions... Now any time you load up a specific map, wind mostly comes from the same direction (range) on that map. Exceptions may occur, but basically you can navigate by wind direction as well, if you have no compass. Example: Altis wind range is between [60°..128°]. 

 

Wrote this neat little hash function for this, fun with modulus and prime numbers... Thing with ArmA is, it only has int precision (AFAIK) of 10^7, i.e. internally no numbers bigger than 10^7 should be used. Therefore the rather small mod 297371 is happening.

strhash = {
      /* In:  str string, int length, (optional: integer salt)
         Out: int hash [0..length-1]
         I think this hash function works pretty well with the prime numbers I
         chose, in terms of collisions/distribution/spreading/no patterns.
         - tortuosit */
   private _hash = 7;
   if ((count _this) == 3) then {_hash = _hash + (_this select 2)}; //+SALT
   private _string_array = toArray (_this select 0);
   for "_i" from 0 to ((count _string_array) - 1) do {_hash = (_hash * 33 + 2897 * (_string_array select _i)) % 297371};
   floor(_hash % (_this select 1))
};
  • Like 1

Share this post


Link to post
Share on other sites

Is this going to become multiplayer-compatible at some point?

I hope so, as every weather script I've tried so far is either broken or breaks something else.

Share this post


Link to post
Share on other sites

Is this going to become multiplayer-compatible at some point?

I hope so, as every weather script I've tried so far is either broken or breaks something else.

 

Yes I will definitely do it, read conversation with Neoarmageddon here in this thread. When it's balanced enough and when I've got some more time. Early 2016 I think.

  • Like 4

Share this post


Link to post
Share on other sites

I'm sorry I can't do much these days. What I worked on...:

Problem: Dense fog with sharp edges, may sometimes not appear if created below the player, this usually happens on flat terrains.

Solution: Script regularly makes an assumption about the terrain - checks elevation in a circle with 2 km radius. If on ground.

Share this post


Link to post
Share on other sites

Version 0.9.8.4

- Worked on fog. To better support the sharp edged fog, the script scans area around player (radius 1000m)[1] in order to determine optimal fog height. Fog height rather conservative, i.e. sharp fog is usually below your feet.

- Added menu entries for fog characteristics (sharp vs. loose)

- Some islands have been added IIRC... small tweaks to presets, e.g. "Postapocalytic II" has some (ground)fog.

 

As for fog, I am interested if transitions appear too fast sometimes.

I have not forgotten you guys want MP but currently I can't. But I will.

 

[1] Useful function btw, which returns for <n> points in radius <r> on a spiral with <x> rotations, (compared with player above sea level):

average height of lower points - average height of higher points - # of lower - # of higher - lowest point - highest point

  • Like 1

Share this post


Link to post
Share on other sites

How do I control weather in the newest version? I dont get any options on 0-8 menu, also I cant find the modules in the editor, the mod is installed though.

Share this post


Link to post
Share on other sites

open your map during gameplay and you will see it in the menus on the top left  :)  Full control!

Share this post


Link to post
Share on other sites

Nope, not getting anything. I have CBA installed. In other mods I have ALiVE and ACE installed as well.

 

I dont get any info on starting mission or anything that would imply that the addon version of Dynamic Weather is running. I have redownloaded the mod just in case. Installed using the Arma launcher.

Share this post


Link to post
Share on other sites

Taro, are you on dev or stable ArmA? I use dev version lately, there should be no difference. Maybe it's a missing -filePatching flag on your side.

 

ArmA call (which should work on Winx64) for comparison (sorry for the format, can't handle this forums editor any more)...:

[code]"c:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3.exe"  -nosplash -skipIntro -filePatching "-mod=@CBA_A3;@tort_dynamicWeather2"[/code]
 
You should have on your hard disk:
 
[Steamappscommon]\Arma 3\@tort_DynamicWeather2\addons\
[Steamappscommon]\Arma 3\@tort_DynamicWeather2\script\
[Steamappscommon]\Arma 3\@tort_DynamicWeather2\mod.cpp
[Steamappscommon]\Arma 3\@tort_DynamicWeather2\readme.txt[/code]

Share this post


Link to post
Share on other sites

It was the -filePatching parameter I was missing. Redme's and description on armaholic could use of an update.

 

Thanks for help, it works now.

Share this post


Link to post
Share on other sites

Tortuosit: still SP only?

 

Icebreakr: yes.

 

MP is the next bigger thing that I will do, takes a bit of effort because I need others to ask and test, also needs some code and module interface reorg.

Plans are as follows: just small changes, if any, in the next 2 weeks, then I'm on holidays for another 2 weeks, then I want to start on making it MP ready.

  • Like 1

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

×