Jump to content
Eternal Lands Official Forums
ttlanhil

New Weather

Recommended Posts

as a side-note, I have added wind to the rain (and snow and sand... it was only a matter of changing the fog & rain colour, shortening raindrops, and adding a bit more maths to the motion, though) before, though the randomness was very basic, I think it looked nice... EL is rather flat (compared to many other 3D worlds) with no wind, right now, and although perspective view helps, more could be done. while it's still only eye-candy and doesn't do a lot else, more detail in the weather system wouldn't hurt

Edited by ttlanhil

Share this post


Link to post
Share on other sites
Oh, i've been waiting for snow for a long time now! Is it working well?
AFAIK, there's no way to currently tell which maps should have rain and which ones snow (or sand, or hail... the sound effects for rain would also not be appropriate).

the code I used for those effects is old and won't be usable without some changes, but making those changes would only take a little bit of work... however without support for setting a map to use a different precipitation and precip-sound, it's not going to be worth making a priority

Share this post


Link to post
Share on other sites

AFAIK, there's no way to currently tell which maps should have rain and which ones snow (or sand, or hail... the sound effects for rain would also not be appropriate).

the code I used for those effects is old and won't be usable without some changes, but making those changes would only take a little bit of work... however without support for setting a map to use a different precipitation and precip-sound, it's not going to be worth making a priority

Would it be possible to do it based on the ground type of the square on the map or would this be a silly way to do it? If it was done this way, I think the system could get confused by water, which is used in both warm areas and cold areas...unless it was two types of water.

Share this post


Link to post
Share on other sites

All that's needed is a .lst file or something to define what maps are snow based and what aren't..shouldn't be that hard really.

Share this post


Link to post
Share on other sites

another column in mapinfo.lst maybe? (it needs a lot more data anyway, half the C2 maps aren't in it, causing them to default to seridia map when in tabmap)

only problem is that you can't set partials... eg sandstorm in part of the map, rain in other parts (and on a map like DP, that may be appropriate); for that you'd need a more complex file... meaning it's even more likely to be forgotten :(

Share this post


Link to post
Share on other sites

another column in mapinfo.lst maybe?

 

I can't see why this wouldn't work. Maybe we don't even need the server for this at all then?

Server sends precipitation to start->client shows rain by default OR, if defined in the list file, it will do snow instead? Would something like that work?

Share this post


Link to post
Share on other sites
I can't see why this wouldn't work. Maybe we don't even need the server for this at all then?

Server sends precipitation to start->client shows rain by default OR, if defined in the list file, it will do snow instead? Would something like that work?

yup. if unset, it defaults to rain, otherwise whatever's set there. no server config required, only the mapinfo.lst file kept up to date.

the only downside is that you can't do a sandstorm in DP without getting sand in corren or evergreen forest... or rain in evergreen without rain in the desert part.

actually, this may be more an issue in idaloran. rain in most of the area, but the desert place looks ripe for sandstorms

but hey, it can always be fine tuned later :(

I just need to manage to compile ELC without it crashing if someone has a sword or shield on (long story) and see if I can bring my old code up to date

Share this post


Link to post
Share on other sites

mwuahaha! it works!

 

well. part of it.

the different weather types(below) all work, though the colours/etc could probably be tweaked a bit.

only the loading of setting from file to come.

 

I plan to have regions per map. which means DP could finally have precipitation. have it set as sand in the desert, and rain in the forest (and a blank area between, so it has no precipitation). the two regions have to have it at the same time, but you'll have the right one for each area

 

the current code blends as you travel from one precipitation type to another (eg rain to snow). the precipitation is an average of the two, not part snow and part rain, but it should work fine

 

there are currently 6 precipitation types:

rain (instead of the streaks of rain in old weather, rain will now be a point, like all other precipitation. so it is changed too), snow, hail (falls faster than snow, less fog, and a bit bluer), sand, dust, and lava (intended for lava caves like the underworld. a faint red glow and the occasional falling ember)

 

the different precipitations have different colours, different fog levels, different speeds to fall to the ground, and different tendencies to being carried by the wind (snow is quite prone to being blown around. hail isn't)

 

there's also wind in this. I plan for it to be set by the server, the client also has some latitude in adjusting the wind (so as you watch the storms, you'll notice ripples and small changes of direction in the precipitation)

 

I'd post screenies, but until you've had a 100% wind sandstorm going, with the camera facing directly into the wind, and be able to spin the camera through the sand... you just won't get the whole story :icon13:

 

the patch is here.

you need -DNEW_WEATHER (since my code is updating that) and preferably -DDEBUG (since you can use ctrl+shift+home to start a 30sec timer to start precipitation. and ctrl+shift+end for a 30sec timer to stop)

Share this post


Link to post
Share on other sites

Loading settings from file is now done (and tested. the transition between areas seems to work nicely).

patch on berlios has been updated.

 

weather files have the name:

mapname.elw (EL weather). eg, the underworld is 'mapunderworld1.elw'

entries are in the format

start_x start_y end_x end_y type

where type is the number: 1(rain) 2(snow) 3(hail) 4(sand) 5(dust) 6(lavamap)

 

the area within 25 coords of the defined area will also be under the influence of the weather zone. eg, if there's a zone at 100x100 to 110x110 and you're at 90x90, you'll get 10/25 intensity of the weather. this means you can fade in/out the weather areas (and hence define them a bit looser), and it's fine to have them overlap.

the code adjusts for overlapping, giving you a percentage of each, as you'd get from the individual zones.

this isn't just for changing type, it can also be used for the same type. which means having several rectangles overlapping to cover an irregular shaped area works fine

 

what's left to do falls under 3 lots of work. the longer is making the weather files.

if there's no weather file for a map, it'll assume the map is 100% rain. which will be fine, since that's the old style, and accurate for all maps that currently get precipitation. so only those that need to be changed will need weather files done.

here are a couple of examples (files I used for testing, actually):

EL/maps/mapunderworld1.elw

0 0 1000 1000 6

(having coords outside the map bounds is fine. just means all of the map is in the weather zone). this gives a gentle red fog to the map, and the occasional ember falling from the roof. nice ambiance, IMO :confused:

EL/maps/startmap1.elw

40 100 45 110 1
70 100 75 110 2
100 100 105 110 3
130 100 135 110 4
150 100 155 110 5
160 100 170 110 6

should be obvious it's a test setup... as you run from 50x100 to 170x100, you cycle through the weather zones, seeing the transition (even between those that shouldn't be used together, like sand and snow

 

the second and third lots of work mostly need to be done together. that's the last of the code changes. that includes server changes.

first (probably) server change is actually for the single bug in the old -DNEW_WEATHER setting. about premature weather starts.

the client expects a certain delay between the end of an old storm and the start of a new one (and a minimum length of a storm). (the other reported bug is the inverse shadows under clouds, but that's not specific to NEW_WEATHER)

It could be a client change, but having a certain delay between storms isn't really a bad idea anyway IMO.

 

The other server change is to send wind to the clients. and the client change is to use that wind setting.

 

there are 4 settings in the client for wind atm (with this patch, anyway):

wind_speed_srv = 0,	//strength of wind, as set by server. 100 is about the max
wind_direction_srv = 0,	//wind direction, in degrees, as set by server. 0 and 360 == north
wind_speed_variance = 5,	//how much variance in wind speed to randomize. typically 1-5
wind_direction_variance = 360,	//how much variance in wind direction to randomize. typically 0-30

this should be clear to those who are interested in the code... to the rest, the interesting part should be the allowed variances.

if the server says the wind speed is 20, and there's a variance of 3, then the client can change the wind speed between 17 and 23 (but most of the time it'll be 19-21, since it preferes being near the set level).

same applies to the direction (both direction settings are in degrees from north).

 

how exactly the network protocol for wind is written will be up to learner/radu (or both), but what I'm thinking of is:

Uint8 SEND_WEATHER Uint8 direction Uint8 speed Uint8 variances

. variances will be 4 bits each for direction and speed. this allows for direction to be up to 360, in intervals of 2; speed to be up to 100, in intervals of 1; direction variance to be up to 32 degrees, in intervals of 2 (or 64 at 4, but you wouldn't need to allow the client much variance); and speed variance up to 16 in intervals of 1.

Now, if you include message length, that's 6 bytes of data. all the info is needed for when you enter a map, but not for changes in weather when you're already there. that can be done in (including protocol and message length) 4 bytes:

 Uint8 SEND_WEATHER_CHANGE Uint8 changes

. the first bit of changes would be weather we're changing the speed or direction. second bit would be set value or allowed variance. and the remaining 6 bits, the change in value.

that means wind direction can change by up to 64 degrees either direction, and wind speed by 32 units up or down. which should be perfectly sufficient for changes in weather (for a change in several settings, the SEND_WEATHER format can, of course, still be used; but most of the time it wouldn't be needed)

 

once I hear from radu/learner about the protocol details to use, I'll finish the patch, get some more testing, and then commit (which will still be under -DNEW_WEATHER, so people wanting to test after it's in CVS will need to use that)

Edited by ttlanhil

Share this post


Link to post
Share on other sites

I thought of a possible problem.

 

For something like Acid Rain Day, will the server be able to determine what is actually appropriate for the acid rain? I don't want to be in the underworld and lose my armor for "acid dust" o.o

Share this post


Link to post
Share on other sites

acid rain day would only really be relevant in places that have real rain, that's the set of maps that currently have rain. as long as the rest can have precipitation without having acid rain damage, all will be well (there's nothing that can be done about this client-side)

Share this post


Link to post
Share on other sites

as a side-note, I have added wind to the rain (and snow and sand... it was only a matter of changing the fog & rain colour, shortening raindrops, and adding a bit more maths to the motion, though) before, though the randomness was very basic, I think it looked nice... EL is rather flat (compared to many other 3D worlds) with no wind, right now, and although perspective view helps, more could be done. while it's still only eye-candy and doesn't do a lot else, more detail in the weather system wouldn't hurt

omg the snow is lovely and the sand is so cool ty for doing this :blush:

Share this post


Link to post
Share on other sites
<snip>
I really hope you didn't think the piccies linked in that post were accurate... seeing as how that's old... (those piccies are like half a year old, since they were from the previous time I worked on this stuff)

Share this post


Link to post
Share on other sites
<snip>
I really hope you didn't think the piccies linked in that post were accurate... seeing as how that's old... (those piccies are like half a year old, since they were from the previous time I worked on this stuff)

yes i did awwwwwwwwwwwwwwwwwww :P

Share this post


Link to post
Share on other sites
yes i did awwwwwwwwwwwwwwwwwww :P
and I suppose you didn't also see this post?
sounds cool, can't wait to see it! :brooding:
well, alright :icon13:

note that a static picture doesn't really capture it. when you see them moving at different speeds, the wind, etc, it looks nicer. but for the colours and such: http://s17.photobucket.com/albums/b62/ttlanhil/rain/

Share this post


Link to post
Share on other sites

okay, the wind is still a while away from being finished, but so that there's time for tuning of the weather and for the map makers to build weather definition files (shouldn't take that long, but in case they want to play)...

a test build with the weather is available from the usual place (see my siggy). it's the experimental build, that is locked to the test server (there's also some other stuff I've been testing in there)

as usual, there's a file or two you'll need to work with this, which the installer should get for you (prerequisites option)

 

now, this client has the -DDEBUG option set, which means some things will look a bit different. your name will have <CAL> on the end, there'll be some (to most people) unimportant or meaningless text in the top right of the screen... it may also run a bit slower or differently, but that's the main things.

using this client, you can press ctrl+shift+t to trigger thunder, ctrl+shift+home to trigger rain (or any other, if set by the file. note that it's a run up, and you won't see any effect for a little bit. it takes about 30 sec to run up), and ctrl+shift+end to stop rain (as above)

 

if there's no weather file available, then it defaults to rain everywhere. otherwise the weather files set stuff up.

there are two examples: underworld and IP.

if you want to use these files, save them to EL/maps

more info about these files is above

Share this post


Link to post
Share on other sites

there are screenshots, and there's a test client for people who want to try it out (which is not supported, but is legal to use)

 

at the moment I'm only looking for bug reports on the weather, or comments from the map makers or other devs

Share this post


Link to post
Share on other sites

I would like to try and test this. I downloaded your installer, and I only checked the experimental build and prerequisites to install. It did that..then when I clicked on the exe it won't run, saying the configuration is incorrect.

I have the port set at 2001 in the el.config file.

Share this post


Link to post
Share on other sites

aroo?

 

eh... okay, if that's coming once the client loads, there are two messages in the client code I think are possible you hit.

"Couldn't read configuration file el.ini"

or

"Stop playing with the configuration file and select valid modes!"

now, the second is from bad video sizes, which would also happen with other clients, so I'm guessing it's the first...

hmm, one option, are you running from the start menu? there were some problems with it trying to run inside the start menu (and not the same place where the files like el.ini are) a while back... if it is this, running from the directory itself should fix it.

 

as for port 2001, that's not a concern. all of my experimental builds are locked to port 2001 so that it's legal for people to use them

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×