 |
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:17
|
|
I've written some code.
Due to the playability and likely situations for civs needing or wanting to merge or whatever, I have come up with two ways of it happening:
1 - The human is on an all-out killing spree. Every time he takes a city, a function fires to see whether or not the conditions are right for a merge. It checks the top 3 non-human civs. If any pair of them (1,2 1,3 2,3) are both at war with the human (likely), at peace with each other (likely) and have less cities in total than the maximum needed under the more powerful of the pair's government, they then have a chance of merging. This chance is presently defined as (the game year divided by 50)%, though this may change.
2 - The human is going for a science victory, or diplo victory, and hasn't taken a city for a while. It is, quite frankly, coasting. If it does not take a city for 35 turns, there is a (year/200)% chance of a merge between a random two adjacent civs. If the human does not take a city for 75 turns, there is a (year/100)% chance of a merger. (all this providing the two random civs are at peace and have few enough cities)
Because of the nature of this code, the SLIC is very hard to playtest, so if anyone is about to begin a game, I would be very happy if they unzipped this SLIC into the ctp2_data folder beforehand . It does not give any errors on startup, but who knows what the future may hold 
File attatched.
Ben
Attachment: iw_mergecivs_26-01-02.zip
This has been downloaded 24 time(s).
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:17
|
|
quote: Originally posted by Immortal Wombat
Every time he takes a city, a function fires to see whether or not the conditions are right for a merge. It checks the top 3 non-human civs. may change.
|
Shouldnt we have a code for the 3 worst civs instead of the 3 top.
Those are the ones that really could use help.
Last edited by Pedrunn on 28-01-2002 at 16:51
|
|
|  |
 |
|
hexagonian
|
 |
Gnawing on your mind...
Jun 1999 time: 23:17
|
|
If anything, what would help the AI is to prompt it to peacefully expand more during the course of the game. I believe that the AI has an almost unhealthy respect for borders in regards to settling, so as the map is filled up with cities/borders, the AI settlers end up wandering around, or worse yet, sitting in a military stack taking up valuable combat slots. (not that settlers sitting in a stack is a bad thing - as long as they end up settling somewhere.)
Still, I think if this piece of SLIC could be pulled off, it will add an exciting dynamic to the game (almost an EU2 feel) and would also reflect aspects of actual history - something that I think cannot be duplicated in civ2 or civ3, though correct me if I am wrong (the rise of new civs).
This type of effect should be limited to a late game occurance when the AI starts to lag.
It seems to me that the AI is doing alright in science and is usually in the same type of government that the human player is in for the bulk of the game in 'Cradle' - the problem, as Lou says, is in empire size based on number of cities which means that the human player can eventually outproduce the AI.
I see the max city setting for governments as the only potential problem - but the main reason the AI civs do fall behind is that they are not anywhere near the max city setting in the later game, so the numbers can be adjusted up slighly for the later governments to compensate - and a unification should greatly help the AI - even a unification between the 2nd place civ and the weakest civ will most likely benefit the AI.
Is it possible to overwrite the max city setting code via SLIC that will kick in when the unification process starts?
And Lou's point regarding the need to limit this event in the game is a very valid one, as there is the possibility that the game could eventually boil down to a 2-civ game without those limits. It could be triggered by researching a certain advance (and the advance would have to be one that is not a dead-end advance either) or something along those lines like turns - but I agree that it may be better to tie it into the number of cities - (possibly if the game is on turn 500 and the human civ has 150% more cities, then the SLIC file triggers a peaceful unification between 2 other civs.)
Using this type of SLIC in conjunction with an altered NumPlayers and MaxPlayer setting in userprfile.txt will ensure that the game will have a constant influx of new and changing civs. (I can see the message that civA and civB have united due to a royal marriage - and this type of thing adds immensely to in-game atmosphere)
The bottom line is to get a game that continually challenges a player during the course of the game - if this accomplishes this goal, then I'm all for it, and this will be a part of Cradle.
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:17
|
|
quote: Originally posted by hexagonian
This type of effect should be limited to a late game occurance when the AI starts to lag.
|
Its current setting means it could has a 1% chance of happening if you take a city after 100 turns, or if you have had 35 turns of peace after turn 500. However, this is very, very unlikely. The chance increases through the game. How many turns are there? 1000 in the whole game? That would give a 10% chance of a merge every time you take a city after then. I will add a line to limit it to 2 merges I think. Or possibly to 1/4 of the number of players.
quote:
I see the max city setting for governments as the only potential problem - but the main reason the AI civs do fall behind is that they are not anywhere near the max city setting in the later game, so the numbers can be adjusted up slighly for the later governments to compensate - and a unification should greatly help the AI - even a unification between the 2nd place civ and the weakest civ will most likely benefit the AI.
|
Peter has informed me that the function I was using to get the number of cities available under the player's government will not work. Unless I can find a workaround, the city limits are a problem. There is a way to use SLIC to compensate for the unhappiness for the AI, but I think perhaps a better way to do it would be to set city limits really high in the text files, and then simply use SLIC to punish the human for any extra cities over the limit.
quote:
Is it possible to overwrite the max city setting code via SLIC that will kick in when the unification process starts?
|
Yes.
quote:
And Lou's point regarding the need to limit this event in the game is a very valid one, as there is the possibility that the game could eventually boil down to a 2-civ game without those limits. It could be triggered by researching a certain advance (and the advance would have to be one that is not a dead-end advance either) or something along those lines like turns - but I agree that it may be better to tie it into the number of cities - (possibly if the game is on turn 500 and the human civ has 150% more cities, then the SLIC file triggers a peaceful unification between 2 other civs.)
|
I'll start a poll...
quote:
The bottom line is to get a game that continually challenges a player during the course of the game - if this accomplishes this goal, then I'm all for it, and this will be a part of Cradle. |
Lets hope it will 
|
|
|  |
 |
|  |
 |
|
hexagonian
|
 |
Gnawing on your mind...
Jun 1999 time: 23:17
|
|
OK, got the file without any problem.
Got some questions regarding the following lines within the SLIC code...
=================================================
int_f GetCityLimit(int_t testCiv)
{
int_t CityLimit;
player[0] = testCiv;
if(player[0].govttype == GovernmentDB(GOVERNMENT_ANARCHY)){
CityLimit = 1000;
} elseif(player[0].govttype == GovernmentDB(GOVERNMENT_TYRANNY)){
CityLimit = 10;
} elseif(player[0].govttype == GovernmentDB(GOVERNMENT_THEOCRACY)
|| player[0].govttype == GovernmentDB(GOVERNMENT_MONARCHY)
|| player[0].govttype == GovernmentDB(GOVERNMENT_REPUBLIC)) {
CityLimit = 20;
} elseif(player[0].govttype == GovernmentDB(GOVERNMENT_COMMUNISM)
|| player[0].govttype == GovernmentDB(GOVERNMENT_DEMOCRACY)
|| player[0].govttype == GovernmentDB(GOVERNMENT_FASCISM)) {
CityLimit = 35;
} elseif(player[0].govttype == GovernmentDB(GOVERNMENT_TECHNOCRACY)
|| player[0].govttype == GovernmentDB(GOVERNMENT_CORPORATE_REPUBLIC)) {
CityLimit = 45;
} elseif(player[0].govttype == GovernmentDB(GOVERNMENT_VIRTUAL_DEMOCRACY)
|| player[0].govttype == GovernmentDB(GOVERNMENT_ECOTOPIA)) {
CityLimit = 60;
}
return CityLimit;
}
// return what generation (age) of governemts is currently available for 'thePlayer'
// this is a stand-in until the player's government can be found somehow.
// Based on part of Wouter's MM2 Partisan code.
int_f GetAge(int_t thePlayer) {
int_t tmpPlayer;
tmpPlayer = thePlayer;
if (HasAdvance(tmpPlayer, ID_ADVANCE_VIRTUAL_DEMOCRACY) && HasAdvance(tmpPlayer, ID_ADVANCE_ECOTOPIA)) { // if player has both diamond govs possible,
CityLimit = 60; // they will be using one of them
} elseif (HasAdvance(tmpPlayer, ID_ADVANCE_TECHNOCRACY) && HasAdvance(tmpPlayer, ID_ADVANCE_CORPORATE_REPUBLIC)) { // etc.
CityLimit = 45;
} elseif (HasAdvance(tmpPlayer, ID_ADVANCE_DEMOCRACY)){
if(HasAdvance(tmpPlayer, ID_ADVANCE_COMMUNISM) || HasAdvance(tmpPlayer, ID_ADVANCE_FASCISM)) {
CityLimit = 35;
}
} elseif (HasAdvance(tmpPlayer, ID_ADVANCE_MONARCHY)){
if(HasAdvance(tmpPlayer, ID_ADVANCE_THEOCRACY) || HasAdvance(tmpPlayer, ID_ADVANCE_BUREAUCRACY)) {
CityLimit = 20;
}
} else {
CityLimit = 10;
}
return CityLimit;
}
=================================================
Since Cradle has a bunch of new governments, what do I need to do with the above code to accurately reflect Cradle's government - especially if there are a lot of max. city variance within the governments that belong to the same age?
And the following question about the code posted below...
=================================================
int_f IsDecentAdvance(int_t AdvanceID)
{
if(AdvanceID == AdvanceDB(ADVANCE_GUNPOWDER)
|| AdvanceID == AdvanceDB(ADVANCE_INDUSTRIALIZATION)
|| AdvanceID == AdvanceDB(ADVANCE_TANK_WARFARE)
|| AdvanceID == AdvanceDB(ADVANCE_ADVANCED_INFANTRY_TACTICS)
|| AdvanceID == AdvanceDB(ADVANCE_FLIGHT)){
return 1;
}
else {
return 0;
}
}
=================================================
Are these the advances that can potentially enable the code to kick in?
|
|
|  |
 |
|
Immortal Wombat
|
 |
in perpetuity
Dec 2000 time: 05:17
|
|
Right.
The int_f GetCityLimit function doesn't work. I was trying to make a string ("text") equal a number. Not possible unfortunately.
So that code is in there in case I find a workaround.
the int_f GetAge function is the one that is being used. If you could post, or email me a list of Cradle governments and their respective city limits, I will try to get some code to work it out, based on the personality, strategy being used and governments available to guess (as accurately as possible) what government the AI is using.
quote:
Are these the advances that can potentially enable the code to kick in?
|
Yes. I didn't know what to put, and I figured everyone would want to customise anyway. So, to add extra ones, add a copy of the line:
code:
|| AdvanceID == AdvanceDB(ADVANCE_TANK_WARFARE)
In between the first and last ones, with the ADVANCE_TANK_WARFARE changed to the Advance.txt name for the advance you want.
Similarly taking them out, just delete them, but note deleting the first and last ones is slightly harder, though I think even you could figure out the logic of the code to work out how to take them out. 
|
|
|  |
 |
|
hexagonian
|
 |
Gnawing on your mind...
Jun 1999 time: 23:17
|
|
OK, fixed the citylimits file...
Regarding the Hurricanes:
I was running the test in the cheat mode on a small map with 3 civs. I ran the test both with barbarians and without barbarians. (originally I ran the test without and noticed the crash/burn, then I thought that I needed to have the barbarians in the game - same results though) I had also tried to increase the movement to 12, vision to 20 and fuel to 48 without success.
I am using Dale's code. Is this change to be made in his code (no lines in his code resemble the suggested change) or to your code? (the closest line in your code is the following
int_T i;
ND_H_NumPlayers = preference("NumPlayers"); // find human...
for(i = 1; i < ND_H_NumPlayers; i = i + 1){
if(IsHumanPlayer(i)){
ND_H_HUMAN = i;
}
}
}
Last edited by hexagonian on 15-02-2002 at 01:15
|
|
|  |
All times are GMT. The time now is 05:17. Apolyton Time is 00:17. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|