Thread Tools
Old October 13, 2002, 18:28   #121
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
Actually we can send the message for every player. AI will get the message although he wont use it.
I actually didn't read that part properly, that's why I haven't replied to it. Martin tried to do that in a fix for the KillCityOption for MP but it didn't work. I tested it again a few nights ago. Any news on that, Martin?
mapfi is offline  
Old October 18, 2002, 07:21   #122
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Had another go at it last night and got it almost done.
When playtesting I discovered a problem with our loop workarounds. I'd get a DoYouWantToConvert message for a city which I had conquered every turn. My suspicion is, that because of the asynchronous execution of the events the following happens: In the BeginTurn handler, the ConvertCity event is called for each city with the global variables set to prevent the message and that part of the code appearing. So for each city an event will be added to the 'waiting to be executed list' Then the first city goes through this event and those global variables are set back to their default value, resulting in a execution of the message code for the next city that has a different religion. Am I thinking right here??
After changing all convert handling code to the convertcityunit event things work now and we can even get rid of those global variables!

Furthermore I started writing on a readme, here's what I've got so far:

README to the Religion Code by Pedrunn and mapfi

Basic Idea:
The game already provides religion as a gameplay option. So far this was only available for theocratic governments. This mod makes it available to every rulership. Furthermore it introduces the concept of a changeable state/leader religion. The religion’s names are those of the founding civilizations.

Features:
-You’re starting religion will be your own, easily noticeable when you found your first city because the blue cross will appear next to the name on the next turn. Every fifth turn a religion info message will appear. It tells you: your current state religion, the current religion level (percentage of world pop converted to your state religion) and the effects religion has on cities, those being amounts of money paid by/to you by your/foreign cities with different/your state religion and happiness effects on each city depending on the success of the city’s religion. Be advised that in the beginning you need to grow as quickly as the AI’s in order not to have to put up with a severe happiness penalty for quite a while.
-With the discovery of religion (often already given at start) you’ll be able to build priests. Their abilities are those of the known cleric, converting cities, selling indulgences and soothsaying. Converting another city if successful has a chance of converting the AI to your state religion. While you won’t get any money from that player anymore the religion level of your civ will rise resulting in greater happiness. If another player successfully converts some of your cities the citizens will ask you to convert to this new religion. Positive aspects are that you won’t be paying anything to that civ anymore and your happiness will rise in those cities, the drawback is that you’ll have to reform the not yet converted cities which can be rather costly. With the discovery and the installment of a theocratic government you’ll be able to produce clerics, which have higher success rates when converting.
-Reformation by combat units: On ordering a reformation you’ll be giving the following options: Don’t do it after all, convert to your state religion or convert to your civ’s original religion. The last one will also revert your state religion back to your civ’s original religion. Reformation costs now depend on the religion level of the city’s religion you’re trying to convert and the number of combat units that can help you with the reformation in that city.
-Settler religion: Settlers, being of the pop of a city, naturally have the religion of that city and will stick to it even when that city is converted while they’re looking for a new settling spot. The newly founded city will then have the settler’s religion.
-Assimilation: By killing another player every city on the planet that was converted to this civ’s original religion will be converted to your current state religion.
-Diplomacy: Player’s with the same state religion will like you more, while the other’s will like you less.

Exact numbers and formulas: costs/succes rates/happiness ...
mapfi is offline  
Old October 19, 2002, 08:17   #123
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Gret stuff mapfi. I had some steps backs in my mod since my AI strategies.txt was somehow causing more often crashs.

But i am really anxious to see this new code

The Read me looks cool too
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 19, 2002, 09:04   #124
child of Thor
Call to Power II Democracy GameCTP2 Source Code Project
Emperor
 
child of Thor's Avatar
 
Local Time: 05:33
Local Date: November 1, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
Mapfi + Pedrunn,
Wow! nice stuff guys! I'm not here as often at the momment - but this kinda thing is great to bump into!
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)? If not then never mind - just what popped into my head on reading it. Religion is going to be big i think
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

Bush's Republican=Neo-con for all intent and purpose. be afraid.
child of Thor is offline  
Old October 19, 2002, 09:11   #125
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)?
Sure thing. We can make a button in the religion message that opens a new message so that you could edit how often you want the message. Nice suggestion

We are very glad you liked it. After all it was a 2 month work
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 19, 2002, 11:48   #126
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 07:33
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by Pedrunn
Gret stuff mapfi. I had some steps backs in my mod since my AI strategies.txt was somehow causing more often crashs.
strategies causing crashs that is something new to me, at least as long as you don't remove parts of the STRATEGY_DEFAULT.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old October 19, 2002, 13:31   #127
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
Originally posted by child of Thor
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)?
Anything you wish, I'll try. There is a slight problem with the hardcoded size of the alertbox so I can't combine the button with the religion info message. So it's either going to be a pop up every 50 turns or so where you'll select, or a button included in the alertboxes for reformation and conversion or whenever you produce a cleric (and then not anymore for the next 50 turns if another cleric is produced). What do you think?
mapfi is offline  
Old October 19, 2002, 13:34   #128
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Or wait, I can have buttons in regular message boxes too, can't I?
mapfi is offline  
Old October 19, 2002, 13:46   #129
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
I can have buttons in regular message boxes too, can't I?
sure can. Both message types (alert and message boxes) have buttons.
I was thinking i was going to add this but I guess you will give it a try

Quote:
strategies causing crashs that is something new to me, at least as long as you don't remove parts of the STRATEGY_DEFAULT.
I have three reasons wich i am suspecting that is causing the crashs.
My slic changes strategies (maybe this but i havnet done nothing different from the existing handlers);
Some goal elements i deleted and added;
or the changes in the defense strategies (less likely to be the cause).

I will try to find some time to figure this out.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; October 19, 2002 at 13:51.
Pedrunn is offline  
Old October 20, 2002, 10:19   #130
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 07:33
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by Pedrunn
My slic changes strategies (maybe this but i havnet done nothing different from the existing handlers);
This shouldn't be a problem, the new strategies will only overwrite some parts of the old ones.

Quote:
Originally posted by Pedrunn
Some goal elements i deleted and added;
My own problem was also related with deleting and adding actual with outcommenting and reoutcommenting. But that wasn't the goal elements and actual I see no reason why if you delete all goal elements the game should crash, the AI just wouldn't have any goals for its units and the units would just siting in its cities. My problem was that I outcommented in the STRATEGY_DEFAULT some of the force matching blocks, so I hit end turn and has the game was supposed to return to the human's turn it crashed.

Quote:
Originally posted by Pedrunn
or the changes in the defense strategies (less likely to be the cause).
I think there isn't the problem, either. As far as I understood it the defence strategies overwrite the default strategy so if they are empty they won't overwrite anything.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old October 20, 2002, 14:55   #131
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Readme continued
as requested you can now choose to have the religion info msg pop up every 5,10,20 turns and you can also change to have it only appear in the msg tab and not on the screen

success rates
priest, success 0.4, death 0.5
cleric, success 0.8, death 0.25

sell indulgences
you'll get the nr of pop in the city times 1/2/1/.5, depending if the city owner has researched default/theology/age of reason/mass media
if the city's religion is your state religion you'll get twice that amount

tenth
if a city of yours has got a different religion than your state religion it'll pay a tenth to all other players who have that religion as state religion
the paid amount is equal to the nr of pop of the city times 3/5/3/1, depending if the city owner has researched default/theology/age of reason/mass media if there's only one other player with that state religion, for each additional player the city will pay an additional half of this amount, the so paid amount is equally divided between the other players.

reformation
NewReformCost = percentage of world pop converted to the religion of the city times number of players times city pop times 5 divided by the number of units in the city

changing your state religion
when another player converts one of your cities you'll get a message to convert to that player's religion if more than 10 percent of your pop have converted to it already
when you're state religion is not your original one anymore and you try to reform one of your cities with another player's religion you'll get an option to resurrect your original religion

happiness bonus/malus
the so called happymod of a city is on a scale of 0 to 100, it is calculated in the following way:
As default the value of (percentage of world pop converted to the city's religion times number of players) is 100.
If this value is above 100 then the happymod is equal to (this value minus 100) divided by (the number of players minus 1)
if this value is below 100 than the happymod is 100 minus this value.
So the default value of the happymod is 0, and converting the whole world is equally grave as having no city converted to one's state religion
if HappyMod < 12.5 0 happiness
HappyMod < 27.5 +/- 1 happiness
HappyMod < 42.5 +/- 2 happiness
HappyMod < 57.5 +/- 3 happiness
HappyMod < 72.5 +/- 4 happiness
HappyMod < 87.5 +/- 5 happiness
HappyMod >= 87.5 +/- 6 happiness

reforming a city give's it -2 happiness for one turn
denying the request for a change of the state religion also give's the city -2 happiness for one turn
mapfi is offline  
Old October 21, 2002, 10:10   #132
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Just got it.
I will look deep at it today.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 21, 2002, 10:41   #133
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Have fun. I PMed Peter today because I had a few ideas why the LogRegardEvent might not want to work. So maybe we can solve that one easily enough.
You'll notice that I got completely rid of those loop preventers and set all handlers to convertcityunit. It works fine. It's just vital that whenever the code calls convertcity the change is actually stored in the array first.
The assimilation and changing messages work as well, though I had an AI change right back after I had him changed to my religion - I tried to adjust the values, so I shouldn't happen too often. (It can always change it's mind just after one turn, can't it...)
If you start testing keep in mind that 10% of your pop have to be converted before you're prompted about changing your state religion - fell over this one myself when playtesting but I want to keep it in - otherwise we'll have even more messageboxes appearing.
mapfi is offline  
Old October 21, 2002, 11:48   #134
child of Thor
Call to Power II Democracy GameCTP2 Source Code Project
Emperor
 
child of Thor's Avatar
 
Local Time: 05:33
Local Date: November 1, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
Quote:
Originally posted by mapfi
Anything you wish, I'll try. There is a slight problem with the hardcoded size of the alertbox so I can't combine the button with the religion info message. So it's either going to be a pop up every 50 turns or so where you'll select, or a button included in the alertboxes for reformation and conversion or whenever you produce a cleric (and then not anymore for the next 50 turns if another cleric is produced). What do you think?
It's a difficult one to call without really seeing it in action. I guess from the initial readme i was replying about,i was just worried about how intrusive every set 5 turns might be? So any option that gives the player some control over that would be nice? I've no idea what would be the best way to impliment it - but i think between yourself,Pedrunn and Martin you know what you can do
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.

Bush's Republican=Neo-con for all intent and purpose. be afraid.
child of Thor is offline  
Old October 22, 2002, 06:34   #135
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I did not have time to look as deep as i wanted but i see your changes are concetrated in the 'ConvertorTakesTheMoneyPerTurn'
handler wich i cant barely recognize .
and i see a lot of new global variable wich i will love to dicover what they do.

I also noticed that you havent changed the reformation setting essency soi take my settings did work oppose what you have said in another thread.

And just hit me that we need to have a note in the read me not to have the slic reloaded in the game.

Have to go now.
Will look it at night (I hope)!
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 22, 2002, 07:04   #136
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
Originally posted by Pedrunn
'ConvertorTakesTheMoneyPerTurn'
handler which i cant barely recognize .
yeah, eg. that the paying a tenth is all calculated on the barbarians turn, and the new happymod and the change of the message system
Quote:
and i see a lot of new global variable wich i will love to dicover what they do.
most of them are related to the messages (if not all, don't have the code here now)
Quote:
I also noticed that you havent changed the reformation setting essency soi take my settings did work oppose what you have said in another thread.
Did I? They work fine.
Quote:
And just hit me that we need to have a note in the read me not to have the slic reloaded in the game.
Oh yes, that wouldn't be a good idea. I think it would just change the religion of all cities back to their owner, so at least it wouldn't crash... you could try once
mapfi is offline  
Old October 23, 2002, 04:46   #137
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
So, Pedrunn you're busy studying? Well, yesterday was my first day back at uni, so I'll have to see how much time to spend on Ctp2 will be left.
Anyway, I had a little idea last night after this diplo stuff finally works now. The moment you change your state religion should have a greater diplo effect. Think of an AI converting your cities. For the AI to do that it's likely he doesn't like you much, so converting to him should reset trust and regard or give bonus. Same with recreating your own religion - that should hurt diplomatically. Just more than the little -2,+5 that we have every turn.
mapfi is offline  
Old October 23, 2002, 17:59   #138
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
So, Pedrunn you're busy studying? Well, yesterday was my first day back at uni, so I'll have to see how much time to spend on Ctp2 will be left.
My university takes my whole day (morning and afternoon).
But yesterday at night i was having a couple of beers with some friends (i know it is a week day )
So i did not check the code but yes i usually am studying hard to assimilate all i can

Quote:
Anyway, I had a little idea last night after this diplo stuff finally works now. The moment you change your state religion should have a greater diplo effect. Think of an AI converting your cities. For the AI to do that it's likely he doesn't like you much, so converting to him should reset trust and regard or give bonus. Same with recreating your own religion - that should hurt diplomatically. Just more than the little -2,+5 that we have every turn.
That would be a terrific idea. Re-set trust looks understandble and a big first regard bonus for the change looks nice (What are thinking? +50?). Did the Peter Triggs fix worked?

Nice to see you are carrying on this project . I am obviusvly having my time too much divided. Maybe i should post less and mod more because I really want to realease my mod BETA

PS: I just hope your university doest take as much time as mine takes from me. It almost makes me regret trying to do medicine. Almost...
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; October 24, 2002 at 06:58.
Pedrunn is offline  
Old October 24, 2002, 06:46   #139
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
Did the Peter Triggs fix worked?
So you really don't have any time to read the threads anymore, do you? Yes, the problem was that we went up to player number 33, but actually theoretically only up to 31 is possible and only up to 29 works without faults in the game. Slic should be made for 31 though (and it works fine) in case somebody finds a fix sometime. IsPlayerAlive returns true for any number bigger than 31 - that's what screwed us up...
Quote:
I just hope your university doest take as much time as mine takes from me. It almost makes me regret trying to do medicine. Almost...
Math here - while I still have some time till things really get going (so about another week...) I'll post as much as I can.
mapfi is offline  
Old October 24, 2002, 18:28   #140
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
So you really don't have any time to read the threads anymore, do you?
It is hard to keep up. Specially in early week. Mondays, tuesday and wednesdy are killers for me.

About the code:

The code seems to be ok in-game. Although i want to actually play it.
But I have a few comments on what you did diferent in the code layout. The fuctionality seems ok! Couldnt find any bugs

Why the religionLevel in-code is from 0-10000 and in the message is from 0-100.
Dont actually see how this makes a difference.

The Happy mod part is so confusing! I know it works but is just crazy for me. i hope you dont mind if i change it when setting to my mod. I like things easier to edit.

The infocycle[] doenst need to be a array. It could be an simole variable.

PlayerNum, infocycle[], SentChanges[], Receiver, allcities[]. Are of too common use. They dont look global variable. May cause some imcompatibilities with other codes if used together. We could use a REL_ prefix in them.

As you see just minor stuff that we shouldnt even bother too much. So you did a terrific v9 of the code. I am proud of our work
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 24, 2002, 18:42   #141
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
New stuff
Quote:
Originally posted by Ogie mapfi
But we decided against this because for one there's a problem with getting the strings in the messages then
Actually while working in the PBEM fix. I have seen Locutus using a function called SetString(int_t, stringID) thats does exacly that. So it is possible after all. But i have no idea how that function works.

Decrease the Cross size. Dont you think that cross in the top of the city is too big and makes the units head impossible to see? I will make a small pic for it in this weekend. What do you think?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old October 25, 2002, 07:19   #142
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
Originally posted by Pedrunn Decrease the Cross size.
A very good idea!
Quote:
Why the religionLevel in-code is from 0-10000 and in the message is from 0-100.
well 0-100 makes sense because of it being a percentage - but rounding will screw it up if you play with large number of players, that's why i blow it up for calculation
Quote:
The Happy mod part is so confusing!
I know I'm a math-nerd, but it's really simple though. Just write the formulas down and insert a few different levels and you easily see what it's doing and how it's working - all straight forward...
Quote:
The infocycle[] doenst need to be a array. It could be an simole variable
yes, I just didn't want to set up three variables for it. I don't think the game needs more ram if I define the size of the array, maybe even less because it's only one name.
Quote:
PlayerNum, infocycle[], SentChanges[], Receiver, allcities[]. Are of too common use
Good point - a prefix is a good idea.
mapfi is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:33.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team