 |
|
stankarp
|
|
australia
Feb 2002 time: 05:23
|
|
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.
|
|
|  |
 |
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:23
|
|
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.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:23
|
|
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.
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:23
|
|
quote: 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
}
}
}
}
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:23
|
|
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.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:23
|
|
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.
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:23
|
|
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.
|
|
|  |
All times are GMT. The time now is 05:23. Apolyton Time is 00:23. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|