Log in

View Full Version : Does it ever rain?


Sourdough35
02-24-2012, 04:14 AM
I have not seen any yet.

lerxst2112
02-24-2012, 05:47 AM
If the zone has a weather type of 1-3 it will eventually happen. You can also force it with a script.

louis1016
02-24-2012, 07:12 AM
The weather is on a random timer in the eqemu code, but the timer is coded in a way so the timer will never go off early after a zone starts, so unless your zone has been booted up for a while chances are you wont see weather effects. The code has been designed for zones that are booted up for hours. open up the source and search for the "weather_timer" and take a look and change it however you see fit. Reducing the timer to suit your server needs is the best way to go

Sourdough35
02-25-2012, 01:30 AM
Not really sure how to edit the server source or search for data so I may leave it as it is, although I'd prefer it to rain more often, or ever.

Does the timer reset every time I enter a zone? Or do I just need enough consecutive time there to trigger the rains?

Sourdough35
02-25-2012, 02:25 AM
Scratch that. I installed everything I needed and am looking at the source in Visual C++

Found weather_timer entries in zone.cpp

But there are many of them and it's not really clear what to do. Anyone able to help?

Is it this one

autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false);
Weather_Timer = new Timer((MakeRandomInt(1800, 7200) + 30) * 2000);
Weather_Timer->Start();
LogFile->write(EQEMuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000);
weather_type = 0;
zone_weather = 0;
blocked_spells = NULL;
totalBS = 0;
aas = NULL;
totalAAs = 0;
gottime = false;


What happens if I set all the numbers to 0? What I want to do is just disable the time a zone waits before the random weather rules kick in. Going to set the numbers in Weather_Timer = new Timer((MakeRandomInt(1800, 7200) + 30) * 2000); to all 1 and see what happens.

lerxst2112
02-25-2012, 03:26 AM
Those are milliseconds, so anywhere from 3660 seconds to 14460 seconds, as it would put in the log when the zone starts up.

Those seem like some fairly arbitrary numbers, so making them smaller shouldn't cause you any issues. 1 will be instant pretty much assuming the random check passes.

You'll also probably want to change the calculation just above Weather_Timer->Start(weatherTime); in the same file.

Sourdough35
02-25-2012, 06:21 PM
Changing everything to 0 just makes it flicker rapidly between rain, fog, and clear over and over. Not really sure I know what I'm doing. It looks like the server won't open a zone to random weather until it has been booted for 240 minutes. Does that reset every time I leave the zone or log out? Or does it keep a running track of how long a zone has been booted and after a few hours logged, opens it up?

And is there any way in the database to force random weather?

lerxst2112
02-25-2012, 08:51 PM
Well, the values set when the zone is loaded determine when the first check is. The second set determine when the next check is. You'd need to find a balance for those that does what you're looking for. If you set them all to very low values then the changes will be frequent. The values are in milliseconds, so if you set them to something between 300000 and 600000 it would change every 5-10 minutes.

You can also change the weather from a script if that is easier.

Sourdough35
03-03-2012, 07:14 PM
Is there a place I can read up on how to set up scripts? I have no idea what I'm doing.

louis1016
03-03-2012, 11:19 PM
heres a decent weather setup for a private server-

in zone.cpp

line 818 should read:

Weather_Timer = new Timer((MakeRandomInt(1, 2700000)));

then change lines 1289-1292 to

if(zone->zone_weather != zone->weather_type)
weatherTime = (MakeRandomInt(1, 2700000));
else
weatherTime = (MakeRandomInt(1, 2700000));

i find this to be much better then using perl scripts, the only problem is the code does not seem to generate random weather intensity, which you can do quite easily in perl scripts (some of the high intensity rain/snow settings are quite awesome, the default rain/snow intensity seen in eqemu is really low and crappy compared to what is capable)

I noticed however, on line 2018,

if(zone_weather>0)
outapp->pBuffer[4] = 0x10+MakeRandomInt(0, 9); // This number changes in the packets, intensity?

if this is correct, and this is the random intensity, then the values must be changed to 0, 60 rather then 0, 9. This would mean that the random intensity can only be between 0 and 9, which are very low. Changing the value higher will produce much different rain/snow storms. I have yet to test this out but I will get to it sometime

louis1016
03-04-2012, 12:58 AM
EDIT:

in the beginning, change Weather_Timer = new Timer((MakeRandomInt(1, 2700000)));


to

Weather_Timer = new Timer((MakeRandomInt(1, 2)));


this should start the random weather check immediately once the zone starts, (which is a 1 in 5 chance i think)

Sourdough35
03-04-2012, 12:44 PM
Will test out and report back. Thanks.

Sourdough35
03-04-2012, 08:59 PM
Still no rain. I walked around the Rathe Mountains for about 45 mins using your numbers.

louis1016
03-05-2012, 12:50 AM
it works, ive tested it,

remember that the code i modified is to make the random checks more frequent, when the zone boots there is a 1 in 5 chance for immediate weather change, and then another 1 in 5 chance occurs within a random amount of time of up to 45 minutes. If that check fails or passes, there is another 1 in 5 chance after that in another random amount of time, and another after that and so on for as long as the zone is booted

I'm still not sure if the intensity check is working 100%, so far it seems like it is but i have to test a little more to be sure

Sourdough35
03-05-2012, 01:23 AM
Sounds like I just wasn't understanding how the code worked. I probably ran through the zone for a half hour or more, but if it takes at least 45 minutes to even get another 1 in 5 chance to change the weather, then I wasn't doing it long enough. Does that mean 2700000 is the upper limit for the random time interval? If that's miliseconds, I believe that would be 45 minutes.

I think I'm going to play with much much shorter intervals just to test it out.

Also, I've seen on the boards, and am having some trouble compiling the whole source code. It runs into issues compiling queryseve, which I think compiles the chatserver exe. If I'm using all of the other files it compiles and getting the server up and running, that won't cause any issues, will it?

louis1016
03-05-2012, 01:56 AM
Yes the random interval generator thats used in the code has the lower and upper limit in parenthesis, which is the 1 and 2700000. So after the first random chance in the beginning a random number between 1 and 2700000 is generated which is the number of miliseconds until the next check. that means that it will take at most 45 minutes for the check, so it could happen any time. After that another random number is generated and so on, so there could be many checks for weather change in 45 minutes or there could be at least one.

Another way to alter the code while keeping this amount of weather checks is to alter the 1 in 5 chance of weather change at a weather check. This is in zone.cpp at line 1270.

if(tmpweather >= 80) means its an 80% chance weather wont change at the check. Alter this to whatever you want, id say use 65 or something but change it however you see fit.

Also, I've seen on the boards, and am having some trouble compiling the whole source code. It runs into issues compiling queryseve, which I think compiles the chatserver exe. If I'm using all of the other files it compiles and getting the server up and running, that won't cause any issues, will it?

No this wont cause any problems with compile errors. If your running into problems when compiling queryserve and your using visual studio you need to go to Build - Configuration manager, make sure the drop box on the left is set to release or releasebots and then uncheck the box for queryserve.

Sourdough35
03-05-2012, 02:41 AM
Yeah that's what I did for compilation. Although the most recent one DID give me a chatserver exe, so I don't know what file I'm not getting. Seems like as long as I get world, zone, and eqlaunch, I'm good.

I set the values super low just to check and it works. Also looks like the intensity can vary a ton so I think you're right. I ended up settling on checking a maximum of every 17 minutes. Thanks!