Skip to content
75 changes: 73 additions & 2 deletions C3X.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,76 @@ enum perfume_kind {
COUNT_PERFUME_KINDS
};

enum map_target_type {
CITY,//flag foreign, flag population, flag culture
TERRAIN,//flag food_yield, flag shield_yield, flag commerce_yield
RESOURCE,//flag
UNIT,//flag foreign, flag hostile
};

struct map_target_city {
int flags;
bool foreign;//flag 1
bool hostile;//flag 2
int population_min;//flag 4
int population_max;//flag 8
int culture_min;//flag 16
int culture_max;//flag 32
};

struct map_target_terrain {
int flags;
int type;//flag 1
int food_yield_min;//flag 2
int food_yield_max;//flag 4
int shield_yield_min;//flag 8
int shield_yield_max;//flag 16
int commerce_yield_min;//flag 32
int commerce_yield_max;//flag 64
};

struct map_target_resource {
int flags;
int type;//flag 1
bool is_visible;//flag 2
};

struct map_target_unit {
int flags;
int type;//flag 1
bool foreign;//flag 2
bool hostile;//flag 4
};

struct map_target {
enum map_target_type type;
//Could use a union in theory, but size isn't too important here
struct map_target_city map_target_city;
struct map_target_terrain map_target_terrain;
struct map_target_resource map_target_resource;
struct map_target_unit map_target_unit;
};

struct map_target_separation_rule {
struct map_target target;
int min_count;
int max_count;
int enable_tech;
int disable_tech;

int distance_metric_flags;
int chebyshev;//flag 1
int manhatten;//flag 2
int euclidean_percent;//flag 4
};

struct minimum_city_separation {
int any_chebyshev;
int any_manhatten;
int foreign_chebyshev;
int foreign_manhatten;
};

struct c3x_config {
bool enable_stack_bombard;
bool enable_disorder_warning;
Expand All @@ -150,8 +220,9 @@ struct c3x_config {
bool enable_stack_unit_commands;
bool skip_repeated_tile_improv_replacement_asks;
bool autofill_best_gold_amount_when_trading;
int minimum_city_separation;
bool disallow_founding_next_to_foreign_city;
struct minimum_city_separation minimum_city_separation;
struct map_target_separation_rule * minimum_city_separation_rules;
int count_minimum_city_separation_rules;
bool enable_trade_screen_scroll;
bool group_units_on_right_click_menu;
bool gray_out_units_on_menu_with_no_remaining_moves;
Expand Down
21 changes: 14 additions & 7 deletions default.c3x_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,20 @@ remove_era_limit = false
prevent_autorazing = false
prevent_razing_by_players = false

; These options allow you to adjust the minimum allowed distance between cities. minimum_city_separation controls the minimum number of tiles between
; cities so, e.g, if it's set to 1, cities cannot be founded adjacent to one another, there must be at least one open tile separating them. A setting
; of 1 there corresponds to the standard game rules. disallow_founding_next_to_foreign_city is an optional additional restriction. If it's enabled,
; cities may not be founded adjacent to a city belonging to another civ regardless of the minimum separation. It is only relevant when the minimum
; separation is set to zero.
minimum_city_separation = 1
disallow_founding_next_to_foreign_city = true
; These options allow you to adjust the minimum allowed distance between cities. minimum_city_separation_chebyshev controls the minimum number of tiles
; between cities so, e.g, if it's set to 1, cities cannot be founded adjacent to one another, there must be at least one open tile separating them. A
; setting of 1 there corresponds to the standard game rules.
; minimum_city_separation_manhatten does the same thing, but uses manhatten distance. The clearance is a diamond shape instead of a square (or the
; converse if viewed on the isometric map.) As a rule of thumb for disabling this, set it to 2x the chebyshev distance or more.
; Both rules are defined at the same time, so if either distance is enough, the city may be built. This means the clearance area around a city can be
; an octagon (as opposed to a star shape) and you may need to adjust both settings to achieve your desired result.
; Finally, an additional pair of configs are given to define an equivilent clearance area between cities from different civs. Foreign cities are still
; subject to the regular chebyshev and manhatten distance rules, but this means if for example you have a clearance of 0, you may require foreign cities
; to still be placed at a distance of 1 away.
minimum_city_separation_chebyshev = 1
minimum_city_separation_manhatten = 2
minimum_foreign_city_separation_chebyshev = 1
minimum_foreign_city_separation_manhatten = 2

; Set to a number to limit railroad movement to that many tiles per turn. To return to infinite railroad movement, set to false or a number <=0. By
; default, all units travel the same distance along limited rails like in Civ 4, but this can be changed by toggling the next option below.
Expand Down
Loading