You have unleashed a horde of barbarians!

Thank you humbe. I've already implemented the hut outcome into CivOne.
I'm not trying to avoid barbarians. I'm trying to figure out which tiles the barbarians will spawn on, and whether the barbarian units are Legion or Cavalry units.
 
The distance algorithm Darkpanda talks about, I haven't managed to match up with the game. I've found tiles I've calculated should be close enough to get unit, but then it ended up not being so. So either the distance algorithm is not exactly right, or I have misinterpreted how it works. But other than that it seems to work as outlined in the post above there.

I can't remember ever having seen legions from a hut. I thought only cavalry spawned. Legions together with a leader can come from random events when barbarians come from nowhere onto the coastline or something though.
 
Well, about huts.
If you have 1 city (or, more precisely, you had 1 city in the beggining of your turn): 3 units: north, west, south-east
If you have 2 cities: 4 units: north, east, south, west
If you have 3 cities or more: 8 units: every square
If unit can't spawn (ocean, enemy unit) it will not, so in reality sometimes there are 0,1,2,5,6 or 7 units spawned.
Usualy they all are cavalry.
I tried to understand conditions for legions, but just gave up. It have something to do with current random seed - you can enter in city etc. for differet results. But in some save files there is always zero legions, no matter what.
I'v never seen more than 2 legions from a hut: 0, 1 or 2 (more rare?) out of 3 units, 0, 1 or 2 (more rare?) out of 4 units - never in front of each other(n and s or w and e), but maybe it's just an coincidence, and 0 or 1 out of 8 (I guess 2 out of 8 is a thing, I just never saw it). Maybe it can be more than 2, but extremely rare.

I'm porting Civ1 to Sega Genesis, so I'm interested too, but I still have no idea about legions.
As usual, sorry for some incorrect grammar.
 
So, finally. There's only one condition for legions: mountains. Actually, it's so simple it was completely possible to understand that only from tests, but anyway.
Game logic here:
if movement cost <= 2
then spawn cavalry
else
spawn legion


In unpacked 745.05 it's 0xCB15 (80 BF 8E 02 02...). 1866:1d1a in Ghidra.
 
Last edited:
Top Bottom