Freeciv
Register
(fixes)
Tag: Visual edit
(fixes)
Tag: Visual edit
Line 7: Line 7:
 
In Freeciv barbarians are represented by special [[AI]] players that have some special rules (e.g. they do not enter huts and can not build units without "BarbarianBuild" or "BarbarianBuildTech" role). Nations suitable for selecting as barbarians have in their ruleset description "barbarian_type" parameter other than "None" ("Land", "Sea", "Animal" or "LandAndSea"). Also, the nation description usually has the nation group "Barbarian" and <code>is_playable = FALSE</code>. You have to define barbarians for land and for sea in your nation set even if your ruleset explicitly never uses them. Player slot number reserved for barbarians is 12 out of total 512 (v.3.0), though actually you can have at most one barbarian player of each type in a game (with "LandAndSea" considered as spanning two types). If such a player is killed, the nation is revived with a new leader and 100 gold once the barbarians are needed again.
 
In Freeciv barbarians are represented by special [[AI]] players that have some special rules (e.g. they do not enter huts and can not build units without "BarbarianBuild" or "BarbarianBuildTech" role). Nations suitable for selecting as barbarians have in their ruleset description "barbarian_type" parameter other than "None" ("Land", "Sea", "Animal" or "LandAndSea"). Also, the nation description usually has the nation group "Barbarian" and <code>is_playable = FALSE</code>. You have to define barbarians for land and for sea in your nation set even if your ruleset explicitly never uses them. Player slot number reserved for barbarians is 12 out of total 512 (v.3.0), though actually you can have at most one barbarian player of each type in a game (with "LandAndSea" considered as spanning two types). If such a player is killed, the nation is revived with a new leader and 100 gold once the barbarians are needed again.
   
To use the new wild animals feature available starting with 2.6 you need a customized ruleset. Here's a write-up of what you have to do.
+
To use the new wild animals feature available starting with 2.6 you need a customized ruleset. See "'''Editing rulesets'''"[https://freeciv.fandom.com/wiki/Editing_rulesets] for more info. Here's a write-up of what you have to do.
   
 
1 You need the animal graphics. I used amplio ones, good source -
 
1 You need the animal graphics. I used amplio ones, good source -
Line 20: Line 20:
   
 
<nowiki>;</nowiki> Format and options of this spec file<nowiki>:</nowiki>
 
<nowiki>;</nowiki> Format and options of this spec file<nowiki>:</nowiki>
  +
 
options = "+Freeciv-2.6-spec"
 
options = "+Freeciv-2.6-spec"
   
Line 25: Line 26:
   
 
<nowiki>;</nowiki> Animal units
 
<nowiki>;</nowiki> Animal units
  +
 
<nowiki>;</nowiki> All them made from Public Domain (CC0) images
 
<nowiki>;</nowiki> All them made from Public Domain (CC0) images
   
 
artists = "
 
artists = "
  +
    Bardo [Bd]
+
Bardo [Bd]
    SilviaP [SP]
 
  +
 
SilviaP [SP]
  +
 
"
 
"
   

Revision as of 03:03, 6 April 2020

Barbarians are tribes that raid civilized nations from time to time. Around borders of populated lands uprisings happen, and hordes of armed units seeking booty and destruction emerge, each party led by a Barbarian Leader. If you expand carelessly wider and wider paying no value to building your army, then your cities and workers are easy prey for them: cities will be conquered, and workers will be killed or (if the ruleset allows) captured. From the cities (that will be kept in a savage manner without building any improvements[1]) new hordes will appear; also, it's not impossible to meet barbarians exploring a tribal village[2], they may either kill your explorer in a moment or surround and may attack the next turn. In fact, for any developed military barbarians are not a great treat - they are not extremely abundant even with "Hordes" setting, and they are so stupid that you possible can retake a city even with weaker units when they just went out. Moreover, barbarian units that can not see around anybody to attack tend to spontaneously disband (alas, Barbarian Leaders that exist mostly for beating out of them bonus gold do it most often).

Typically, in a game you will face two types of barbarians: land ones appearing on a land (not too near or too far from a city, rarely around civilizations with too few cities or too high civil war risk, "Barbarians" nation in standard nation set), and sea barbarians (appear in a boat near coasts, with mostly the same attraction to populated lands, nation "Pirates"); since FC3.0 there can be single land and sea barbarian nation. There are roles of unit types that can appear as barbarians; some of them are accessible to barbarians completely disregarding of knowing any technologies ("Barbarian", "BarbarianSea", "BarbarianBoat", "BarbarianLeader"), and some will apear since any player discovers the required tech ("BarbarianTech", "BarbarianSeaTech"). You can define by a game setting how many barbarians will likely appear in the game: no at all, only from huts, or from few to more by uprisings (game.server.barbariansrate variable affect number of uprisings, number of summoned units and press on smaller civilizations). If barbarians do uprise, you can also specify the minimal turn they do (not necessarily they first appear that turn, but earlier they can come only from huts).

Animals are considered yet another type of barbarians that are not spawned in uprisings but are placed by certain terrains at game start. They will attack units in the open but not cities, and each animal type can go only by some terrains (its native ones where they are generated and maybe some another).

In Freeciv barbarians are represented by special AI players that have some special rules (e.g. they do not enter huts and can not build units without "BarbarianBuild" or "BarbarianBuildTech" role). Nations suitable for selecting as barbarians have in their ruleset description "barbarian_type" parameter other than "None" ("Land", "Sea", "Animal" or "LandAndSea"). Also, the nation description usually has the nation group "Barbarian" and is_playable = FALSE. You have to define barbarians for land and for sea in your nation set even if your ruleset explicitly never uses them. Player slot number reserved for barbarians is 12 out of total 512 (v.3.0), though actually you can have at most one barbarian player of each type in a game (with "LandAndSea" considered as spanning two types). If such a player is killed, the nation is revived with a new leader and 100 gold once the barbarians are needed again.

To use the new wild animals feature available starting with 2.6 you need a customized ruleset. See "Editing rulesets"[1] for more info. Here's a write-up of what you have to do.

1 You need the animal graphics. I used amplio ones, good source -

[2]

This file goes in "...share/freeciv/amplio2/Animals-finished-amplio.png"

2 Need a new file "..share/freeciv/amplio2/animals.spec" which refers to that "Animals-finished-amplio.png" file with these lines -

[spec]

; Format and options of this spec file:

options = "+Freeciv-2.6-spec"

[info]

; Animal units

; All them made from Public Domain (CC0) images

artists = "

Bardo [Bd]

SilviaP [SP]

"

[file]

gfx = "amplio2/animals"

[grid_main]

x_top_left = 1

y_top_left = 1

dx = 64

dy = 48

pixel_border = 1

tiles = { "row", "column", "tag"

0,  0, "u.wolf"       ; [Bd]

0,  1, "u.leopard"    ; [SP]

0,  2, "u.tiger"      ; [Bd]

0,  3, "u.lion"       ; [SP]

0,  4, "u.bear"       ; [Bd]

0,  5, "u.snake"      ; [Bd]

0,  6, "u.crocodile"  ; [SP]

0,  7, "u.gorilla"    ; [Bd]

0,  8, "u.panther"    ; [SP]

0, 11, "u.kraken"     ; [Bd]

0, 12, "u.storm"      ; [Bd]

}


3 That file needs to be referenced by the "...share/freeciv/amplio2.tilespec" file, which needs lines -

files =

"amplio2/animals.spec",

In the next steps, "dino" is the name of my custom ruleset, substitute it with the name of yours.

4 Edit "..share/freeciv/dino/terrain.ruleset" and add the terrain(s) for each animal. For example, under [terrain_deep_ocean] edit the line -

animal               = "Kraken"

You can have only one animal per terrain type, but can have the same animal on multiple terrains.

5 Edit "..share/freeciv/dino/units.ruleset" to add the animal units. The Kraken example -

[unit_animal_kraken]

name          = _("Kraken")

class         = "Sea"

tech_req      = "None"

obsolete_by   = "None"

graphic       = "u.kraken"

graphic_alt   = "None"

sound_move    = "m_generic"

sound_move_alt = "m_generic"

sound_fight   = "f_generic"

sound_fight_alt = "f_generic"

build_cost    = 10

pop_cost      = 0

attack        = 2

defense       = 1

hitpoints     = 10

firepower     = 1

move_rate     = 2

vision_radius_sq = 2

transport_cap = 0

fuel          = 0

uk_happy      = 0

uk_shield     = 1

uk_food       = 0

uk_gold       = 1

flags         = "NoBuild", "Cant_Fortify", "Unbribable", "IgZOC"

roles         = ""

helptext      = _("\

Watch out for wild animals.\

"), _("\

Krakens live in Deep Oceans, and can attack adjacent tiles.\

")

6 To stop the animals from quickly disappearing, edit "..share/freeciv/dino/effects.ruleset". The section [effect_barb_disappear] needs a line added so it looks like this -

[effect_barb_disappear]

type    = "Retire_Pct"

value   = 10

reqs    =

{ "type", "name", "range", "present"

"NationGroup", "Barbarian", "Player", TRUE

"Nation", "Animal Kingdom", "Player", FALSE

"Age", "5", "Local", TRUE

"CityTile", "Center", "Local", FALSE

}

7 Edit your "..share/freeciv/dino/README.dino"

Optional stuff:

8 If you would like to have killing an animal give a bonus, edit your "..share/freeciv/dino/script.lua" and add a unit_lost_callback(). See this link -

[3]

9 Since the start of the game is now more dangerous, I like to add a strong defender to the start units. In file "..share/freeciv/dino/game.ruleset" -

set =

{ "name", "value", "lock"

"startunits", "cwxD", FALSE

...


10 File "..share/freeciv/dino/game.ruleset" can also change the default # of animals, which is usually set to 20. For example, to change it to 30, use -

set =

...

"animals", 30, FALSE

See also

Notes

  1. Barbarians in the conquered cities can and will build units, that are of roles either "BarbarianBuild" (accessible for them even when nobody actually knows how to build them, but if the unit requires some absent improvements, not accessible) or "BarbarianBuildTech" (accessible when the barbarians, not anybody, know required tech). They can steal techs (in most rulesets, only by conquest) or even develop them.
  2. You can meet a friendly unit in a village. The type of the unit is often the same as barbarians can have but in fact it is controlled by different flags ("Hut", "HutTech", the latter for FC2.5 refers to the explorer's advance), e.g. Chariot in civ2 is "Hut" but not "Barbarian". In known Freeciv versions, the unit type is not random.