[MODCOMP] Decaying Resource Mod

TheLopez

Deity
Joined
Jan 16, 2006
Messages
2,525
Location
Oregon
Decaying Resources Mod v0.2BtS
By: TheLopez

Last Update: 09/08/10

Version: v0.2BtS
Patch Compatibility: Beyond the Sword v3.19
MP Compatible: ?
Download Mod v0.2BtS

Description:
This mod adds three new tags allowing the specification of how many units (in
turns) of a particular bonus are available, how fast bonuses are consumed and
how fast bonuses are replenished. I have added the new tags to all of the
standard bonuses included in the game. The new tags are not required for
bonuses but if you want to add the decay feature you will need to add them to
any new bonuses.

So for example in the pig bonus definition the tags are:
Code:
      <fDecayRate>1</fDecayRate>
      <fBonusLifeAmount>100</fBonusLifeAmount>
      <fReplenishAmount>0.5</fReplenishAmount>
Meaning that one pig resource is consumed per turn, there are 100 turns of pig
available and the pig resource is replenished at .5 each turn when the plot
isn't worked by the city or if the plot doesn't contain a pasture but is
worked by the city.Buildings also add to the consumption of resources.

As a balance point the random discovery of resources is bumped up a little bit
depending on the number of resources that have been exhausted.

Installation Instructions:

1) Unzip this into the "bts_install_folder\Mods\" folder.
2) Open the CivilizationIV.ini configuration file
3) Change the Mod line to read: Mod = Mods\Decaying Resources Mod
4) Load the game.
5) Then play as normal.

-----Notes to Modmakers-----

If you want to use this mod component in your mod I have tried to make things
as easy as possible for you. In the XML files I have added
<!-- Decaying Resources Mod Start --> and
<!-- Decaying Resources Mod End --> in all of the places where changes
were made. In the SDK files I have added
// < Decaying Resources Mod Start > and
// < Decaying Resources Mod End > in all of the places where changes
were made.

Please look at the current values set in the CIV4BonusInfos.xml file to make
sure they align with what you are wishing.

-----Version Information-----

-----v0.2BtS------

- Fixed a bug where a resource was used before it was even available. Thanks
for reporting the issue TheLadiesOgre

- Fixed a bug where resource consumption rate was being shown on screen even
though that resource was inexhustable.

Spoiler :

-----v0.1BtS------

- Setup the Decaying Resources Mod infrastructure

- Added the new <fDecayRate> tag that allows the specification of how fast a
bonus should decay

- Added the new <fBonusLifeAmount> tag that allows the specification of how
many turns a resource is available.

- Added the new <fReplenishAmount> tag that allows the specification of how
fast a bonus should be replenished.


-----===Credits & Thanks===-----

- Exavier - Composite Mod - readme.txt format

- Dom Pedro II - For the idea for this mod
 
Downloaded, going to try it out immediately...

Please check out the Civ4BonusInfos.XML file to see what the "Expiration" rates are :) :eek:

Most farm food based bonuses don't decay for obvious reasons.
 
On ~turn 161, I got a notification saying "Aluminum will be exhausted in 30.00 turns", when I was still in the Classical Age, there was a mine on the tile where the Aluminum was alleged to be. Attached below you will find a Save Game file.

EDIT: while I didn't look at them all, I did notice that several of the Resources are fairly abundant and some are kinda in short supply, I really like this, I think it has tons of potential in combination with other Resource-centric ModComps
 

Attachments

  • TLO BC-1890.CivBeyondSwordSave
    218.3 KB · Views: 122
On ~turn 161, I got a notification saying "Aluminum will be exhausted in 30.00 turns", when I was still in the Classical Age, there was a mine on the tile where the Aluminum was alleged to be. Attached below you will find a Save Game file.

EDIT: while I didn't look at them all, I did notice that several of the Resources are fairly abundant and some are kinda in short supply, I really like this, I think it has tons of potential in combination with other Resource-centric ModComps
Huh, odd. Let me go get a cup of coffee and I'll take a look at it. (I just got to work)

EDIT: Ah, I think I see the problem... I'll try to get another version out in a few hours.
 
Alright, TLO, I have release v0.2 that fixes that problem you were seeing. But after play testing with your save file I realized that the warning messages happen every turn after less than 11% of the resource is left... I don't know if that is good yet or not. It might be annoying to have a message for a bunch of resources that are about to be exhausted.
 
thanks for the new release,

i think a message on resource disappearing is enough.. nobody likes annoying messages...:)

thanks!

True... I might add some configuration options plus reference python code to set the different SDK options in the next version if there is enough interest in this mod.
 
ok thanks.

but if theres some way to remove that message at all it could be nice, maybe theres some section i can remove in sdk?

Sure, go into the CvPlot.cpp file and in the doTurn method remove lines 427-431... this includes the check for the near exhaustion of resources and the reporting of the near exhaustion.
 
I like it, update works great though I have to agree that the message about resource exhaustion is a little annoying. I think that there should be a single notification and that it should be more cryptic and less concrete (more of a "you know, past couple of years the mine's been producing less copper, you don't think-- Hey, where'd the copper go?"). I think that would be better than the countdown.
 
I like it, update works great though I have to agree that the message about resource exhaustion is a little annoying. I think that there should be a single notification and that it should be more cryptic and less concrete (more of a "you know, past couple of years the mine's been producing less copper, you don't think-- Hey, where'd the copper go?"). I think that would be better than the countdown.

True... I'll mull over a solution while looking into another mod comp... in the mean time you are more than welcome to peer into the source and make the changes yourself... it is pretty straight forward. :D
 
Afforess have this modcomp in his A New Dawn modpack before you made this.

#1 How different?

#2 If similar, should you be crediting Afforess? :)
 
Afforess have this modcomp in his A New Dawn modpack before you made this.

#1 How different?

#2 If similar, should you be crediting Afforess? :)

Before I disappeared many months ago I started working on this mod for warlords but never released it. Afforess suggested I look at his mod and rip out and release the system if I wanted to but I didn't so I suspect they are quite different.

Should I credit him for this mod? No. Should I credit him for advancing Civ4 modding yes absolutely yes

EDIT: Oh and if you go to my component library thread and go down to post three you'll see that the edit date is in 2006 and the to do lists the dynamic resources mod.
 
#2 If similar, should you be crediting Afforess? :)

I wasn't the first person to make a decaying resource mod - there was a python based one too before mine. I believe it was made by Jackel...
 
I wasn't the first person to make a decaying resource mod - there was a python based one too before mine. I believe it was made by Jackel...

Huh, Jeckel made one? Wouldn't surprise me.
 
I'm looking at the sources for this and I got to thinking, do you think it would be possible to add a city stockpile of harvested resources?
 
I'm looking at the sources for this and I got to thinking, do you think it would be possible to add a city stockpile of harvested resources?

thats something ive been looking forward for 3 years,
i have brought it up to lopez, he said maybe he will get into, but this dude is very busy, as we can see..:)
 
Top Bottom