[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [glob2-devel] Map.h, map.cpp and gradients
From: |
Eli |
Subject: |
Re: [glob2-devel] Map.h, map.cpp and gradients |
Date: |
Thu, 7 Jul 2005 05:18:54 -0400 |
On Jul 6, 2005, at 9:58 PM, Andrew Sayers wrote:
So, for the square to the left:
0*256*256*256 + (255-0)*256*256 + 0*256 + 0 == 16711680
For the square to the right:
255*256*256*256 + (255-0)*256*256 + 253*256 + 0 == 4294966528
For the square to the top:
254*256*256*256 + (255-0)*256*256 + 254*256 + 0 == 4278189568
For the square to the bottom:
255*256*256*256 + (255-0)*256*256 + 0*256 + 255 == 4294902015
And for the square it's standing on,
254*256*256*256 + (255-0)*256*256 + 253*256 + 0 == 4278189312
So it follows the highest gradient, to the right.
That doesn't consider the case where the wheat is right next to the
tower. Take for example:
A glob is standing on a perfectly open plain. Seven squares to his left
is a patch of wheat. Four squares to his right is a patch of wheat.
Five squares to his right is an enemy tower. All of this is well known
territory and there are no forbidden areas.
To his right, he would walk towards the tower:
Forbidden: 255
Danger: 4
Resource: 252
Shadow: 0
To his left, he would walk away from the tower:
Forbidden: 255
Danger: 2
Resource: 249
Shadow: 0
Staying where he is now, he is still out of any danger he's interested
in:
Forbidden: 255
Danger: 3
Resource: 251
Shadow: 0
To the top and bottom, he would move away from anything he wants to get
to and nothing he wants to get away from. To go left, he moves away
from resources, and to go right, he moves towards danger. He just
stands in the same place, not doing anything useful. (at least until a
wily player comes and smacks him with a forbidden area to make him
move...)
- [glob2-devel] Map.h, map.cpp and gradients, Andrew Sayers, 2005/07/06
- Re: [glob2-devel] Map.h, map.cpp and gradients, Eli, 2005/07/06
- Re: [glob2-devel] Map.h, map.cpp and gradients, Andrew Sayers, 2005/07/06
- Re: [glob2-devel] Map.h, map.cpp and gradients, Stephane Magnenat, 2005/07/07
- Re: [glob2-devel] Map.h, map.cpp and gradients,
Eli <=
- Re: [glob2-devel] Map.h, map.cpp and gradients, simon schuler, 2005/07/07
- Re: [glob2-devel] Map.h, map.cpp and gradients, Andrew Sayers, 2005/07/07
Re: [glob2-devel] Map.h, map.cpp and gradients, Stephane Magnenat, 2005/07/06
Re: [glob2-devel] Map.h, map.cpp and gradients, simon schuler, 2005/07/06