About Store Forum Documentation Contact



Post Reply 
how do you change environmental options thoughout the world?
Author Message
yvanvds Offline
Member

Post: #1
how do you change environmental options thoughout the world?
Hi again.

I am thinking about setting different environmental options in different parts of the world, like fog, sky colour etc.

My own Idea is to create a low resolution minimap, and use that as a basis to draw an image wherein every area has a different color. Then i'd correlate to avatar's world position to the position on that image, get the color and make changes from there.

Any thoughts or suggestions? I'm wondering what would be the standard way to do this.

cheers,

yvan
11-28-2011 09:14 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #2
RE: how do you change environmental options thoughout the world?
couldnt do it better than that man.
11-29-2011 07:03 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: how do you change environmental options thoughout the world?
Possibly and easier way that may also give you more control would be to use zones, which you can easily create using invisble (to the player) boxes in the world (placing them with the world editor). You can then give the boxes parameters that you can use in code to control fog density, color and other things too. It would just be a simple point in box test to check which box the player is in.

You could also overlap the boxes so the player can be in more than one zone at a time. Then you can blend the values to make a smooth transition between zones.
11-30-2011 12:41 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: how do you change environmental options thoughout the world?
I think good system would be to set environment control points (black points)

red point = player position

detect distance between the nearest control points and blend the environment accordingly


Attached File(s) Image(s)
   
11-30-2011 12:44 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #5
RE: how do you change environmental options thoughout the world?
Great idea... reduces my zone idea down to single points rather than boxes. In addition, the checks between the player and the points are simpler. grin
11-30-2011 12:52 AM
Find all posts by this user Quote this message in a reply
paviii Offline
Member

Post: #6
RE: how do you change environmental options thoughout the world?
I was planning something like this. One nice thing with this is you can use some code and make the points move throughout the world, i.e. storms moving in a specified direction with the occasional random change in direction.
11-30-2011 01:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #7
RE: how do you change environmental options thoughout the world?
the checks are simpler, yes. But if your zones have an irregular shape, it will require multiple points for each zone and it will still be quite crude. Environment settings should follow the 'theme' of each zone, the terrain materials used and the objects in it. At least, that is how i see it in my world.

I'm also worried that checking distance to all those points will require more cpu calls than correlating to an image. I think it would be more than 100 points in my (new and upcoming) world. So that might add up a bit.

Still, it might be best indeed to gradually change most settings, instead of doing it instantly.
11-30-2011 01:51 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
RE: how do you change environmental options thoughout the world?
Isn't it possible to get the material(s) of the heightmap at a certain point? You could get the material underneath the player's feet, grab the material user type (I believe some of the default ones are MUT_SNOW, MUT_MUD, etc.) and set the environment based off that.

If necessary, you could create custom types for certain areas if you needed to be more specific, such as MUT_SNOW_AREA1_NAME, MUT_SNOW_AREA2_NAME, etc.
11-30-2011 06:04 AM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #9
RE: how do you change environmental options thoughout the world?
using control points complexity of creating required system is increased significantly, while using simple image allows unlimited flexibility with a little effort.
12-01-2011 02:26 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #10
RE: how do you change environmental options thoughout the world?
fyi, I've made an implementation of my first idea. It didn't seem that bad after all :-) Thanks for the input though. It's always very good to hear opinions of others.

It can be downloaded from the code snippet section: http://www.esenthel.com/community/showth...p?tid=4573
(This post was last modified: 12-02-2011 09:46 PM by yvanvds.)
12-02-2011 09:45 PM
Find all posts by this user Quote this message in a reply
Post Reply