Announcement

Collapse
No announcement yet.

Clerics, Corporate branch and so on...

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

  • #61
    And you dont have any clue about a fix?
    It's hard to spot one's own mistakes, you know - no not a clue...
    Cities(int_t)
    that function always crashed my game!
    PS: The CreateUnit event does work.
    I read that on the forums too and was already thinking and a doing a little bit writing on it but nothing set yet.
    We should have done this before to the storage of the city safer anyway.
    Yet is even more important to do it whenever we call a city out of allCities because when the city ceases to exist it'll still be in the array - as 'noname' which can't be assigned to a city variable
    Tomorrow we talk about a improvements
    Let's hope we've got a lot of them...

    Comment


    • #62
      What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.

      Comment


      • #63
        so you think we'll have to throw it out after that... ok. thanks for the advice

        Comment


        • #64
          Originally posted by Dale
          What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.
          Yeah these dynamic arrays are a problem they grew automatically. Do you know how I can reduce the size of such an array afterwards, Dale?

          -Martin
          Civ2 military advisor: "No complaints, Sir!"

          Comment


          • #65
            What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.
            so you think we'll have to throw it out after that... ok. thanks for the advice.
            Yeah these dynamic arrays are a problem they grew automatically. Do you know Dale I can reduce the size of such an array afterwards, Dale?

            Cant we just do this:
            Code:
            int_f CheckforCity(city_t tmpCity) {	//returns place of city in array, or next free place
            int_t i;
            int_t num;
            city_t thecity;
            	thecity = tmpCity;
            	for (i = 0; i < allCities.#; i = i + 1) {
            		if (CityIsValid(allCities[i])) {
            			if (thecity == allCities[i]) {
            				return i;
            			}
            		}
            		else{
            			return i;
            		}
            	}		
            	return allCities.#;
            }
            
            void_f StoreCity(city_t tmpCity, int_t tmpreligion) {	//stores city in allCities array
            int_t i;
            city_t thecity;
            int_t thereligion;
            	thecity = tmpCity;
            	thereligion = tmpreligion;
            	i = CheckforCity(thecity);
            	allCities[i] = thecity;
            	CityReligion[i] = thereligion;
            }
            "Kill a man and you are a murder.
            Kill thousands and you are a conquer.
            Kill all and you are a God!"
            -Jean Rostand

            Comment


            • #66
              I think you're right Pedrunn - that should fill the empty places of the array

              Comment


              • #67


                I was looking over the file again and just hit me. After fixing the ReligionLevel (that actually is expendable), change KillPlayer by CaptureCity (five minutes task) and the LogRegardEvent (another five minutes task) what do we have to do now??? We are pretty much done with this code!!!
                Just test and send to the database. Funny how the making of this code went smoothly. Normaly when I am at the middle of a code i usually became too anxious to see it done. I guess this is because we still have a feeling that something is missing after all religion is a really big thing in real life.

                After packing the city expansion I will try to fix these missing stuff.
                "Kill a man and you are a murder.
                Kill thousands and you are a conquer.
                Kill all and you are a God!"
                -Jean Rostand

                Comment


                • #68
                  it's going smoth yes, just a few things that come to my mind, though:

                  - settler religion
                  - didn't we want to allow cleric for every government like i did it in the last version and then create a new unit for theocracy that'd do the conversion cheaper or with higher success
                  - the calculations in the code for the ai, goals and strategies for ai
                  - balancing and playtesting
                  - just a thing i'd like to change about the setting: when a city gets converted I'd like to send the message "do you want to convert all cities" only if the religion level in the civ is high enough - some probability calculation there
                  - the happiness adjusters in the begin turn handler for now only depend on the religion level - we have to somehow include the actual player number as a divisor to make that reasonable.

                  Comment


                  • #69
                    Originally posted by mapfi
                    - settler religion
                    oh yeah i will try to write this right before the finish of the CityX packing.
                    Originally posted by mapfi
                    - didn't we want to allow cleric for every government like i did it in the last version and then create a new unit for theocracy that'd do the conversion cheaper or with higher success
                    Thats not really a problem. another 5 minutes task. I will really do this right before testing phase. The CTP1 cleric for non-theocratic player and the CTP2 cleric for the ones under theocracy.
                    Originally posted by mapfi
                    - the calculations in the code for the ai, goals and strategies for ai
                    True. this may take a little while.
                    Originally posted by mapfi
                    - balancing and playtesting.
                    For sure
                    Originally posted by mapfi
                    - just a thing i'd like to change about the setting: when a city gets converted I'd like to send the message "do you want to convert all cities" only if the religion level in the civ is high enough - some probability calculation there
                    Actually i really thought the best was too remove it. It is too exagerate. I think if someone convert to a new religion he should
                    reform all of its cities one by one. Yet we can make some cities with low religion level convert by itself.

                    Originally posted by mapfi
                    - the happiness adjusters in the begin turn handler for now only depend on the religion level
                    - we have to somehow include the actual player number as a divisor to make that reasonable.
                    Can you explain better? I dont get what you mean

                    Another feature: Reform gold cost depends on the population and religion level of the city.
                    "Kill a man and you are a murder.
                    Kill thousands and you are a conquer.
                    Kill all and you are a God!"
                    -Jean Rostand

                    Comment


                    • #70
                      Reform gold cost depends on the population and religion level of the city
                      Good idea! But we'll either have to do it with a payback on the 1000 gold subtracted or otherwise you'll be able to reform for free when you're treasury is low. Or we'll have to check the players treasury and deny him the action with another message.
                      I think if someone convert to a new religion he should reform all of its cities one by one.
                      That wasn't what I meant - I thought the player wouldn't get to choose to convert his state religion when only the first or second of his 30 cities is being converted.
                      This just made me realize we have to check the code for what it does to the following situations:
                      Player 1 has got City A, 2 - B, and 3 - C:
                      C is being converted to 2, player 2 converts his state to 1, what happens with C? Where does the money go? And same thing now, when 2 reforms his city B to the ancient religion but his state religion stays 1...
                      And how can you ever change your state religion back to your ancient one? That's not in the code yet - we could have a message appear when the religion level gets high enough again because enough cities have been reformed to their ancient religion.

                      The other thing you said you didn't understand: What I meant is, assume you've got three players in the game -> normally you'll have a religion level of 33% if you're doing fine; with 10 players in the game, you'll be stuck around 10% because there are more religions on the world. SO the happiness adjusters have to take that into account.

                      Comment


                      • #71
                        Originally posted by mapfi

                        Good idea! But we'll either have to do it with a payback on the 1000 gold subtracted or otherwise you'll be able to reform for free when you're treasury is low. Or we'll have to check the players treasury and deny him the action with another message.
                        We can check the gold and make it return STOP when there isnt enough money.
                        Originally posted by mapfi
                        That wasn't what I meant - I thought the player wouldn't get to choose to convert his state religion when only the first or second of his 30 cities is being converted.
                        This just made me realize we have to check the code for what it does to the following situations:
                        Player 1 has got City A, 2 - B, and 3 - C:
                        C is being converted to 2, player 2 converts his state to 1, what happens with C? Where does the money go? And same thing now, when 2 reforms his city B to the ancient religion but his state religion stays 1...
                        The gold goes to all players that have this religion. if all players have it none get. If anyone has none get too. The player that started with the religion has mo bonus when it comes to the gain of gold.
                        Originally posted by mapfi
                        And how can you ever change your state religion back to your ancient one? That's not in the code yet - we could have a message appear when the religion level gets high enough again because enough cities have been reformed to their ancient religion.
                        Yes it is. You can change the state back by reforming a city. In my last code a message will appear asking if you want to convert to the current religion, or the ancient religion (and the city) or to cancel the order.
                        Originally posted by mapfi
                        The other thing you said you didn't understand: What I meant is, assume you've got three players in the game -> normally you'll have a religion level of 33% if you're doing fine; with 10 players in the game, you'll be stuck around 10% because there are more religions on the world. SO the happiness adjusters have to take that into account.
                        I did not think of that. So we will divide the religion by the number of player. Yet i want to make the religionLevel partial. The addition all religionLevel should equal 100. this will make the player have an idea on how good their religion are compared to the others religion.
                        But i was really thinking on taking off the national conversion piece of code. 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

                        Comment


                        • #72
                          Why do you want to take out the national conversion?
                          Because it's so severe? That's why I thought we shouldn't let the player choose to change his state religion at every conversion/reformation happening but only at certain levels and also maybe not let every forced conversion like this be a success.

                          You can leave the religion levels like that and just adjust the happiness code with trigger levels at religionlevel >= x * 100/player number. By the way - I think we shouldn't go over +5 happiness and even that might be too much.

                          Comment


                          • #73
                            The City Expansion is already in Locutus hands so i may be focused in this code from now on.
                            Report:
                            1) I started doing some changes. The ReligionLevel is working now. I tested the worldpo and converted pop coding and they both work. So i discovered the problem was in the equation. Bingo! It seems the slic first divides/multiplies the variables and them the the actual numbers. Since the ConvertedPop/WorldPop is always a non-integer and lower than 1 it always reurned 0. So we just need to write this equation instead of the other one:
                            Code:
                            Level = (ConvertedPop*100)/WorldPop;
                            2) The settlers with religion coding is tougher then i thought it would be. since both CreateUnit and CreateCity does not have a unit_t buitin variable. So i may have to do (if possible) some big work around.

                            3) You were right about the religion names in the messages. We cant make just player[something] that it will work. This will ony work if we use a built in variable from the event. Eg. If you use/change the value of player[0] in the BeginTurn event it will work since this event has a int_t variable.

                            4) Have you seen ReformCityUnit piece of coding work? I have tested and i did not get any message. But happily i have seen the msg working with UnconvertCity(city_t). I will make the reform cost gold code soon (cost = 200 + citypop*ReligionLevel*3; Thats ok for you?).

                            5) I will add the alive players count in the happines modifier. 5 and 6 is probably too much. I guess the maximum is best to be 4.

                            Why do you want to take out the national conversion?
                            Because it's so severe? That's why I thought we shouldn't let the player choose to change his state religion at every conversion/reformation happening but only at certain levels and also maybe not let every forced conversion like this be a success.
                            I think we should remove the national conversion. Or make a message pop up for every city in the empire that has a military unit asking if you want the unit to convert the city. Ala Unit Updater code.
                            As for the Conversion / Reforming city we could make a random calculation depending on the religion Levels of both new and to convert religion. sucees, convert city. failed, sorry but the people of this city did not accept the true faith .
                            Of course the Coversion chance from unit.txt will be unused.
                            "Kill a man and you are a murder.
                            Kill thousands and you are a conquer.
                            Kill all and you are a God!"
                            -Jean Rostand

                            Comment


                            • #74
                              Have you seen ReformCityUnit piece of coding work?
                              It worked when I tested it - there was no problem with it. You're sure you had enough money?
                              I think we should remove the national conversion. Or make a message pop up for every city in the empire that has a military unit asking if you want the unit to convert the city. Ala Unit Updater code.
                              I don't understand why you don't like it but the possibility you propose seems reasonable too.

                              If we put some chance of failure into the reform event it certainly has to get cheaper - it might be too expensive as it is, but then... no actually now it's balanced, it fits the investing cost and the rather low return.

                              It seems the slic first divides/multiplies the variables and them the the actual numbers. Since the ConvertedPop/WorldPop is always a non-integer and lower than 1 it always reurned 0.
                              You're saying A*2/B is calculated as (A/B)*2. I wonder if somebody noticed that before or if they all were just lucky not to stumble over it or always used brackets to be sure or just disbanded a piece of work in despair?

                              Comment


                              • #75
                                New Version:

                                1) City Religion Level Fixed.

                                2) Only who is alive has a religion. Not all 32 players that may or may not be in the game

                                3) There is a check every turn for new players from revolted cities and gives them the religion of the city who first revolted.

                                4) Happines modifier depends on a multiplier = number of religions in the game

                                5) The AI check all of its cities. if the city has a different religion from yours he tries to reform it.

                                6) Reformation cost the gold according to the equation ReligionLevel*CityPop*5. Effects were added and choices were polished depending on the relation between the city owner religion and the city religion.
                                The AI only reforms of has four times the gold to reform and if its religion level is bigger than 1/3 of the city religion level.

                                7) Settler settle cities with same religion as the city wich they were built.

                                What do you think, mapfi?

                                PS: Dont try to play with DebbugSlic = Yes.
                                It reports bugs that dont interfer in the code.
                                "Kill a man and you are a murder.
                                Kill thousands and you are a conquer.
                                Kill all and you are a God!"
                                -Jean Rostand

                                Comment

                                Working...
                                X