Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lights, action, sound! (longish)



Well, it's been a while since I posted my strange ideas on the
development of crossfire, so here's some more! (Also, I think these ones
are easy to do... discussion on that later).

How about having light sources in crossfire.  Both "natural" light and
artificial.  By default, a map would be naturally lit.  However some
maps (e.g. a dungeon or a house) may have a flag set saying
"dark"/"indoors".  Then players would not be able to see areas which are
not lit.  There could be torches on the walls, windows letting light in,
or the player may carry around a torch, or use a spell of light.  This
would add much more atmosphere, methinks, and would allow neat effects. 
For example, bats would be able to see in the dark and could continue
attacking you, but may be scared by the light and keep away from you. 
Vampires should, of course, receive damage from natural light.

How to display light? Well, anywhere "normally" lit would be the normal
display code.  Anywhere lit dimly should be either converted to
monochrome or stippled.  And then anywhere else is black.  As the number
of light sources will always be small (always?), then overhead in
computing light levels for a room will not be large.  They could be
computed for a map and then modified as objects with light output move,
or they could be computed all the time, for only those spots within LOS
(easier to hack in as experiment, but slower in the long run).  When a
player's view is generated, the light levels would be used as thresholds
as to how to display any particular square, modified by a "see_in_dark"
parameter of the player.

A new flag would be needed on objects: light_output which would indicate
range of any light emitted.  Most objects, this would be zero.  Candles
could have 1 or 2, fireballs should have 3 or so.  Fireborn creatures
could have a light-range of 2 or 3 (they'd be immune to vampires and
bats et al, as they would run away from the light! An invaluable
feature).  With this, you could also make light absorbers....

As players would now have code which takes into account eyesight, you
can easily introduce more.  Whenever they get diseased, or injured,
their eyesight could dim, or go red! (yes, I've been playing DOOM
recently) :-).  Too much light could cause blindness for a period of
time.  This would require objects to have two seperate parameters:
light_range and light_intensity.

Once this code was in place, you can add various effects:
	* fireballs actually light up a room.
	* creatures which are sensitive to light (a player needing to recover
from a battle might light a large fire and stay near it....)
	* add blindness as an effect which players may experience (a fireball
explodes near you, you get blinded).
	* players can wield a firebrand and then attack with fire...

New spells:
	* light, magically increases light values of all squares within a
certain radius
	* dark. opp. of light of course
	* curse of blindness
	* pyrotechnics: cause any light sources to boost their value
temporarily, thus blinding people. See fireworks later.

New objects:
	* candle (when applied, toggle light_output from 0 to lit (2, for
example).  Also, should consume hp and when hp <=zero, become junk).
	* torch.  similar to candle, but with better range.
	* fire.  similar to torch, but cannot be picked up or moved, just
dropped at a point. will cause damage if walked into. (burning item ->
fire)
	* firestarting kit. when applied, creates a fire in specified direction.
	* firework? when applied creates a fireball of small damage value, but
with large light emitting value, blinding people.  A spell of
pyrotechnics could cause all objects in the area which have flame to
create a firework moving in a random direction.  The more intense the
light emitted by the original object, the more fireworks created.  For
example a large fire could create many fireworks, all moving in
different directions.

Modified objects:
	* elves and thieves should be able to see in dark naturally.
	* fireborn should emit light.
	* vampires, bats, etc, should have be scared of light.
	* a glowing crystal should emit a low intensity light.

Possible Cute Features But Unsure of Feasability:
	* crystals and gems might "sparkle" even if in area of no light, as
they can pick up light from elsewhere....
	* "natural" light could be modified by time of day, so that if it is
night where the server is running, the towns become dark...

Scared of light could be worked out as whenever a creature enters a
square of light intensity greater than a paramaterised value, its SCARED
flag becomes set.

Of course, since a player may become blind, or may not be able to see in
the dark, you need to rely on sounds more....

Comments?
(I wouldn't mind having a go at implementing some of this)


Nick
Nick Williams, Systems Architecture Research Centre, City University, 
London, EC1V 0HB.  UK.

Web: http://web.cs.city.ac.uk/finger?njw
E-mail: njw@cs.city.ac.uk (MIME and ATK)
Work Telephone: +44 71 477 8551
Work Fax: +44 71 477 8587