1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

You have unleashed a horde of barbarians!

Discussion in 'Civ1 - General Discussions' started by SWY, Sep 7, 2016.

  1. SWY

    SWY Prince

    Joined:
    Oct 3, 2014
    Messages:
    330
    Gender:
    Male
    Location:
    The Netherlands
    Does anyone know how Civilization determines which tiles will contain a barbarian unit and whether they'll be legions or cavalry? Or is it just random?
     
  2. humbe

    humbe Warlord

    Joined:
    Nov 23, 2005
    Messages:
    168
    Darkpanda figured out a lot of that from the code: http://forums.civfanatics.com/showthread.php?t=510312

    All hut outcomes are random when you enter them, and you can "cheat" by knowing how the RNG works to get the outcome you want. If not, you can try to only get huts close to cities to avoid barbarians.
     
  3. SWY

    SWY Prince

    Joined:
    Oct 3, 2014
    Messages:
    330
    Gender:
    Male
    Location:
    The Netherlands
    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.
     
  4. humbe

    humbe Warlord

    Joined:
    Nov 23, 2005
    Messages:
    168
    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.
     
  5. SWY

    SWY Prince

    Joined:
    Oct 3, 2014
    Messages:
    330
    Gender:
    Male
    Location:
    The Netherlands
    I wasn't certain about the Legion units, but during my testing I had two Cavalry and one Legion unit spawning just this morning.
     
  6. deathfry

    deathfry Chieftain

    Joined:
    Jan 11, 2015
    Messages:
    32
    yeah, legions are also available, not only cavalry
     
  7. tupi

    tupi Chieftain

    Joined:
    Jun 25, 2011
    Messages:
    55
    Location:
    Russia
    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.
     
    Tristan_C likes this.
  8. tupi

    tupi Chieftain

    Joined:
    Jun 25, 2011
    Messages:
    55
    Location:
    Russia
    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: Mar 21, 2020
    Tristan_C likes this.

Share This Page