Skip to content

About

BUG 4.4 module for Civilization IV: Beyond the Sword that reshapes your starting area into a good, but not perfect, start (Python 2.4/2.7, original game and OpenCiv4)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BetterStart

A BUG 4.4 module for Civilization IV: Beyond the Sword 3.19. When a new game begins, it reshapes your starting area into a good, but not perfect, start: what a player would otherwise do by hand in the World Builder.

It works with BUG 4.4 alone or with BULL. It is written for both Python 2.4 (the original game) and Python 2.7 (OpenCiv4, the native engine for macOS and Linux).

What it does

When a new game starts (turn 0, before your settler moves), a popup asks: Improve starting position? Off / Light / Normal / Strong.

  • Capital site. It scores the plots within 1, 2 or 3 plots of your start (Light, Normal, Strong) and prefers a plains hill on a river, not on the coast, with room on all sides and away from the poles. It never moves you closer to another civilization than the game's starting distance. The settler moves there. Your other starting units go to random plots 1–2 away from it, never onto the settler's own tile, as the game itself places them. Plots that only the old spot had seen become unexplored again.
  • The capital's fat cross.
    • No lake, oasis or jungle, on every level. Jungle there can only come from the map where the settler lands. It becomes forest, or open land where the resource on it can't have forest (rice, pigs, gems, ...).
    • The capital becomes a plains hill, and sometimes sits on wine, stone or marble. Settling on elephants is welcome too. Otherwise elephants move out of the fat cross, as do the calendar resources (dye, silk, spices, sugar, incense, bananas) and later ones (coal, oil, aluminium, uranium). Grain, animals, horses and the mine resources may stay.
    • A river is added past the capital if there isn't one. It flows to the sea or into another river, as rivers do. Side streams follow until at most 4 (Strong) to 10 (Light) of the capital's tiles are dry. On Normal and Strong, 1–2 more rivers run through the dry land around the fat cross, for the next cities.
    • Two food tiles: a wet grain (corn, rice or wheat by a river or lake) and an animal (cow, pig or sheep; a pig or sheep may be on a hill). With wheat, at least two flood plains. A second grain or animal moves out of the fat cross.
    • Three or four production tiles: hills that aren't food tiles, plus mine resources. On Normal and Strong, bare hills beyond that are flattened. Now and then one hill carries gold, silver, copper or iron. Gems are rare: only near the equator or where the map already has gems within 10 plots, and never under forest. One or two hills have no forest, resource hills first, so a worker can mine at once.
    • Flat plains without a resource become grassland. No tile is left bare: the rest get forest. There are some flood plains too (at most 7).
  • Five more city sites, spread around the capital in different directions.
    • If the coast is within 8 plots, city 2 sits on it with 2–3 seafood. That's the high-food (National Epic) site. Otherwise one of cities 2 and 3 gets extra food on land.
    • More food for cities 4–6.
    • No more than 2 of the same resource are placed within 8 plots, so the food varies.
    • Rice goes next to fresh water (a river or a lake), except 1 time in 4.
  • Close by, outside the capital's fat cross (for city 2 or 3): 1–2 early happiness resources (ivory, fur, gold, gems, silver). Copper or horses, iron and stone or marble on a hill are likely but not certain: on Strong about 2 in 3 for copper or horses, 1 in 2 for iron and less than 1 in 2 for stone or marble, when none is there yet. They go in the directions that have the fewest resources.
  • Further out (6, 9 or 11 plots for Light, Normal, Strong):
    • Most plains without a resource become grassland, or flood plains by a river where there isn't much food or flood plains already.
    • Most bare tundra gets forest, and forest on tundra or snow is drawn snowy.
    • A little more forest grows, in clumps, away from rivers.
    • Forests are added the way the map scripts add them, so they look the same as the map's own.
  • No peaks or plain desert within 5, 6 or 8 plots (Light, Normal, Strong) or near the city sites: peaks become hills and desert becomes plains or grassland. Desert with an oasis or flood plains is kept. A resource on desert that also grows on plains (iron, stone, gold, ...) gets plains under it.

Every goal is soft and left partly to chance. The level decides how often each goal is met, so Light changes 6–19 plots and Strong 41–56. It uses what is already there first, and a resource is only placed where the game's own rules allow it (see Notes). Other civilizations' starting areas (3 plots around their start) are never touched. All randomness comes from the game's synchronised random number generator, so the same map seed gives the same result.

Options (BUG options screen, Ctrl+Alt+O, Better Start tab):

  • Improve My Starting Position: turns the module on or off.
  • Ask When a Game Begins: show the popup. If unchecked, the level below is used without asking.
  • Level: Off, Light, Normal or Strong.

Shortcut: Alt+Ctrl+B shows the popup again. This only works on the first turn, before your capital is founded, and only once per game. It is for single player games only.

Installing

The module is four files plus two lines in BUG's init.xml.

macOS / Linux (also for the Wine game's folder)

./install.sh "/path/to/Beyond the Sword/Mods/BUG Mod"

The script copies the files and adds the two lines to Assets/Config/init.xml. It keeps a backup next to it as init.xml.before-betterstart. Running it again only refreshes the files.

For the original game under Wine (Sikarugir), the BUG Mod folder is .../drive_c/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization IV Beyond the Sword/Beyond the Sword/Mods/BUG Mod.

By hand (Windows or anywhere)

  1. Copy everything under Assets/ into your Mods/BUG Mod/Assets/. That is these files:
    • Config/BetterStart.xml
    • Python/Contrib/BetterStart.py
    • Python/BUG/Tabs/BetterStartOptionsTab.py
    • XML/Text/BetterStart_CIV4GameText.xml
  2. In Mods/BUG Mod/Assets/Config/init.xml:
    • add <load mod="BetterStart"/> just before the <!-- Options Screen --> comment;
    • add <tab module="BetterStartOptionsTab"/> inside <screen id="BUGFull">, before <tab module="BugSystemOptionsTab"/>.
  3. Start a new game with the BUG Mod.

To uninstall, remove those two lines and the four files.

BUFFY (the Hall of Fame build of BUG) has the same layout, so the same steps work for Mods/BUFFY-3.19.005. Games played with it are then no longer valid for Hall of Fame submission.

Notes

  • Areas are recalculated the way the World Builder does it: setPlotType(..., True, True) updates them when land or water changes (a lake filled in). Terrain, features and rivers redraw as they are set.
  • Rivers are drawn edge by edge with setNOfRiver/setWOfRiver and flow directions, and get a new river ID.
  • Resources are placed by the game's own rules (canHaveBonus: terrain, hills, latitude, area size) with one exception: bNoRiverSide is ignored. That flag only keeps the map generator from putting corn, rice, wheat, cows, iron and so on by rivers. In play they work there as anywhere, and the World Builder places them so too.
  • Played in the original game (BtS 3.19 with BUFFY 3.19.005, under Wine on macOS) and tested on OpenCiv4 (Python 2.7) with BUG 4.4 + BULL 1.2. The Python avoids every construct newer than 2.4 (with, x if c else y, set literals, any/all) and uses only functions from the stock 3.19 SDK.

License

GPLv2, as BUG. See LICENSE.

About

BUG 4.4 module for Civilization IV: Beyond the Sword that reshapes your starting area into a good, but not perfect, start (Python 2.4/2.7, original game and OpenCiv4)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages