![]() |
| General | Hosted Sites | CivRev | Colonization | Civilization IV | Civilization III | Civilization II | Civilization | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Just a Baker Street Muse
Join Date: Oct 2003
Location: The Bering Isthmus
Posts: 541
|
I read somewhere in one of these threads (I think the "Water as Space" one) that certain custom maps confuse the AI due to various factors.
Has anyone ever written up a guide to how to make custom maps for regular Civ2 playing (i.e., not space-style) such that the AI will function as normally as it would with a computer-generated map? Or are there just a couple of key guidelines we mapmakers need to be aware of? What all throws off the AI?
__________________
"Do not fear to be eccentric in opinion, for every opinion now accepted was once eccentric." - Bertrand Russell |
|
|
|
|
|
#2 |
|
Deity
Join Date: Feb 2001
Location: Singapore
Posts: 2,726
|
The most important thing that comes to mind is the continent numbers, as the AI is more aggressive on enemy deployments in its home continent and it also affects the pay-off for caravans. Typically the way to do this is to make the continents in the map editor and start as a new scenario, then fill in the ocean canals with land manually.
The other thing to keep in mind is the type of terrain that AI will mostly build cities on, being grassland and plains. There are also some terrains hardwired so that the AI never builds on them - I think mountain, arctic and swamp if I am not mistaken.
__________________
![]() This is a link to the Collective Works of Kobayashi and this is a link to Kobayashi's Food Blog |
|
|
|
|
|
#3 |
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Just make sure that you use the Map Editor's "Analyze Map" option ("n"). I think most of the AI problems would have to do with there being more than 63 continents/oceans (or maybe 62 for oceans).
The only things the analyzer looks for are that there is enough land, enough "arable" land (i.e. grassland and plains) and at most 63 bodies of land/water. Civ2 only counts the continents when loading the map though. If your map has more islands/lakes than that, you could temporarily connect lakes into one big lake or connect islands to one bigger island in the map editor until the analyzer is happy. Once you've started your game you can remove those connections again with the Cheat menu's "Change Terrain" option... Then again, I have no idea how that affects the AI. It might make the AI think a group of islands is actually one big island, for instance. The terrains the AI builds its cities on are not hard-coded. The AI depends on "fertility" values stored in the savegame (as part of the map for each individual square). These fertility values are unrelated to Rules.txt terrain definitions. By default, only grassland and plains will ever have high enough values for the AI to consider building cities. But since this is all stored in a savegame it can be hex-edited. Also, the MapCopy utility can be used to adjust them. MapCopy doesn't work with ToT, however. |
|
|
|
|
|
#4 | |
|
Deity
Join Date: Feb 2001
Location: Singapore
Posts: 2,726
|
Quote:
__________________
![]() This is a link to the Collective Works of Kobayashi and this is a link to Kobayashi's Food Blog |
|
|
|
|
|
|
#5 |
|
Warlord
Join Date: Jun 2001
Location: NJ, USA
Posts: 264
|
Merc, has any hex wizard figured out a fertility formula?
__________________
El Aurens v2 Beta! |
|
|
|
|
|
#6 | ||
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Quote:
I'm not familiar with that scenario (no MGE)... What things happen that don't fit in with the grass/plains rule? Does the AI build cities on terrain that isn't in the grass/plains slots? And if so, are you sure you didn't edit those squares with the cheat menu? The initial fertility values are only created when the map is loaded. E.g. if you change a grassland square to desert using the cheat menu, the AI will still build cities on it.Quote:
Perhaps someone could write some sort of program that monitors the changes to the map throughout the game, including added irrigation, built cities and the fertility values and display that in a nice animation... But that requires... effort.
|
||
|
|
|
|
|
#7 |
|
Deity
Join Date: Feb 2001
Location: Singapore
Posts: 2,726
|
[QUOTE=Mercator]:. if you change a grassland square to desert using the cheat menu, the AI will still build cities on it.[QUOTE]
I think that's the exact explanation I was looking for. Unfortunately it also means fixing it would be to tedious. sigh! and what do you mean you're not familiar with the Stargate SG1 scenario? Can that be true???
__________________
![]() This is a link to the Collective Works of Kobayashi and this is a link to Kobayashi's Food Blog |
|
|
|
|
|
#8 |
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
I hardly play any scenarios, all I usually do is open them to see what they look like, nose around and then delete them again.
(so it's not just yours either)In fact, the last time I played one (or any Civ2 for that matter, except for testing) is well over a year ago. But MapCopy would likely be able to fix your problem. It can copy fertility data from a map to a savegame/scenario. Open your scenario in the map editor, edit it so that only the squares where you want the AI to build cities are Grassland/Plains, save the map. Then execute mapcopy on the command-line like this (assuming map/scenario and mapcopy are all in the same directory): Code:
mapcopy source.mp destination.scn -s -t -bc +f:ADJUST |
|
|
|
|
|
#9 | |||||
|
aka Wobbegong
|
Quote:
Quote:
Quote:
Quote:
![]() Quote:
1. Open up your saved game in Civ2's Map Editor. 2. For all those grassland/plains tiles on which you don't want the AI to build, replace them with a zero-fertility terrain type. For any remaining tiles on which you do want the AI to build, do the reverse. 3. When you're done editing the map, save it. 4. Start a new normal game with this new map. Pick Romans. Civ2 will set new fertility values. Don't build. Save the game as NewFert.sav. 5. Type the following command line for MapCopy: Code:
mapcopy NewFert.sav Scenario.sav –s –t –bc 6. Done. |
|||||
|
|
|
|
|
#10 | |||||
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Quote:
![]() Quote:
Maybe it isn't just the surrounding 8, but 20 surrounding squares (i.e. city radius size). That would make sense, because the values are used for city building after all. And if that's the case, building a city can use the same algorithm to recalculate.Quote:
Quote:
![]() Quote:
|
|||||
|
|
|
|
|
#11 | |||
|
aka Wobbegong
|
Quote:
Quote:
![]() Quote:
![]() Code:
Mapcopy source.mp +f:CALC Mapcopy source.mp destination.sav –s –t –bc +f:ADJUST |
|||
|
|
|
|
|
#12 | ||
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Quote:
![]() ... Which is keeping me from even starting on it. ![]() Quote:
|
||
|
|
|
|
|
#13 | |||
|
Emperor
Join Date: Oct 2002
Posts: 1,179
|
Quote:
Fertility exceptions: I've done experiments where I create an AI Settler on a square with Mountain terrain and it settles the square immediatley. This may be a result of the Settler being spawned far away from the nearest friendly city, it could just be because the AI is already set to settle (e.g. once pop. reaches x size, x # of turns from start) so it will do so anywhere at that point--only it would usually be built in a city and thus move to settle somewhere closer and on higher fertility terrain. Quote:
Quote:
[I think someone should re-design the vanilla game to make it play better--probably on an Earth map with a fixed set of civs so you can use events without resorting to wildcards to much...it's just that I don't have time to do it. ]If the limit is 63, what happens when you use a space map (i.e. land as planetoids, water as space) and the single land tiles exceed 63?
__________________
For map makers: Resource Maps (very accurate) here. |
|||
|
|
|
|
|
#14 | ||||
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Quote:
Do you have any spare terrain types? If you're not using at least 2 terrain types, you can swap them for grassland/plains so there isn't any terrain the AI will naturally build cities on... But you can only do that when you create a new scenario. You obviously can't do that with an existing one, because, well, you'd need MapCopy to do that. Quote:
Quote:
The fertility values change during a game. It's not just fertile/not fertile, there are 16 different possible values (0-15). Quote:
I don't know, but that's exactly the thing that confuses the AI... In fact, that's the thing Mike started this thread for in the first place! Read the thread he referred to in the opening post to see what he meant.
|
||||
|
|
|
|
|
#15 | |||
|
aka Wobbegong
|
Quote:
Quote:
Quote:
Last edited by Catfish; Feb 04, 2005 at 06:24 AM. Reason: Piss-poor expression |
|||
|
|
|
|
|
#16 | |
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
Quote:
Not that I'm asking you to test all this of course, unless you have nothing better to do. ![]() I actually got off my ass too though (well, just a bit ). I just mailed Dusty about MapCopy. I've also done something else that's rather interesting, but not directly related to this. Do you have Hex Workshop, Catfish?Oh, and how did you do that testing? Was it as tedious as I think it was, or have you found a way to easily see those values? |
|
|
|
|
|
|
#17 | ||
|
aka Wobbegong
|
Quote:
However, based on the results of a few more tests (see below), it would appear that fertility values are only calculated during the 'build world' phase, with tile improvements, within or beyond city radii, having no effect. The game then applies a mask to the entire map, subtracting 8 points for tiles that lie near cities.BTW, I checked the effect of Dusty's ADJUST algorithm and discovered that it only modifies the city's 21-tile zone, not the 45-tile zone. As a result, you may find the AI building new cities close to ones that existed prior to running MapCopy. Quote:
The following should answer a few questions:Using the same example as my previous post, I constructed a second city within the first's 45-tile zone. The results are shown in the screenshot. All tiles within the new city zone took an 8-point hit, except those within the region of overlap, which experienced no further decrease. ![]() Whether the city was built by an AI- or human-controlled civ, or belonged to the same civ or a rival one made no difference. I then looked at the effect of irrigation on fertility. Again using the same example, tiles within the city's 21-tile zone were irrigated (conventionally, not via Cheat menu). It made no immediate difference – values remained at 7. To test the effect of irrigation on tiles which are unaffected by cities, I used a random map. The tested tiles had initial fertility values in the range 12-14. There was no change there, either. ![]() To test possible changes over a period of time, I started up an Original game at King level. Initial fertility values were as shown below. Unmarked tiles have zero values. ![]() Two turns later the settler moved to a value-15 tile and constructed Thebes. As expected, the fertility values of all the tiles within the 45-tile zone dropped by 8 points. ![]() I let the AI do its thing and by AD 1600 the map looked like this: ![]() The values of some of the outer tiles dropped due to the presence of new cities, but those within Thebes' 45-tile zone remained unchanged, despite the presence of tile improvements. By AD 1950 the map looked like this: ![]() There was no change at all in the fertility values from the previous 'snapshot' of the game. There are a couple of things worth pointing out: the tile immediately SE of Thebes has been transformed to plains by an engineer – its value however remained zero. Another city was created just south of the screenshot (you can see the second orange flag). It was founded on a tile with a fertility value of 5 – the pressures of overcrowding I guess. BTW, the Egyptians are getting the tripe beaten out of them in this game. One last point: when a city is destroyed, either by an attack or disbanding via the Cheat menu, the 8 points are restored. |
||
|
|
|
|
|
#18 | |||
|
aka Wobbegong
|
I had to split my post into two - too many images, apparently.
Quote:
![]() Quote:
Quote:
|
|||
|
|
|
|
|
#19 | |||
|
Cosmographer
Join Date: Mar 2001
Posts: 1,065
|
That's brilliant!
I guess most of the apparent randomness is due to the initial assignment, and the fact that the affected radius is bigger than just the city radius. Quote:
![]() Quote:
Note: Bloody hell! it's been trying to load the map structure for the Midgard scenario for over half an hour now... Maybe this isn't such a good idea after all. I could, um, help you *cough* "acquire" it, though. ![]() Quote:
|
|||
|
|
|
|
|
#20 | |||
|
aka Wobbegong
|
Quote:
![]() It's really very simple. For each tile within a city's 45-tile zone: City Created: If Fertility > 7 then Fertility = Fertility – 8, else Fertility = Fertility City Destroyed: If Fertility < 8 then Fertility = Fertility + 8, else Fertility = Fertility It explains why when two or more cities have overlapping zones, the tiles within the region of overlap are not devalued more than once. It produces an absurd situation when you have two or more cities with overlapping zones and one of them is destroyed. Same 2-city example as before: ![]() BTW, I forgot to mention the effect of farmland on fertility. It makes no difference, either. Quote:
Quote:
With the spreadsheet I can effortlessly switch between maps, too. If I need to find a row of tiles, I just plug in the co-ordinates of the leftmost tile, get my offset and move along the row in the hex-editor. If I want to move to a tile in the next row, I can use Jump (6 x map width). BTW, this is the formula I use in Excel (for ToT 1.1 only):Offset = 29910 + 14*T + 7*W*H*(Z+1) + (6*W*H+2)*Z + 6*(Y*W+ROUNDUP((X+1)/2,0)) W = Map width (number of tiles) H = Map height (number of tiles) X = X-coordinate of tile (game, not map editor) Y = Y-coordinate of tile Z = Map number of tile (0-3) T = Number of transporters in game (byte 29896 will tell you this) It returns the offset for the 1st byte of 6 for each map tile. Offsets start at 0. |
|||
|
|
|
![]() |
| Bookmarks |
| Tags |
| civ2 fertility, mapcopy |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AI Difficulty Adjustments in Custom Maps | MondSemmel | FfH2 Modmods, Scenarios, and Maps | 5 | Jun 30, 2008 10:15 PM |
| Adding maps to the custom game maps list?! | Dark_Ownage | Civ4 - Technical Support | 0 | Jan 06, 2008 03:45 PM |
| What the Hell is Up the Random AI Function? | AznWarlord | Civ3 - General Discussions | 4 | Jan 03, 2008 04:31 PM |
| Custom maps | Kokopelli | Sid Meier's Railroads! | 2 | Oct 30, 2006 04:58 PM |
| [REFERENCE] [SDK Tut] Calling from the SDK a custom python modules function. | Gerikes | Civ4 - Modding Tutorials & Reference | 13 | Sep 08, 2006 11:48 AM |