diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-29 15:41:39 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-29 15:41:39 +0000 |
commit | 871c03730f4206865df239d6698732ee801c5043 (patch) | |
tree | 7f7bb1f1e0f1ba49b9471962393ae183cc3da31e /crawl-ref/source/tutorial.cc | |
parent | 5730d82050d02ac2fa93ba01900cf6a43c110a9d (diff) | |
download | crawl-ref-871c03730f4206865df239d6698732ee801c5043.tar.gz crawl-ref-871c03730f4206865df239d6698732ee801c5043.zip |
Implement a much more efficient version of the LOS testing used for
monster patrolling. As before, ray casting is used to verify LOS
but ray casting now only happens if a blocked grid is encountered
when searching the surroundings in a growing spiral.
If a blocked grid is found, all beams that might possibly go through
this grid (heuristically tested, probably tests more than needed) are
checked right away and all grids behind the blocked one are marked as
well - this blocking can be reversed, if we later find another beam
that unblocks it.
A beam that was already tried isn't tried a second time.
The values are stored in a (2*LOS_RANGE)^2 array and then directly
compared when deciding where to send a patrolling monster next.
In the worst case we still need to fire beams at each of the edge
grids, but that probably can't be avoided entirely, though performance
could obviously still be improved.
The increase in speed is very much noticeable, i.e. for me Crawl runs
smoothly again. :)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5330 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tutorial.cc')
-rw-r--r-- | crawl-ref/source/tutorial.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 4aaae00e4f..d7cf5b96c8 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -1270,7 +1270,7 @@ static void _new_god_conduct() if (is_good_god(you.religion)) { - // For the good gods, piety grows over them. + // For the good gods, piety grows over time. text << "From now on, " << new_god_name << " will watch over you and " "judge your behaviour. Thus, your actions will greatly " "influence your piety (divine favour). If your piety runs out "; |