The Grassland pattern is far simpler than the Special Resources pattern.
To determine if a Grassland/River square provides a shield, the following steps are executed:
1. The shield output if Grassland/River is 1 by default.
2. Multiply the x-coordinate of the square by 7.
3. Multiply the y-coordinate of the square by 11.
4. Add the results from step 1 and step 2 together.
5. Treat the result of step 3 as a binary number. Check if the "2" bit is equal to 1. If yes, set the shield output to zero.
If you are not familiar with binary numbers, you can also determine the outcome of step 5 this way:
Reduce the result of step 3 modulo 4 (i.e. keep subtracting 4 from the result until it is between 0 and 3). If the resulting number is 2 or 3, then set the shield output to zero.
This results in the well-known shield pattern:
ooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxx
oxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxo
xxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoo
xooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoox
ooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxx
oxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxo
xxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoo
xooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoox
(and so on...)
For a more sophistic image, check the attached image here or any other ingame map picture.
Modifying the Pattern
This requires a unpacked .exe file, as described here. It would also be wise to rename the unpacked file to "Civ1.exe" and keep the original executable in the civ folder, since this should prevent the "Overlay not found" error from occuring.
There are actually two instances of the Grassland pattern. The first instance determines the shield output and is used for both Grassland and River squares. The second instance is just graphical and only used for Grassland squares. It decides if the square looks like "Grassland with shield" or "Grassland without shield".
This means some variables appear at two different positions.
multiplier for x-coordinate
default value: 0x07
first position: 0x161E1
second position: 0x1E0F4
multiplier for y-coordinate
default value: 0x0B (= 11)
first position: 0x161E9
second position: 0x1E0FC
shield output of Grassland/River "without shield"
default value: 0
position: 0x161F8
note: This value will only affect the shield output, not the graphics.
bit pattern for the bitwise comparison (bitwise "OR")
default value: 0x02
first position: 0x161F2
second position: 0x1E105
notes: This is probably the most important variable. Setting this to 0 will give you Grassland/River with shield everywhere. Setting it to 1 will create a chessboard pattern. Setting it to 0xFF (= 255) will give you Grassland/River without shield everywhere.
To determine if a Grassland/River square provides a shield, the following steps are executed:
1. The shield output if Grassland/River is 1 by default.
2. Multiply the x-coordinate of the square by 7.
3. Multiply the y-coordinate of the square by 11.
4. Add the results from step 1 and step 2 together.
5. Treat the result of step 3 as a binary number. Check if the "2" bit is equal to 1. If yes, set the shield output to zero.
If you are not familiar with binary numbers, you can also determine the outcome of step 5 this way:
Reduce the result of step 3 modulo 4 (i.e. keep subtracting 4 from the result until it is between 0 and 3). If the resulting number is 2 or 3, then set the shield output to zero.
This results in the well-known shield pattern:
ooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxx
oxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxo
xxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoo
xooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoox
ooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxx
oxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxo
xxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoo
xooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxooxxoox
(and so on...)
For a more sophistic image, check the attached image here or any other ingame map picture.
Modifying the Pattern
This requires a unpacked .exe file, as described here. It would also be wise to rename the unpacked file to "Civ1.exe" and keep the original executable in the civ folder, since this should prevent the "Overlay not found" error from occuring.
There are actually two instances of the Grassland pattern. The first instance determines the shield output and is used for both Grassland and River squares. The second instance is just graphical and only used for Grassland squares. It decides if the square looks like "Grassland with shield" or "Grassland without shield".
This means some variables appear at two different positions.
multiplier for x-coordinate
default value: 0x07
first position: 0x161E1
second position: 0x1E0F4
multiplier for y-coordinate
default value: 0x0B (= 11)
first position: 0x161E9
second position: 0x1E0FC
shield output of Grassland/River "without shield"
default value: 0
position: 0x161F8
note: This value will only affect the shield output, not the graphics.
bit pattern for the bitwise comparison (bitwise "OR")
default value: 0x02
first position: 0x161F2
second position: 0x1E105
notes: This is probably the most important variable. Setting this to 0 will give you Grassland/River with shield everywhere. Setting it to 1 will create a chessboard pattern. Setting it to 0xFF (= 255) will give you Grassland/River without shield everywhere.