Jump to content
Sign in to follow this  
tortuosit

Dynamic weather script and addon: tort_DynamicWeather

Recommended Posts

@tortuosit

May I help you with MP scripting? I already helped meatball to make his script MP compatible.

And since BIS made weather serverside, there shouldn't be much to do.

Also it looks like you derived your script from a very old version of meatball's script. Not the newest one.

Share this post


Link to post
Share on other sites

Yes it's alright. Please have a look into it and tell me what you think should be done for MP. Yeah, I feel I should use more functions (because some code is appearing more than once, but I need to look into how functions work), also in MP I think I need to be more careful about variable scope. It's correct, derivate of an early meatball script. Would also be no problem if you fork it for MP. I'm not an ArmA scripting guru btw.

Share this post


Link to post
Share on other sites

This is such a great mod. I love it how it affects all the missions even the campaign ones making everything more dynamic. You sir rock :)

Share this post


Link to post
Share on other sites

Thanks! Bugfix release 1.0.9.3 - recommended, as in some cases user defined values did not work.

Share this post


Link to post
Share on other sites

I've reverted back to 1.0.9.1 ( from 1.0.9.3 ) because the weather always start's as sunny even though I set it to random.

Share this post


Link to post
Share on other sites
I've reverted back to 1.0.9.1 ( from 1.0.9.3 ) because the weather always start's as sunny even though I set it to random.

I broke it for the addon release; fixed.

Share this post


Link to post
Share on other sites

Guys, I had this idea: instead of using the normal random() function, I implemented a seeded pseudo random number generator and replaced all random calls with my seeded one. You can say that he script does 15 random calculations per weather cycle.

So that means, you will be able to pass a seed number to the script or mod and will get deterministic random weather depending on that seed. Short: Same seed, same weather development. If you replay, you get the same weather as before. What do you think? I love the idea. Maximum number of possible seeds is -- 1.000.000.

It works already well. But I'm still testing as sometimes the function call gives me unexpected values.

EDIT: This is the seeded one. Not yet on first posting: http://www17.zippyshare.com/v/86254836/file.html

Script version: add the seed number as the last argument to the execvm call.

Addon version: use the new userconfig file, you can configure the seed number at the end.

Will probably contain bugs; if so please tell me all the details how it has been called (seed number, preset etc.).

Edited by tortuosit

Share this post


Link to post
Share on other sites

I don't know about the others but I still very much prefer the no seed one. The seed one seems to take a lot of randomness out of it by starting.

Also there is an error that says ( Error undefined error in expression frain ) on the non seed version-

Share this post


Link to post
Share on other sites
I don't know about the others but I still very much prefer the no seed one. The seed one seems to take a lot of randomness out of it by starting.

Hmm, it shouldn't (if its coded correctly), all random numbers are in the same random range as in the nonseeded version, the only difference shoud be, if you choose the same arguments (including the seed), you will get exactly the same weather at a new mission start.

Also there is an error that says ( Error undefined error in expression frain ) on the non seed version-

Thx, please tell me the line number if possible. EDIT: nevermind, I found the error. 1st posting updated.

Also, I think you should give the seeded one another try (also redownload, there also was the fRain bug). If you like how weather turned out, remember the seed number, and you will get the same weather again, I like it.

Edited by tortuosit

Share this post


Link to post
Share on other sites
you will get exactly the same weather at a new mission start.

This last part is what I'm talking about. I love right now how you start a mission and the weather is completely random. Maybe you can make 2 version of this mod?

Share this post


Link to post
Share on other sites

Hey tortuosit, 'll give the seeded a try first opportunity, after work today, might need my hand held a bit :)

Share this post


Link to post
Share on other sites
This last part is what I'm talking about. I love right now how you start a mission and the weather is completely random. Maybe you can make 2 version of this mod?

Hey Denco, I think there is a misunderstanding on your side! You will get different weather (given that you chose some random preset ) at every start:

- if you leave "randomSeed = 0;" in the userconfig file. DEFAULT! (then it randomly chooses a seed out of 1 million).

- if you set the last argument in the script call to 0 DEFAULT

So per default you get completely random weather out of 1 Mio. random "weathers". And you have the opportunity to keep the seed number in mind (mod and script tell it in the beginning)!

You see? You don't lose anything, but you have more possibilities! E.g.: mission makers can set debug level to 2 and then already see pretty quickly, how the weather will be.

Edited by tortuosit

Share this post


Link to post
Share on other sites
You see? You don't lose anything, but you have more possibilities! E.g.: mission makers can set debug level to 2 and then already see pretty quickly, how the weather will be.

Then I'm down for it :)

---------- Post added at 08:03 PM ---------- Previous post was at 06:56 PM ----------

Also what's the difference between random and freecylce?

Share this post


Link to post
Share on other sites

Much improved seeded version which soon will be the only package, but is still not on first page.

http://www17.zippyshare.com/v/86254836/file.html

I fixed (hopefully) all bugs where variables were not assigned (happened, because I replaced like 50 random statements, some errors with copy/paste).

Also fixed tooo extreme fog distribution by having a minimum value of 0.01 as the decay value in ArmAs setfog array.

If there's still script errors, please let me know, maybe also the seed number and of course code line.

@Denco: "random" trend means, you get a completely new random weather set at every next cycle step (which is at max. 30 minutes). Random trend disregards the min/max variation arguments. It still takes time until it is there though. No weather is applied harsh.

"freeCycle" means, the weather is walking smoothly between the extreme (min/max) values, like a leaf in the wind.

Lets say Overcast min/max is 0-1. And maximum variation = 0.2

Then overcast can go like this:

[Freecycle] 0.1, up:0.25, up:0.39, up:0.45, down:0.40, up:0.51, up:0.68, up:0.69, down:0.55

In pBetter theres a higher probability for going down, pWorse for going up

worse/better always go down or up.

Whereas in "random": 0.2,0.9,0.5,0.22,0.67 etc...

Edited by tortuosit

Share this post


Link to post
Share on other sites

I also noticed that the fog is always present. I've tried at least 30 new start's and there was always fog present even when the weather was nice.

EDIT: I've tried adjusting min/max values for the fog to 0 and it still shows up. I didn't had much chance to test the 1.0.9.1 version but I believe it didn't had this problem.

Edited by Denco

Share this post


Link to post
Share on other sites

Sorry, you are right. Checking for empty arrays etc. was buggy. Also random number generator improvement, it also should not drop script errors any more.

Please try v.1.1.1 http://www72.zippyshare.com/v/31108052/file.html

In the script version, if you leave out arguments please only from right to left.

In both versions: please fill arrays completely.

Share this post


Link to post
Share on other sites

Hey tortuosit, I know you have said this is for SP, but have you tried MP, or given thought to an MP compatible system (that works) ?

Looks like a holy grail if you could pull it off.

Share this post


Link to post
Share on other sites

Kremator, I will implement MP, NeoArmageddon provided me some information and code. It's just a question of time, and I need to understand first what I do there before I can put it in.

Version 1.1.1 is on the first page. Main change is that now we have "deterministic" (ArmA engines decisions) weather progression based on an own seeded random number generator.

v1.1.1 up, with a seeded random number generator!

In short words, with the same settings and the same seed number you will get the same weather. So if you liked the weather you have seen while playing, keep the seed number in mind. It is displayed at the beginning of a mission and at every weather forecast, if you turned on hints with debug level 1. I may write it to rpt at some point. I must say I'm pretty enthusiatic about the idea.

Guys please have a look at the fog behaviour, I'm interested in whatever observations. I'm somewhat under the impression that it behaves differently on Stratis and Altis. But have no time for testing much. Well Stratis has more steeper hills and Altis is more flat, so it seems you may need much higher values on Stratis, whereas on Altis you easily have too much fog.

Edited by tortuosit

Share this post


Link to post
Share on other sites

Oh bro, nice idea with the seed number :) I'm trying to build a mission based with lots of fog so will try to observe any differences.

Share this post


Link to post
Share on other sites
Guest

New version frontpaged on the Armaholic homepage.

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

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Edited by Guest
updated to latest

Share this post


Link to post
Share on other sites

Version 1.1.2

- Changed the parameter "probRndChange". Its the probability of a random weather event happening, which you e.g. may use to spice up a "constant" trend. You can define it as an array now, first value is probability of such an event to happen (respecting the minimum and maximum values) and the second argument the probability, if such an event happens, of it not respecting min/max. Old command line is compatible.

Addon users: Please use the new userconfig file, otherwise you receive a "probRndChange" error message at mission start.

- sleep (and hence weather progression time) values were seriously flawed, fixed.

- [script version] As the command line got pretty complicated, I added a script tort_DW_presets.sqf with some more or less meaningful presets, arguments are just a preset name and debug level. The sqf has the info.

- made code more readable

- introduced a global variable (boolean) "tort_dynamicweather", mission makers can check if my script/mod is running.

- in addon version, you can only use a fixed array for initial weather, not the preset names.

Edited by tortuosit

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  

×