| | Dynamic Region dependend Weather | |
| | Author | Message |
---|
abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Dynamic Region dependend Weather Tue Oct 11, 2011 12:24 pm | |
| Cause this is a system for itself i want to seperate it here, Weather in M&B currently uses 2 variables: cloud-amount and haze-amount The first controls rain in battle-maps, the second the fog. Now the idea is to make a region depended simulation on base of this. How to store the Data - Spoiler:
The first problem i needed to solve was how to store the data (in case i go for a real detailed simulation i would use the 22 triangles i used to define the regions of the map... this means 44 variables to keep track of).
The solution is to use an dummy-troop as array to store all the data:
My current setup for this array is the following: 1..25 cloud amount amount 26..50 haze amount 51..75 connected triangle1 76..100 connected triangle2 101..125 connected triangle3 200-205 Seed triangle cloud amount 225-230 Seed triangle haze amount 250... region dependend, year-cycle cloud/haze amount (used for feeding the seeds)
This means: if i want to know what weather is in ashenborn north i will check [6] for cloud amount and [31] for haze amount.
ok, so far so fine... now how do we really simulate the weather? - Spoiler:
My first approach is the following:
We will have different scripts:
- Randomize the weather in all triangles by a certain amount This will add some noise to the weather and make sure no region have exactly the same settings than another. - Smoothing surrounding triangles (too avoid too hard jumps from one region to another) triangle = (triangle+triangle1+triangle2+triangle3) / 4 Basicly every triangle is connected with 3 other triangles (the border ones are connected with a Seed and 2 other triangles) - Initialization script, very important setup: here comes all information which triangle is connected to which, info about cloud/haze year-cycles for different regions etc.. Basicly the whole array gets filled here
- Set a single triangle : This script is used to comfortably set the seeds, but can also be used to alter a region independently (like for a special event).
- Trigger to update the weather runs 1 per hour (this includes randomizing and smoothing) - Trigger to update the cloud/haze settings for the player runs every 6 game mins - Trigger to update the Seeds runs once per day
The seeds themselves didnt get randomized or smoothed
To make the scripts a bit more automated and clean i store the info about connected triangles also in the array
In theory this should enable us to simulate a kinda dynamic looking weather wich is different in each part of the map.
Now how do we recognize all this in game? - Spoiler:
We can set everytime the global-haze and global-cloud amount. Now we check where our party is, check the weather in that region and set the global weather according to this. This means that while we travel over our map, the weather seems to change according to the weather in the region. This will also reflect in the generated battle-maps and town-visits etc...
Another idea was to include a little tag into the Time/Date showing at the lower right corner. Something like: 13.03.1256 Morning, foggy
Also, all this data is stored in a array, this means we can get access to it without any further computations needed -> so we can link this data to other stuff, for example i linked it to the movement speed script (less movspeed in foggy rainy weather)
How can we design now the climate/weather of Amala? - Spoiler:
Well to be honest, we have a huge array of possibilitys now to really make each region very unique regarding his weather situation. Let me try to explain:
We use the seed slots to define a base weather for the border regions. Something like sunny,and some clouds at Pendor Landing Cloudy, foggy at ashenborn no fog, but lots of snow at santara ... stuff like that
Then we can define for each region how much randomization they will have (see this like: lots of randomization = rough weather changes, not so much randomization its more smooth) So we can say for example: Ashenborn will have rough weather, heavy changes while Nohseru is more a smooth region, weather changes are more subtle there
Last but no least, and now it gets kinda complex: We can define a weather cycle for each region. With that i mean that we say for each month the general base weather, and this will cycle every year. This makes it possible to do stuff like: More rain in the spring, less rain and fog in summer etc...
A final note: This is a highly dynamic system. Lots of randomization, but also strict rules... What you recognize ingame tough is at first sight very subtle... but keep in mind that linking such systems creates a truly dynamic, living and breathing game-environment. EDIT: Wrote the script and tested (its still a very basic version), but so far everything seem to work very well. Weather gets updated on your position, and overall i didnt found really hard jumps in the weather conditions (its a bit hard to test currently cause i have no idea how to visualize this complex data in realtime) | |
| | | Mordred Insidious Diety
Posts : 2523 Join date : 2009-07-17
| Subject: Re: Dynamic Region dependend Weather Wed Oct 12, 2011 10:26 am | |
| I can't wait to see this weather model in game! Your excitement is contagious | |
| | | abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Re: Dynamic Region dependend Weather Wed Oct 12, 2011 7:46 pm | |
| Little update on the progress:
After lots and lots of debugging, and rewriting from scripts it seems to get stable now. Wrote a little mini-script which helps me analyze the weather situation in a given region over the amount of a year to check how the system is behaving...
Thanks to mordred we have now a detailed design about the weather-situation in each region for each of the 4 seasons. The regions influence each other (and the desired weather situation) more than i first thought, so i might need some time rebalancing the stats till its like we wanna have it...
But the good news are: i got rid of a nasty bug in the triangle collision detection (rewrote the algorithm so i dont need any more divisions, i hate m&b now for its inability to handle floating point variables =P)
Edit: I am still tweaking heavily the algorithms to get a better result. The main problem is the smoothing process right now. Cause its a very small grid overall, pendor gets for example heavy influenced by ashenborn... To make this a bit better i changed this so that the actual region wich gets smoothed counts doubles, also Seeds will count double (so they have more weight than normal regions)
Edit2: With those changes (Region that gets calculated and Seed Regions count double during smoothing process) the system behaves now way more like i wanted. Tested atm only average cloud/fog amount for the 4 seasons - The numbers i get are pretty close to what we designed.
Another thing i will try out is to use another dummy-array during the smoothing, so i dont overwrite the original data till its completely smoothed. Guess i will also compile a test-version tomorrow - so that everyone can jump in and try it out... | |
| | | abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 4:29 am | |
| Finished the main stuff... You can download my Test-Module (just unpack in module folder and play). http://www.mediafire.com/?dscpffjdkxnbczwMake sure to run with cheat-mode and edit-mode enabled (else you dont have acess to some needed features to test things out easy). Whats new: -Regional Weather system -Move Speed modification based on terrain and weather When you go to report menu there is a new menu right at the top called Weather Report. This option will take the region you are standing at this moment, and calculate the weather for this region over the amount of 1 year. It will show then min, max and average amount of cloud and fog for each season in this specific region. Note: there are 22 single regions (you can find the map of the regions in the move-speed thread, or here: http://abhuva.wordpress.com/In Camp menu there is an option "Visit Scene" or something like this... this will generate the scene in the same way like random battlefield generation will do, and take fog+rain into account. Thats good to jump fast in and get an idea how a specific region may look like (its a native feature, so i am not totally sure how exact this resamples the battlefields) Note that i am currently using natives version of fog-creation in scenes... this needs improvement too... atm up to 90 fog will have very little effect and than it jumps suddenly to an extreme (tough in the simulation i rarely ever reach 100) - i will make a mission-template trigger to make this more smooth, so that 50 fog also have an effect in the scenes. Same applies to rain, tough this seemed to be better actually. The movespeed system is tied to to the weather and the terrain. heavy fog and rain will slow you down, hilly terrain (currently only in ashenborn) will slow you down the trade road will feel like a highway instead =) Most of this stuff needs balancing etc... Just try around a bit and tell me how you like it / what needs serious balance etc.. Looking forward to all of your reports, feedbacks and critics... | |
| | | Akuthia Thought Warden
Posts : 118 Join date : 2011-09-13
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 2:14 pm | |
| just standing in one spot:
it seems like cloud cover doesnt really do anything at all until about 80 ish, and rain won't appear until 90+, and the same with fog, anything under 80 had no affect, top click was full on fog, 1 click down was semi fog, and then below that was a perfect day.
I think this is a limitation from native, so if you're not able to adjust it, i wouldnt blame your code.
edit: In general, i would expect the fog level to decrease during the day, with it's peak being in the early morning hours (either "early morning" or "dawn" in game terms.
I also wonder if every 2 hours isnt a bit frequent o be checking it. For realism sure, it's great, but i wonder how much overhead could be saved if it just checked it every 4 hours (once per day period) | |
| | | abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 3:56 pm | |
| To summarize the ideas we talked about in chat:
- fog density depending on time of day (more in the morning and evening, less during day and night) - possibility to fine tune how often weather gets updated for the player, to help minimize overhead for ppl with older comps (tough to be honest, i dont think its needed, its only very simple calculations with tables so nothing too demanding here) - battlefield / scene fog and rain better fine-tuning regarding the numbers, (50 fog should be visible already) - about the rain was my idea to interprete the rain-number not as strenght, but instead as value how great is the chance that it actually rains (like 60 means 60% chance) - depending on that make an extra entry in the table if its actually raining in an area or not (that means if we re-enter a scene during the same hour and its raining in the first it should also rain in the second) - make implementing of weather events more costumizable (setting cloud/fog/roughness and how long this effect will appear per region) | |
| | | Mordred Insidious Diety
Posts : 2523 Join date : 2009-07-17
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 4:35 pm | |
| - abhuva wrote:
- To summarize the ideas we talked about in chat:
- fog density depending on time of day (more in the morning and evening, less during day and night) I like it, nice idea. - possibility to fine tune how often weather gets updated for the player, to help minimize overhead for ppl with older comps (tough to be honest, i dont think its needed, its only very simple calculations with tables so nothing too demanding here)One thing you may wish to try to do, is make sure the checks fire on "off" times, ie when there are not many other checks going on. The start of the day is a bad time, 10:30 in the morning is probably a good time. - battlefield / scene fog and rain better fine-tuning regarding the numbers, (50 fog should be visible already) Yup - about the rain was my idea to interprete the rain-number not as strenght, but instead as value how great is the chance that it actually rains (like 60 means 60% chance) I would have used this for fog (and use a standard amount of it) for rain, I think it works on how hard it is raining. This way we can ensure that Players are always able to see in the fog, as this is the facet I am most concerned about. - depending on that make an extra entry in the table if its actually raining in an area or not (that means if we re-enter a scene during the same hour and its raining in the first it should also rain in the second) Definately - make implementing of weather events more costumizable (setting cloud/fog/roughness and how long this effect will appear per region)Customised by the Player, or us? I thought that is what we were doing already? | |
| | | Akuthia Thought Warden
Posts : 118 Join date : 2011-09-13
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 4:40 pm | |
| - Mordred wrote:
- abhuva wrote:
- To summarize the ideas we talked about in chat:
- fog density depending on time of day (more in the morning and evening, less during day and night) I like it, nice idea. - possibility to fine tune how often weather gets updated for the player, to help minimize overhead for ppl with older comps (tough to be honest, i dont think its needed, its only very simple calculations with tables so nothing too demanding here)One thing you may wish to try to do, is make sure the checks fire on "off" times, ie when there are not many other checks going on. The start of the day is a bad time, 10:30 in the morning is probably a good time. - battlefield / scene fog and rain better fine-tuning regarding the numbers, (50 fog should be visible already) Yup - about the rain was my idea to interprete the rain-number not as strenght, but instead as value how great is the chance that it actually rains (like 60 means 60% chance) I would have used this for fog (and use a standard amount of it) for rain, I think it works on how hard it is raining. This way we can ensure that Players are always able to see in the fog, as this is the facet I am most concerned about. - depending on that make an extra entry in the table if its actually raining in an area or not (that means if we re-enter a scene during the same hour and its raining in the first it should also rain in the second) Definately - make implementing of weather events more costumizable (setting cloud/fog/roughness and how long this effect will appear per region)Customised by the Player, or us? I thought that is what we were doing already? right now it is firing every two hours, or twice per time period, so i think thats every 2 hours... | |
| | | abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Re: Dynamic Region dependend Weather Thu Oct 13, 2011 5:17 pm | |
| The radioactiv, contaminated lands of the Snake Cult =) - Spoiler:
More of a prove of concept, this needs serious color-tweaking... - Quote :
Customised by the Player, or us? I thought that is what we were doing already?
The system currently is running as simulation, so we define the basic outlines, but in itself the system acts independently... The idea for weather events was that we are able to say: oh exactly now, for the next 5 hours it will be very foggy and rainy in region xy.. (like the a god comes, really angry about something and makes a storm)... So we alter the weather situation dependent on events thats going on... mhh not sure how i shall this explain better EDIT: A reminder for myself: the green fog in snake land shall be linked to 2 variables: first the distance to their capital, and second to the power of the Cult. This means when the Cult is defeated the lands will no longer appear green, also the deeper i go into snake land, the greener and the thicker the fog is (as long as the Cult is alive) | |
| | | abhuva Mind Reader
Posts : 191 Join date : 2011-06-27 Age : 44 Location : Germany
| Subject: Re: Dynamic Region dependend Weather Sat Oct 15, 2011 12:50 pm | |
| Update:
Rain will get calculated a bit more complex now: The cloud amount will only tell the percentage chance if its raining or not (and also what skybox we see) -> this means it can be cloudy without rain If its indeed raining, then it will store the strength of that rain (currently randomly choosen from 0..100) -> this means if we re-enter a scene, the rain/fog settings will always stay the same.
Also, in snake terrain, the fog you see in scene will get tweaked according to your partys distance to the snake capital. The closer you get, the thicker the fog will become. This kinda overrides the weather settings (but only for the scene, not for the actual calculations atm).
Reminder for myself, need to link this special info to the mov-speed scripts. Also: Snake troops should get a bonus for moving in fog in my opinion, else it would make no sense that they cover their terrain with fog in a magical way. | |
| | | Akuthia Thought Warden
Posts : 118 Join date : 2011-09-13
| Subject: Re: Dynamic Region dependend Weather Sat Oct 15, 2011 4:00 pm | |
| I'm not sure about a bonus, but i'd be fine with "lack of penalty", in other words, if everyone suffers 10% speed loss in fog, then the cult doesnt suffer that. | |
| | | Sponsored content
| Subject: Re: Dynamic Region dependend Weather | |
| |
| | | | Dynamic Region dependend Weather | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |