Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » weather code cell climate bug?
Forum Rules | Mark all | Recent Posts

weather code cell climate bug?
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2, 3 next >>
Post is unread #21 Apr 10, 2008, 7:59 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Um...

Llarn said:


// These two functions here seem to be preventing my desert climate temperatures from going past 40 degrees
CalculateCellToCellChanges( );
EnforceClimateConditions( );


You're obviously not reading the comments in the code. Those ARE the weather system. >.> The cells won't ever change if you take those out. You're completely butchering a system built around balance. If you give me a couple days to work this out, I'll have a fix. But trying to fix it on your own isn't working.

RandomizeCells, is only called in time_update for a reason. It completely randomizes the values of the cells. This is done to simulate those days where it's bright sunny, you go to sleep and the next morning, you've got clouds as far as the eye can see, and you're in a severe thunderstorm warning.

Removing CalculateCellToCellChanges() stops the map from functioning. It won't EVER change without that function. You won't get crashes, you won't get anything. because the map and the system aren't DOING anything.

Removing EnforceClimateConditions() won't fix your problem, it will make it work. EnforceClimateConditions() is the function that reads those climate flags, and does it's best to keep the weather for the cell within normal limits.

If you do what you're planning, You're effectively making your installation WORSE then what it was designed to replace...

Llarn said:

I think that maybe the problem with the weather code.

Just stop thinking, and read the code. Look at the comments, and learn what it's doing. It's perfectly clear to me that you haven't because of what you're planning on doing.

And sorry if I sound a bit snippy, but I put 9 months worth of blood, sweat, and tears into this system, and you effectively want to turn it into a bunch of cells with random numbers every update. Which is worse then the original system. It at least kept propagating changes.
       
Post is unread #22 Apr 10, 2008, 8:00 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

if(!str_cmp(arg3, "temperature";))
{
if( !arg4 || arg4[0] == '\0' )
{
send_to_char( "Usage: setweather <x> <y> temperature <degrees>\r\n", ch );
return;
}

value = atoi( arg4 );

if(value < -50 || value > 140 )
{
ch_printf( ch, "Illegal temperature: %s\r\n", arg4 );
return;
}
cell->temperature = value;
send_to_char("Cell Temperature Set.\n\r", ch);
return;
}


I did that and

void UpdateWeather( void )
{
ClearWeatherDeltas( );
// CalculateCellToCellChanges( );
// EnforceClimateConditions( );
RandomizeCells( );
ApplyDeltaChanges( );
save_weathermap( );
}

Now I can set temperatures to anything I want in each cell, I might remove RandomizeCells from updateweather though as it is already in timeupdate in update.c I'll take a look and see if it is needed.
       
Post is unread #23 Apr 10, 2008, 8:02 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

You've effectively rendered the entire system completely useless.
       
Post is unread #24 Apr 10, 2008, 8:03 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Everyone needs to step back, breathe, and not let this get out of control. There's no need to turn this into a fight between you two over misunderstanding how the code functions. Hell, I don't fully understand it because I haven't taken the time yet to really go over it. Which is why I haven't commented one way or the other except to ask how the cells were configured.

It seems to me, from my limited grasp, that the code is doing as it's been instructed by the climate settings that were given to it. It has arctic, desert, and rainforest all touching each other. There's bound to be some unexpected extremes with everything so close together like that.
       
Post is unread #25 Apr 10, 2008, 8:13 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

Sorry guys,

I'm however not mad at Kayle by any means, just posting findings as I try to work with the weather code.
I know his system is designed to be related to other cells, as his intent was clear. I just prefer to be
able to control mine with a single command for each climate. Then assign what climate I want to each
area, instead of having to make a big weathermap. I truly appreciate all the time Kayle has put into this
code it was a huge improvement over old.
       
Post is unread #26 Apr 10, 2008, 8:17 pm   Last edited Apr 10, 2008, 8:21 pm by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Llarn, with the changes you've made, you've rendered the system completely useless. It's not functioning the way it was designed, should that have turned out to be a legitimate bug when I got down to it, With your changes as they are now, I wouldn't be able to help you anyway.

As of right now, you're in unexplored territory, and I can't guarantee satisfactory results. Nor can I offer any help with what you've done.

I apologize for reacting the way I did, but everything I said is true, just needed to be said in a more polite way.

I documented every step in the comments, and I tried my best to explain the system in full in the documentation that was provided with the snippet. If you'd like to find the true fix for the issue, please, read over the documentation, read through the comments in the code, and put everything back to the way it was designed to be run. Without these steps I can't really help you.

The system isn't something you can just comment things out of at random without understanding what they do. One tiny change can throw off all the mathematical computations in the system.

[Edit:]
Llarn said:

I just prefer to be able to control mine with a single command for each climate.

If that's what you're looking for this system is not what you need. This system is designed to run itself, with no outside intervention. If you want total control, you'll want to write/use a different system.
       
Post is unread #27 Apr 10, 2008, 8:26 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Llarn,

I'm assuming since this is in the snippet forum that it would be right to assume you installed this separately from the codebase?

If so, then it honestly seems to me that the new system isn't right for the needs you have. It happens sometimes. Just like AFKMud doesn't meet the needs of a lot of people, or SmaugFUSS may not be what they're looking for. Usually in cases like this its best to stop and reevaluate what you want from the code, and if the new stuff isn't fit, use the old stuff you had before. I doubt anyone is going to get bent out of shape if the code doesn't fit what you want.
       
Post is unread #28 Apr 10, 2008, 8:43 pm   Last edited Sep 7, 2010, 4:08 pm by Samson
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Llarn,

I'm having a helluva time simulating this, I've set my cells up identically to the ones you posted, and I can't get it to match your readings. Can you email me your weather.c and weather.h files? My email is kayle -AT- malevolentwhispers.org (Obviously replace the -AT- with @).

[Edit:] Also, could you include weathermap.dat as well?
       
Post is unread #29 Apr 11, 2008, 6:45 pm
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

Samson said:

It seems to me, from my limited grasp, that the code is doing as it's been instructed by the climate settings that were given to it. It has arctic, desert, and rainforest all touching each other. There's bound to be some unexpected extremes with everything so close together like that.


That's why I was wondering if increasing the number of cells would help create a more stable system. I admit that I haven't perused the code, so it may not work that way at all, but with more cells in the system, it seems that the boundaries would be limited to two types of climates, and the transitions wouldn't be so extreme.

Of course, it's really very cool that you get extreme results from violently clashing climates in close proximity. It would be ideal for a chaos zone (think wild magic), and would keep meteorologists up late trying to figure it out. :)
       
Post is unread #30 Apr 12, 2008, 11:10 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

The way the system is written, You can't assign an area to more than one cell. An whether that would make it more stable remains to be seen, I still am unable to reproduce any of the problems Llarn was having. and without his files, I honestly can't say whether it was a bug of his own making, or a flaw in the system itself.
       
Post is unread #31 Apr 12, 2008, 4:54 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007


Kayle said:

The way the system is written, You can't assign an area to more than one cell. An whether that would make it more stable remains to be seen, I still am unable to reproduce any of the problems Llarn was having. and without his files, I honestly can't say whether it was a bug of his own making, or a flaw in the system itself.


Wow, you mean for every area I create I would have to make another weather cell? If that is the case then I have done it wrong from the start, with many areas assigned to the same cell. That would also mean hundreds of cells in the future.

       
Post is unread #32 Apr 12, 2008, 5:07 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

I think Kayle said that you can't have one area in many cells, but not that you can't have one cell with many areas.

That is, the area --> cell relationship is many to one, not one to many or many to many.
       
Post is unread #33 Apr 12, 2008, 11:54 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Right, The cells can have any number of areas assigned to them. As a matter of fact, once installed, all areas default to cell (0,0) until told otherwise by the use of aset. You could literally build your entire mud, with 100s of areas on a weather map of 4x4 dimensions, which would give you enough cells to create an entire world layout similar to earth with arctic cells at 0,0 and 4,4 and climates varying to the tropical line in the center, You would of course have to tilt your square map on one corner to make it a diamond but it would effectively look like:

 --- --- --- ---
|Arc|Tai|DF |RF |
 --- --- --- ---
|Tu | Sa| De|DF |
 --- --- --- ---
|DF |De |Sa |Tai|
 --- --- --- ---
|RF |DF |TU |Arc|
 --- --- --- ---
 

Arc = Arctic, Tai = Taiga, Tu = Tundra, DF = Deciduous Forest, RF = Rainforest, Sa = Savanna, De = Desert.
I don't recall if those are all actual climate controllers in the system, I haven't looked at the code in a couple days, been distracted with RL issues, and a tiny depressive bout (PTSD before it gets asked. :P), But This mimics Earth as closely as I could make it at almost 3am. But you could assign any number of areas to each of those cells, with that one 16 cell influence map you could literally map 16,000 areas to it. And the system wouldn't slow down one bit.

The reason for this is that the weather system doesn't give a flying pigs ass about the areas. There's one function in the entire system that even looks at areas, and that's WeatherMessage(), And it's only looking to see if the areas WeatherX and WeatherY match the cells coords. My goal with the system was to get rid of the weathers reliance on the areas, and make it it's own entity, because Weather on Earth doesn't care about the areas it's in. It only cares about flow and pattern.

The system mimics real weather, to the best of my ability and knowledge, I'm no meteorologist of course, but I did my research, I planned, and I tested, and I retested. The math involved took several days of tweaking and testing, and monitoring to get to a point where it worked. Even now, I'm not 100% sure it's all correct, but after 9 months, I felt reasonable confident that it was close enough for public exhibition. Llarn's been a great help with the previous issues he discovered, most of them were extremely easy to recreate. The one this thread discusses however was not. I've still yet to be able to recreate it. But I am willing to work on it, if I can recreate it. This weather system is like my baby, kinda like the Overland is to Samson, granted he put a years worth of work into his, and mine only took 9 months, but Hey, a human life can grow and develop in the womb in 9 months. Anyway, I've rambled enough, hopefully what i've said is understandable. I've been told a lot lately that I'm not easy to understand...
       
Post is unread #34 Apr 14, 2008, 8:56 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

Very good explaination Kayle, thanks!

It seems to me that having more cells in the system would allow for a finer control over transitions between weather patterns. That is, a 3x3 system has less space, so if you want both arctic and desert climates to exist, they end up pretty close to one another. If you expand to a 5x5 system, you can put milder climates between them, which would make their neighboring cell influences less abrupt.

If my thinking is right on this, you could create intentionally more violent climate cells by putting opposing climates in adjacent cells.

Looking at it this way, if you have 50 zones, you can point each zone at whatever cell you want, but if you don't keep a (hand drawn!) map of the physical layout of your zones, you won't be able to predict how their weather will change over time, since if you assign "the snow-capped mountains" to an arctic cell that's adjacent to a taiga, it will behave differently than the adjacent "ice caverns" zone you assigned to a different artic cell that's adjacent to a deciduous forest.

It's very interesting... makes me wish my PHP skills were a little better. I think it would be very interesting to shove the cell data values into a database and graphically animate the changes over time for each cell in the grid.
       
Post is unread #35 Apr 15, 2008, 12:13 am   Last edited Apr 15, 2008, 12:16 am by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Before I had to input the randomization factor into it, that probably would have been a great idea, but as it stands, I had to toss in a nightly randomize the values within acceptable limits function to keep the cells from reaching equilibrium and failing to change. I really need to work on that and fine tune the system more. But it works for now, and you get the real world random aspects of weather. :P Hate those nights where it's nice and warm, clear sky, PERFECT for stargazing. go to sleep, wake up the next morning, and it's !&^#@&* snowing, overcast and cold as hell. >.< But it's possible, even in this system with the right climate and hemisphere settings. :P

[Edit:] As a side note, the system MW is running, is using a map with the dimensions 22 x 9. And areas are assigned to cells based on where on the world map they fall, which we have an overlay that we can apply to show us the weather cells. <3 Kinko's. They do such fantastic work. (Now, if only I could finish working on the layout of the worldmap so that there are actually different climates to assign to the cells. :P )
       
Post is unread #36 May 8, 2008, 12:08 am   Last edited May 8, 2008, 12:42 am by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

Kayle,

I decided to give your system another chance. I restored weather.c and weather.h to smaugfuss status.
I made a 11x11 grid this time instead of 3x3 cause you guys say may need more cells by it.

I did cells ( 10, 10 ), ( 10, 9 ), ( 10, 8 ), ( 9, 10 ) ( 9, 9 ), ( 9, 8 ), ( 8, 10 ), ( 8, 9 ), ( 8, 8 ) all northern arctic

weather updated and got 50 degrees in arctic climate in autum season for cell 10, 10

I did the opposite in ( 10, 0 ), ( 10, 1 ) ( 10, 2 ) ( 9, 0 ) ( 9, 1) ( 9, 2 ) ( 8, 0 ) ( 8, 1 ) ( 8, 2) all southern desert

weather updated and got 24 degrees for the desert climate in autum season in cell 10, 0

Some other fixes you may want to include are showweather ifchecks don't properly see if your at maxweatherx and y or not, = crash. A friend of mine provided this fix for showweather.

void do_showweather( CHAR_DATA *ch, char *argument )
{
char arg[MIL], arg2[MIL];
int x, y;

argument = one_argument( argument, arg );
argument = one_argument( argument, arg2 );

if( IS_NPC( ch ) )
{
send_to_char( "Mob's can't showweather.\r\n", ch );
return;
}

if( !ch->desc )
{
send_to_char( "Nice try, but You have no descriptor.\r\n", ch );
return;
}

if( !arg || arg[0] == '\0' || !arg2 || arg2[0] == '\0' )
{
send_to_char( "Syntax: showweather <x> <y>\r\n", ch );
return;
}

x = atoi( arg );
y = atoi( arg2 );

if( x < 0 || x > WEATHER_SIZE_X-1 )
{

ch_printf( ch, "X value must be between 0 and %d.\r\n", WEATHER_SIZE_X-1 );
return;
}
if( y < 0 || y > WEATHER_SIZE_Y-1 )
{

ch_printf( ch, "Y value must be between 0 and %d.\r\n", WEATHER_SIZE_Y-1 );
return;
}

struct WeatherCell *cell = &weatherMap[x][y];

ch_printf_color( ch, "Current Weather State for:\r\n" );
ch_printf_color( ch, "&WCell (&w%d&W, &w%d&W)&D\r\n", x, y );
ch_printf_color( ch, "&WClimate: &w%s&D\r\n", flag_string( cell->climate, climate_names ) );
ch_printf_color( ch, "&WHemisphere: &w%s&D\r\n", flag_string( cell->hemisphere, hemisphere_name ) );
ch_printf_color( ch, "&WCloud Cover: &w%d&D\r\n", cell->cloudcover );
ch_printf_color( ch, "&WEnergy: &w%d&D\r\n", cell->energy );
ch_printf_color( ch, "&WTemperature: &w%d&D\r\n", cell->temperature );
ch_printf_color( ch, "&WPressure: &w%d&D\r\n", cell->pressure );
ch_printf_color( ch, "&WHumidity: &w%d&D\r\n", cell->humidity );
ch_printf_color( ch, "&WPrecipitation: &w%d&D\r\n", cell->precipitation );
ch_printf_color( ch, "&WWind Speed XAxis: &w%d&D\r\n", cell->windSpeedX );
ch_printf_color( ch, "&WWind Speed YAxis: &w%d&D\r\n", cell->windSpeedY );

}

setweather will let you set the weather of a cell that doesn't exist for example if you have x and y set to 10
in weather.h it doesn't take into account 0. Thus it will let you setweather for 10, even though 9 is technically
your max. I just made it -1 for setweather and showweather and seems to fix that issue.




       
Post is unread #37 May 8, 2008, 12:16 pm   Last edited May 8, 2008, 12:23 pm by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

The next day in winter season at 4am mud time I get these results. Maybe something is wrong with autumn season?

Current Weather State for:
Cell (10, 0)
Climate: desert
Hemisphere: southern
Cloud Cover: 37
Energy: 39
Temperature: 100
Pressure: 100
Humidity: 28
Precipitation: 4
Wind Speed XAxis: -2
Wind Speed YAxis: -7

Current Weather State for:
Cell (10, 10)
Climate: arctic
Hemisphere: northern
Cloud Cover: 100
Energy: 79
Temperature: 15
Pressure: 25
Humidity: 21
Precipitation: 32
Wind Speed XAxis: -94
Wind Speed YAxis: -95


       
Post is unread #38 May 8, 2008, 12:31 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

It might be. I'll look into it. Thanks for the further information. :)
       
Post is unread #39 May 8, 2008, 12:32 pm
Go to the top of the page
Go to the bottom of the page

kiro_san
Fledgling
GroupMembers
Posts23
JoinedJan 27, 2007

Earlier today around 12 or some such, cell 10 10 was at -30 degrees. so It fluctuates alot, and some of the artic cells actually reached up into the seventies.
       
Post is unread #40 Oct 14, 2009, 9:15 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

I found this problem


Current Weather State for:
Cell (4, 2)
Climate: desert
Hemispere: southern
Cloud Cover: 14
Energy: 38
Temperature: 40
Pressure: 2
Humidity: 28
Precipitation: 0
Wind Speed XAxis: 3
Wind Speed YAxis: 0


Shouldn't a desert be higher than 40?
       
Pages:<< prev 1, 2, 3 next >>