glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] water and snow


From: Kai Antweiler
Subject: [glob2-devel] water and snow
Date: Fri, 10 Mar 2006 01:34:13 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Jumbo Shrimp, linux)

I once had an idea how to improve the behaviour of slow swimming globs.
I thought that by changing the gradient system to reduce the gradient
level by 2 instead of 1 when water fields are treated would cause globs
to prefer ground areas.
(I intended to use it if most of the population would be slow in water.)
This is a dirty hack and would of course influence all the globs of one
player.
There are better ways to achieve a faster movement for slow swimmers.
For example since:  time = distance / spead
Checking if

Distance using land only gradient     Distance using water gradient
---------------------------------  >  -----------------------------
         walking speed                      swimming speed

and using the outcome to decide if one individual globule should use the
land gradient or the water gradient for pathfinding.
(It shouldn't matter that the targets might be at different places)
I don't know how it is handled right now.


Well, I read about the seasons proposal: 
http://lists.gnu.org/archive/html/glob2-devel/2006-01/msg00126.html

It is about implementing a changing of summer and winter into glob2.
Including two versions of snow: snow and deep snow (which influences
the movement).  Walking on deep snow changes it to normal snow.
The idea I once had for the gradients on water could be used to
implement deep snow.


The idea is to use two queues for gradient propagation instead of one:

init:
  Resource areas (of one kind) are put into queue 1.

phase 1:
  We process queue 1 much like it is done now - but:
  If a land field would have been inserted into the queue we put it into queue 
2.
  If a water field would have been inserted into the queue we put in into queue 
1.
end of phase 1:
  All elements of queue 1 with "the current gradient level + 1" have been
  processed (a counter can check that).  The gradient level decreases by one.

phase 2:
  We process the elements of queue 2.
  We put land fields into queue 1 and water fields into queue 2.
end of phase 2:
  All elements of queue 2 with current gradient level + 1 have been processed.
  The gradient level decreases by one.

continue with phase 1.



(init)                (current gradient level 8)
queue 1: 9999999999999999999999999999999999999
queue 2:

 (phase 1)            (current gradient level 8)
 queue 1: 99999 7777777777777777777777
 queue 2: 88888888888888888888

(end of phase 1)      (current gradient level 7)
queue 1: 7777777777777777777777 
queue 2: 88888888888888888888

 (phase 2)            (current gradient level 7)
 queue 1: 7777777777777777777777 777777777777777
 queue 2: 8888888 66666666666666666

(end of phase 2)      (current gradient level 6)
queue 1: 77777777777777777777 777777777777777777
queue 2: 666666666666666666666

 (phase 1)            (current gradient level 6)
 queue 1: 777777777777777 5555555555555555
 queue 2: 66666666666666666 

(end of phase 1)      (current gradient level 5)
queue 1: 66666666666666666 
queue 2: 5555555555555555

...


-- 
Kai Antweiler





reply via email to

[Prev in Thread] Current Thread [Next in Thread]