Announcement

Collapse
No announcement yet.

Mr. Orge and Mod Makers alike...question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mr. Orge and Mod Makers alike...question...

    i've been playing with the game now for several weeks and have been wondering if the barbarians can be more of a hidden nuisance than an invading army type. i had mentioned in a previous post that i'd like to see the barbarians lose the use of military (offensive) units and switch over to the stealth units later in the game. playing around with the risks.txt only allows me to lengthen their stay in the game and allow them to use more powerful units like tanks, etc. what i'm looking to see is can they instead be allowed to use spies (i'd like to have them damage units and blow up specific buildings), infectors, eco-terrorist type (basically the assassinate ability), and lastly, the park ranger (using a nuke instead of the actual flower power bomb).

    i think that barbarians should not only represent raiders and barbarians in the old days but also the terrorists of our times. hence in the modern years of the game instead of seeing barbarian tanks and marines i'd like to deal with a rogue infector prancing about in my back yard. i imagine this will have to have some sort of SLIC coding done to trigger the change in era for the barbarian units. i do know that the barbarian AI will use an infector if it finds cities on it's continent that range 20+ population. can i change that so it will infect everything in site until it either gets caught or dies in the attempt?...i hope so. i did try to get the AI to use an eco-ranger(i think this is the blue bike thingy) unit but that didn't produce anything...darn unit just stayed in place the entire time.

    so the basic question here is:
    1) is it possible to make the barbarian use stealth units later in the game instead of military offensive ones?
    2) if so, can the barbarian AI use some specific abilities (IE: infect, assassinate, nuke, etc...) per unit?
    3) given that it costs $ to use these abilites, can the barbarian AI have this restriction removed?? as i know from experience giving it money will only allow it to build oodles of hoplites and other useless units.

    any sort of help in this area would be GREATLY appreciated!!

  • #2
    I've increased the abilities of barbarians so they are always taking someones city so I assume that they'd have gold built up to pay for special attacks. I also made a seperate barbarian build list that the barabarian will start out with foot units, move up to mounted units as they become available then finally into the specialists later. I havent gotten to the point tech wise that the specialists will come into play but the game hasnt blown up, so conceptually it should work when I get to that point.

    ------------------
    History is written by the victor.

    Comment


    • #3
      Alpha, that's a good start but it still begs the question...will the barbarian use ONLY stealth units later in the game or still military? i'm hoping it can be made to use only stealth units, even if we have to create a few that will be specifically barbarian only.

      Comment


      • #4
        Actually, i never thought of having some new units limited to a new barbarian type of gov but thats a great idea. The way the AI builds units is based off build queues. Once the go beyond a unit, I havent seen them go back to build obsolete units.

        ------------------
        History is written by the victor.

        Comment


        • #5
          hmm...a barbarian gov't...sounds good but it needs to be restricted to the barbarians ONLY. i would think that later in the game, it would only be able to produce stealth units (with the use of the militia trigger it's cities wouldn't be such a cakewalk to take from them). i do think we could create a limited number of "special units" even using ones already in the game as specific barbarian stealth units.

          i do hope though that the barbarian SPONTANEOUS affect can be modified to use stealth units later in the game instead of just military ones. it should be more of a terror weapon later in the game than a conquering one.

          Comment


          • #6
            I'm sure you can have barbarian stealth units appear either at random or on certain pre-assigned turns. Whether they actually use them or not is another matter. I think it's risks.txt or maybe const.txt that has last barbarian turn at 350. Once you have the SLIC done, you could either modify that # to suit your needs and have barbarian stealths appear after that or have both military and stealth units through the whole or part of the game. I have code for random barbarians that could quickly be modified to give stealths. The problem is you would probably want them to appear near a random city and I don't have that coded already.

            // Spawns a random number and type of barbarian units at a location within a certain distance
            void_f SpawnResist (location_t tmpLoc, int_t tmpDist)
            {
            int_t tmpRand;
            int_t tmpRand2;
            int_t i;

            tmpRand = Random(5) + 3; // Spawn between 3 and 8 units ???? might be 2 and 7, not sure
            for(i = 0; i < tmpRand; i = i + 1) {
            tmpRand2 = Random(5); // 1/6 chance of each type unit
            if (tmpRand2 == 0) {
            CreateUnit(0, UnitDB(UNIT_ANTIAIR), tmpLoc, tmpDist);
            } elseif (tmpRand2 == 1) {
            CreateUnit(0, UnitDB(UNIT_GERMAN_BOMBER), tmpLoc, tmpDist);
            } elseif (tmpRand2 == 2) {
            CreateUnit(0, UnitDB(UNIT_GERMAN_FIGHTER), tmpLoc, tmpDist);
            } elseif (tmpRand2 == 3) {
            CreateUnit(0, UnitDB(UNIT_GERMAN_TANK), tmpLoc, tmpDist);
            } elseif (tmpRand2 == 4) {
            CreateUnit(0, UnitDB(UNIT_GERMAN_TANK2), tmpLoc, tmpDist);
            } elseif (tmpRand2 == 5) {
            CreateUnit(0, UnitDB(UNIT_ARTILLERY), tmpLoc, tmpDist);
            }
            }
            }

            I had the above in WW_func.slc but you could probably put it in scenario.slc. Just change the unit names using names from units.txt. The code below was in scenario.slc. Worked great, barbarians every few turns until another spawner took over. This would create a few random units 4 tiles from dusseldorf in this case. I think you would want to have it happen near a random city though. Sorry I haven't got anything for that yet. If/when I do I'll post it here if someone else hasn't already.

            // spawn resistance near dusseldorf
            } elseif (turnCount == 3 | | turnCount == 7 | | turnCount == 9 | | turnCount == 12 | | turnCount == 15) {
            SpawnResist (dusseldorfloc,4);
            }

            Comment


            • #7
              I'd think a barbarian government would be easy. You can give the barbarians a default gov, then dont let it be researched. That will limit it. I have too many ideas and not enough time to tet them all

              The barbarian build list seems to be working great so far. They are building the most modern army of of any civ in my test game. i lost alot retaking one of my cities.

              ------------------
              History is written by the victor.

              Comment


              • #8
                Hows this look for a barbarian gov? i took a mixture of tyranny and monarchy but took away any negatives for being warlike. Then add an ADVANCE_BARBARIAN but dont add it to any AI build lists, so none of the AIs should go after it. I didnt get a chance to test it tonight but it should work.

                GOVERNMENT_BARBARIAN {
                Icon ICON_GOV_TYRANNY
                EnableAdvance ADVANCE_BARBARIAN
                Rank 1
                SameRankAdvice GOVERNMENT_TYRANNY_SAME_RANK_ADVICE HigherRankAdvice GOVERNMENT_TYRANNY_HIGHER_RANK_ADVICE RationsExpectation -1
                PositiveRationsCoef 1
                NegativeRationsCoef 1
                WorkdayExpectation -1
                PositiveWorkdayCoef 1
                NegativeWorkdayCoef 1
                WagesExpectation -1
                PositiveWagesCoef 1
                NegativeWagesCoef 1
                FoodCoef 0.1
                ProductionCoef 0.85
                InfrastructureCoefficient 0.5
                CrimeCoef 1.5
                CrimeOffset 95
                KnowledgeCoef 1
                MaxScienceRate 0.25
                GoldCoef 0.75
                CapitalizationCoefficient 0.5
                UnitRushModifier 2
                BuildingRushModifier 5
                WonderRushModifier 100
                EndGameRushModifier 6
                MaxIncomingTrade 100000
                MaxOutgoingTrade 100000
                PollutionCoef 1.3
                PollutionUnhappyCoef 0.02
                SupportCoef 1.0
                TurnsToNewReadiness 1
                ReadyPeaceCoef 0.5
                ReadyPeaceHP 0.5
                ReadyAlertCoef 0.75
                ReadyAlertHP 0.8
                ReadyWarCoef 1
                ReadyWarHP 1
                DefenseCoef 0.85
                WarDiscontentMaxUnits 5
                WarDiscontentPerUnit 0.1
                ConquestDistress -4
                ConquestDistressDecay 0.2
                OverseasCoef 0
                OverseasDefeatDecay 0
                OverseasDefeatCoef 1
                HomeDefeatDecay 0.5
                HomeDefeatCoef 1
                MaxMartialLawUnits 8
                MartialLawEffect 1
                MartialLawThreshold 80
                AtHomeRadius 2
                EmpireDistanceScale 0.002
                MinEmpireDistance 300
                MaxEmpireDistance 2000
                TooManyCitiesThreshold 10 TooManyCitiesCoefficient .1
                ProfessionalUnits 0
                GrowthRank 1
                ProductionRank 1
                CommerceRank 1
                ScienceRank 1
                GoldRank 1
                MilitaryRank 3
                PollutionRank 1
                LoyaltyRank 1
                MartialLawRank 5}

                ------------------
                History is written by the victor.

                Comment


                • #9
                  Radical,
                  Regarding the thread on natural disasters via SLIC, seems like the random barbarian logic is very similiar to what we need to create quakes or plagues. Instead of creating a unit, couldnt we do infect attacks if a city is within x tiles of that random spot?

                  ------------------
                  History is written by the victor.
                  [This message has been edited by Alpha Wolf (edited January 05, 2001).]

                  Comment


                  • #10
                    Alpha,
                    That might work as well, it comes down to the same thing. But if you want to be sure the event happens once every so often (e.g. there should be a 25% chance that the barbarians are created every turn so that they get created approximately once every 4 turns), looking at a random location might not work, since it could well be that half the time no city is found and the barbarians are actually executed only once every 7 or 8 turns on average (which would differ per number of civs and mapsize and play-style, etc). By looking for a city you would know for a fact, independent of mapsize or whatever, how often it occurs. So it's just what you prefer, if you don't mind this dependancy you might as well do it like that.

                    Anyway, if you'd like the code to happen near a random city, here's an example on how it might look (untested so there may be a few minor bugs but the general idea should work):

                    Code:
                    // this code assumes any non-existing player is barbarian, ala CtPI
                    // also, I'm not sure if Random(3) return a value between 0 and 3 or 0 and 2, so this needs to be tested
                    
                    HandleEvent(BeginTurn) 'BarbarianThread' post {	// execute everytime at the beginning of someone's turn
                    location_t	randomLoc;
                    city_t tmpCity;
                    int_t i;
                    int_t j;
                    int_t cityIndex;
                    int_t count;
                       player[1] = 0;	// barbarians
                       count = 0;
                    
                       if (player[0] == 0) {	// if the current player is barbarian (needed so this gets executed only once a year)
                          if (Random(3) == 1) {	// have a 25% chance that this happens (or is it 33%?)
                             for (i = 0; i < 32; i = i + 1) {	// cycle through all players
                                player[0] = i;			// store player
                                if (player[0] != player[1]) {	// if this player isn't barbarian
                                   for (j = 0; j < player[0].cities; j = j + 1) {	// cycle through all cities of this player
                                      count = count + 1;	// add all cities of this player to a variable 'count'
                                   }
                                }
                             }	// 'count' now contains the total number of cities in the game not owned by barbarians
                             cityIndex = Random(count);	// or is it count-1? this picks the random non-barbarian city that will get barbarians
                             for (i = 0; i < 32; i = i + 1) {	// cycle through all players again to find the city that belongs to cityIndex
                                player[0] = i;			// store player again
                                if (player[0] != player[1]) {	// if this player isn't barbarian again
                                   for (j = 0; j < player[0].cities; j = j + 1) {	// cycle through all cities of this player again
                                      if (cityIndex != 0) {			// if cityIndex isn't 0
                                         cityIndex = cityIndex - 1;	// deduct 1 (this city isn't the city that will get barbarians)
                                      } else {				// if it is this city, this is the city that you were looking for
                                         GetCityByIndex(player[0], j, tmpCity);	// get the actual city
                                         randomLoc = tmpCity.location;	// put the location in a variable
                                         SpawnBarbarians(randomLoc, 4);	// call the routine that will create barbarians
                                      }
                                   }
                                }
                             }
                          }
                       }
                    }
                    Edit: SLIC in HTML sucks
                    [This message has been edited by Locutus (edited January 05, 2001).]
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #11
                      EXCELLENT!! i'm glad this is generating a good deal of responses. Alpha, the barbarian gov't looks fine but there is a minor hiccup with this. IF the barbarian does indeed take a city and hold it long enough (till the point where it would use only stealth units and not military offensive ones) then how will it acquire the necessary tech to build it's "special" stealth units? i was thinking that perhaps if the barbarians auto gain the same tech as either the highest or second highest civ in the game then that would take care of this problem. but is that possible??

                      Radical, that SLIC coding is great and i do hope you can actually do ONE experiment for me with it. can u modify it so that the barbarians DO get stealth units in a game of yours and see how they act? as i mentioned above, some units do work, some don't. i believe this may all be related to technology, so i'll go about testing that tonight.

                      many thanks for the extra code there Locutus. i do hope we can put it all together and come up with something that will make them barbarians a bit nastier.
                      i was wondering where this code should go. i'm assuming that this code would go before Radical's code for the spawner?

                      Comment


                      • #12
                        alpha, it sounds like you've hit upon something good with your changes to the barbarians. i do think the barbarians should have access to the tech list too so they can build certain units but i wonder if it can be made for them that they only build the stealth units later in the game? hopefully so.

                        Comment


                        • #13
                          All AI building is done off of the build lists. The AI reads thru the list, and builds the last thing that it can. So if the list consisted of a,b,c,d,e the AI will build only a's until it gets the tech for b. Also, if it should find the tech for e, it will never build anything else. So I created a list specifically for the AI, and it should only build those units. However, it also is dependent on the attack/defense/ranged percentages. so if it needs a ranged unit, and b is the most current ranged unit that it has, then it will build a b. there are also specific number of special units that it will try to build so that number can be increased, to pump out more terrorists. However, the barbarians still need some military units in order to defend its cities. This will take some playtesting to get the right percentages and such but is very easy to implement.

                          ------------------
                          History is written by the victor.

                          Comment


                          • #14
                            Alpha, i was thinking that with the Milita triggers in place, the AI would have at least 1 unit in place to defend. the problem with the barbarian AI is that it tends to build and build units until it fills up it's space and can't build anymore units. i was trying to prevent that by limiting it to only stealth units which can't fortify.

                            Comment


                            • #15
                              Martock,

                              I did modify the code for a scenario I'm working on. I only used eco-terrorists and only gave them the infect city attack. I'm still in the early stages of creation so I just have cities and no units added at the beginning. The stealth barbarians were created on turn 3 and within 1 or 2 turns they attempted to infect the city I had them appear near. Within a few more turns they had infected every one of my 6 cities. I haven't tried any other units out but the barbarians definitely use eco-terrorists. I should have switched to cheat mode to see how many they had, but didn't think about it at the time. It seemed like as soon as they could move to the next city, they were attacking.

                              Alpha, I've been working on my scenario stuff almost all day and my brain is overloaded. I might be at a point to work on the natural disaster thing by Sunday, but I'm not an SLIC expert so it could be anywhere from an hour to a few days before I have something, assuming nobody else gets to it first. I don't remember who posted it but that x-y code looks like a good start.

                              Comment

                              Working...
                              X