[crossfire] LOS and lighting map redo

Mark Wedel mwedel at sonic.net
Tue Aug 30 02:38:49 CDT 2005


  The basic premise behind this idea is to add more lighting levels given the 
larger visible map, and make some other LOS improvements.

First, I'm undecided exactly how many light levels there can be (and thus, 
directly related, max glow radius).  Larger values impose more server processing 
- even if they aren't used, if there is the possiblity of a glow_radius 16, it 
does mean you have to look out 16 spaces in all directions to see if anything is 
in fact glowing.

  One improvment I do plan to make is to have the map code (update position and 
like) deal with figuring light/darkness level - after all, other than player 
moving, there isn't a reason for it be handled in LOS code.  thus, as an 
example, if a player without a light source is moving about scorn, we don't need 
to do any light/darkness calculations - we have the values, know they are good.

  My first inclination is to have up to glow_radius 16 value.  Thus, a player 
holding one of these super bright objects could basically illuminate the area 
around them.

  As far as client/server protocol, I expect the revised protocol will just send 
the light sources and light client handle shading.  The server itself still 
needs to calculate light levels for line of sight reasons.

  I also plan to look into having walls block the light from progessing.

Other changes:

map header values:

ambiant_darklevel (or maybe lightlevel, depending if the desired default is that 
maps be illuminated or dark) - this is the default light level for all the 
spaces on the map - thus, you can make a dimly lit tavern just be setting this 
and nothing else.  This actually makes more sense for the world maps - after 
all, at dusk, I can still see a long ways, everything is just a bit more dim.

darklevel:  This current value in the map header needs to be revamped. 
Basically, right now, it determines how far you can see, but sort of does it in 
odd ways - in a sense, it reduces how much stuff illuminates to some extent.

  What I'm thinking is adding a map header which basically is 'unless space is 
illuminated at least this brightly, you can't see it'.  So in a sense, it 
determines how quickly the light drops off to darkness, but within the light 
area itself, it would still be illuminated.

  To me, this makes more sense - if we have 16 light levels, something at level 
1, after graphic effects, might still be so dark as to be virtually black.  So 
it may make sense to have something like 'unless at least light level 5, not 
visible' - this then plays with ambiant darklevel.

  For creatures/players can can in fact see in dark, that reduces this.  In the 
above example, now maybe those people can see down to light level 3.

  Other thoughts;  Is there a strong desire to be able to have colored lighting 
(Red, green, whatever)?

  Other LOS ideas:
For objects with elevation, make line of sight be elevation sensitive.  Eg, if 
I'm on the highest mountain, other mountains should block sight that much.  Same 
thing if I'm flying above the jungle - should get a good view.

  The question here is then do we want another flag to denote elevation based 
blocking, or do we assume that if something does have elevation, its LOS shoudl 
be based on elevation?

  Also, I'm not going to try to cover the cases of intervening elevation changes 
and things being obscured.  Eg, can't see into valley one ridge over because of 
ridge between you and valley - trying to handle that type of logic gets much 
more complicated and time consuming (you basically have to handle that by actual 
math - my elevation is X, target elevation is Y, at point a,b view line would be 
at elevation z, but that object elevation is ...).

  Partial LOS blockage:  Certain things, like jungle, currently block LOS.  My 
idea here is to mimic this by having partial blockage.  For example, jungle may 
block 25%.  So if you are in the midst of the jungle, space space right next to 
you is at full brightness, one next to it is at 75% brightness, etc.  This then 
plays with light levels also - in the middle of the night, that jungle would 
really be dark.

  Light propogation would similarly be blocked comings towards you holding a 
lantern in the middle of a jungle won't let someone else see you from very far away.



    
    


More information about the crossfire mailing list