Announcement

Collapse
No announcement yet.

Babarians

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

  • Babarians

    A few questions regarding Babarians.

    I have played a lot, particularly Cradle, and
    a) it seems that Babarians peter out after 200-250 turns. There are a few around but they dont seem to be the problem they were at turn 100.
    b) am I right in thinking that there are in built spawn point(s) on the map where they appear from the random generation function. I have played some games where there is hardly a babarian in the game and others where they keep appearing, coming from the same direction. The cocnclusion being they keep appearing at a particular point on the map.

  • #2
    As far as I know barbarians are generated in the shaded area of the map under the fog of war. When you have enough cities or radar towers to "clear" the map around your empire they are no more spawning like rabbits.
    "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

    Comment


    • #3
      Some one could create some slic to automatically generate barbarians after the fog has gone.
      "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
      The BIG MC making ctp2 a much unsafer place.
      Visit the big mc’s website

      Comment


      • #4
        I am not against the current sytem, England and France have not known any invasion of barbarians since the Middle Age.
        "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

        Comment


        • #5
          What about in the American war of independence.

          A group of American barbarians ( yes American barbarians because they were not sanctioned by the American government.) invaded a port in Britain.

          However they forgot the matches so were unable to scuttle any ships(yes this bit is true they even ask for a light. From the towns folk).

          Or pirates for that matter what are pirates if not barbarians.
          "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
          The BIG MC making ctp2 a much unsafer place.
          Visit the big mc’s website

          Comment


          • #6
            Originally posted by The Big Mc
            What about in the American war of independence.
            The Native Americans could be considered as a nation or as agroup of nation, in the same spirit the future Americans could also be seen as invaders.

            A group of American barbarians ( yes American barbarians because they were not sanctioned by the American government.) invaded a port in Britain.
            More dissidents of a nation than barbarians IMO.

            However they forgot the matches so were unable to scuttle any ships(yes this bit is true they even ask for a light. From the towns folk).
            I think you are right after all, they were barbarians.

            Or pirates for that matter what are pirates if not barbarians.
            In this case I agree though many of them were actually corsairs paid by another nation. As far as I know, piracy is nowadays a minor threat concentrated in the poorest area of the world. Whatever the case I don't think that barbarians should appear in your inner territory once you have secured your frontiers.

            Of course if you play as the Greeks, you already have enough barbarians on the map without any need to add some.
            "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

            Comment


            • #7
              Hi, back in loged in land. I changed my security settings after my computer started doing strange things and then could not log in.

              I think that a comment above points to the problem. The Babarians are hard coded, so they are tailored for the original game. Turn 250 in the old game is a fair way in so the Barbarians are probably dropping out by that stage.

              "Some one could create some slic to automatically generate barbarians after the fog has gone."

              My thought exactly and I have made a code that allows for the creation of several immobile Babarian Leaders (ala Alexander scenario). These will be spawn points for random babarians later in the game and also for Attila and the Hun Horde andGhengis and the Mongols.

              However, I cant quiet get the code right to assign the spawn function to the babarians.

              Can anyone fix this for me.

              HandleEvent(BeginTurn) 'BarbSpawn_Test' post {
              tmpPlayer = 0;
              player[0] = tmpPlayer;
              location_t tmpLoc;
              barbsSpawn = barbsSpawn + 1;
              if (barbsSpawn >= 10) {
              barbsSpawn = 0;
              for (i = 0; i < player[0].units; i = i + 1) {
              GetUnitByIndex(tmpPlayer, i, tmpUnit);
              if(tmpUnit.type == UnitDB(UNIT_BARBARIAN_LEADER)){
              SpawnBarbs (0, tmpUnit.location, 0, 1); // Spawn between 1 and 6 Barbarians 1 square away from leaders


              }
              }
              }
              }
              SpawnBarbs is the function from the AG scenario that creates the barbarians.

              Comment


              • #8
                I am SLIC "blind" so I will leave The Big Mc the task to study your code and correct it.
                "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                Comment


                • #9
                  I didn,t know anything about SLIC for a long time but gradually learnt.

                  This is the first time I have tried to do things with the Barbarians, assigning functions to different players is still a bit confusing.

                  Comment


                  • #10
                    Originally posted by stankarp
                    Code:
                    HandleEvent(BeginTurn) 'BarbSpawn_Test' post {
                    	tmpPlayer = 0;
                    	player[0] = tmpPlayer;
                    	location_t	tmpLoc;
                    	barbsSpawn = barbsSpawn + 1;
                    	if (barbsSpawn >= 10) {
                    			barbsSpawn = 0;
                    			for (i = 0; i < player[0].units; i = i + 1) {
                    			GetUnitByIndex(tmpPlayer, i, tmpUnit);
                    			if(tmpUnit.type == UnitDB(UNIT_BARBARIAN_LEADER)){			
                    			SpawnBarbs (0, tmpUnit.location, 0, 1);  
                    			// Spawn between 1 and 6 Barbarians 1 square away from leaders
                    					
                    				
                    			}
                    		}
                    	}
                    }
                    The major bug appears to be in the SpawnBarbs function. If the code you used was exactly the same as the AtG one, then the code above generates between 0 and 0 barbarians. You want the first figure to be 6 (for example).

                    Also, once every 10 BeginTurns might be a little too frequent perhaps - if you're playing with 8 players, that's almost once every human turn. Consider a check as to which player's turn it is, and spawn every 10 barbarian turns.

                    Code:
                    int_t	barbsSpawn;
                    HandleEvent(BeginTurn) 'BarbSpawn_Test' post {
                    	tmpPlayer = 0;
                    	if(player[0] == tmpPlayer){
                    		location_t	tmpLoc;
                    		barbsSpawn = barbsSpawn + 1;
                    		if (barbsSpawn >= 10) {
                    			barbsSpawn = 0;
                    			for (i = 0; i < player[0].units; i = i + 1) {
                    			GetUnitByIndex(tmpPlayer, i, tmpUnit);
                    			if(tmpUnit.type == UnitDB(UNIT_BARBARIAN_LEADER)){			
                    				SpawnBarbs (6, tmpUnit.location, 0, 1);  
                    			// Spawn between 1 and 6 Barbarians 1 square away from leaders
                    			}
                    		}
                    	}
                    }
                    Concrete, Abstract, or Squoingy?
                    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

                    Comment


                    • #11
                      Great to see you back IW.

                      Now I see where I went wrong.

                      Trying the change now.

                      "if (barbsSpawn >= 10)"

                      This was only for testing of course, dont want Barbarians every 10 turns.

                      Thanks again.

                      Comment


                      • #12
                        I have just drafted an idea for a much more complicated barbarian model.

                        Four types of barbarians creation types

                        Random

                        Barbarians appear randomly on the map

                        Regional
                        A region is specified which has a lot of barbarians often being only 5 or 6 tiles big.

                        Leader

                        A random barbarian leader is generated which changes with age.

                        Camp

                        A barbarian camp works similar to the leader


                        The hard bit is going to be to get the barbarian unit DB to add and remove units depending on age

                        There will also be an option to allow you to attack barbarian leaders and camps to steel gold of the barbarians.
                        "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                        The BIG MC making ctp2 a much unsafer place.
                        Visit the big mc’s website

                        Comment


                        • #13
                          My code so far -

                          Places one Barbarian Leader every 30 X 45 map area. Each 100 turns, each surviving BL spawns units appropriate to the age.

                          Normal random spawning continues.

                          On turn 325 (about 100 AD), Attila, a Wonder Unit spawns along with an army at one of the BL's.

                          Working on the same for Ghenis Khan and the Mongols.

                          Comment


                          • #14
                            sourcecode\ctp2_code\gs\gameobj\barabarians.cpp and barabrians.h show a lot of how they are generated and what units, but i cant make much sense out of it
                            Formerly known as "E" on Apolyton

                            See me at Civfanatics.com

                            Comment


                            • #15
                              I had a look. The way the barbarian generation is performed is really bizarre (and I found at least two bugs in the code ).

                              If there is exactly one human player, then they are placed as follows:

                              A human city is selected at random, and then neighbours of this are selected at random repeatedly (essentially this generates a random walk around the map) for at most 4000 steps until it finds a land square not visible to the human player which is at least as far from the nearest human city as a given minimum distance, and then places the barbs there.

                              If there are zero or more than one human players, then they are placed as follows:

                              Random squares on the map are chosen (for at most 400 attempts) until a land square is found which no player can see, and the barbs are placed there.

                              There are several problems with the SP algorithm:

                              Barbs will always be placed "just out of sight" for the human player, and whether other players can see the square is ignored (although this is a bug - it isn't supposed to be ignored). This is very unfair, and strange.

                              This method is likely to produce barbs on the borders between the human player and the AIs, exactly in the warzones where all the troops will be and so the barbs will probably be easily dealt with.

                              If that doesn't happen, then they will be placed just inside the neigbouring AI civs, possibly right next to their cities (in fact, it might try to place them inside their cities!) which is also not good.

                              The way in which the code randomly walks around in the SP algorithm is quite silly, and could easily result in it getting stuck and no barbs being produced when a large portion of the map is visible to the human player. This is particularly true on a map with much water.

                              Comment

                              Working...
                              X