I want to help this mod

ABOUT DEMOGRAPHICS/GRAPHS ON SOURCE

After that talk we had in the Massive MP game about the Power Graph Vs Soldier Count on Demographics, I tried to search for something in the source files that could point me towards where this is calculated.

In CvPlayer.cpp I found functions that update the player's history on 6 aspects:
- :commerce: Economy
- :hammers: Industry
- :food: Agriculture
- :strength: Power
- :culture: Culture
- :espionage: Espionage

Going deeper into CvPlayer.cpp, I also found these:
Code:
int CvPlayer::getPower() const
{
    return std::max(0, ((m_iPower + m_iTechPower + m_iUnitPower) / 100));
}

int CvPlayer::getTechPower() const
{
    return std::max(0, (m_iTechPower/100));
}

int CvPlayer::getUnitPower() const
{
    return std::max(0, (m_iUnitPower/100));
}

I've been trying to find where this is exposed to the player in the Demographics and Graphs Screen, but I'm still clueless where this takes place. However, getPower AND getUnitPower appear in CyPlayerInterface1.cpp, and getPowerHistory appears in CyPlayerInterface2.cpp. Correct me if I'm wrong, but aren't the Cy files the ones that deal with the communication between the DLL and Python? If so, does this open the possibility of Python being the one handling these values?

The point I'm trying to discover is if the Values that are plotted in the Power Graph each turn are the same that appear in the Soldier Count on the Demographics Screen each turn.

---------------------------------------------------------------------------------------

So, I tried to venture into python and to my surprise it's everything there! :D

If I'm not doing some stupid mistake, my conclusion is that those two items are different. To draw the graph, CvInfoScreen.py uses the getPowerHistory, which in turn uses getPower to set the values inside the m_mapPowerHistory array (which is used to get the power value of each turn with getPowerHistory), and to set the Soldier Count in the Demographics Screen it uses getUnitPower.


Well, this post started as a question and now it became more like an explanation :lol:

Conclusion:
The Power Graph accounts each turn the total Power one has, which is composed of 3 factors: Population* Power
(m_iPower) + Technologies* Power (m_iTechPower) + Units* Power (m_iUnitPower), while the Soldier Count in the Demographics Screen only accounts Units Power (m_iUnitPower).

*Now I'm trying to check if there is anything else that changes those values through the change functions, because I feel there is more to this then it's shown in CvPlayer.cpp.
 
I've been trying to find where this is exposed to the player in the Demographics and Graphs Screen, but I'm still clueless where this takes place. However, getPower AND getUnitPower appear in CyPlayerInterface1.cpp, and getPowerHistory appears in CyPlayerInterface2.cpp. Correct me if I'm wrong, but aren't the Cy files the ones that deal with the communication between the DLL and Python? If so, does this open the possibility of Python being the one handling these values?

These *.cpp files are c++ source code.
They are here, so modders can mod DLL files.

Also nice find :D
Wonder if its possible to mess around with life expancy.
 
These *.cpp files are c++ source code.
They are here, so modders can mod DLL files.

Also nice find :D
Wonder if its possible to mess around with life expancy.

Yeah I know about c++ files, I was referring to Cy prefixed files, which seem to be where we expose c++ functions from the DLL to .py files so they can use these functions.

About Life Expectancy, yeah we can mess with that. By checking where I found this stuff in python, Life Expectancy is measured like this:

:health: / ( :health:+:yuck: ) * 100
Spoiler :
By :health: and :yuck: I mean the total value from all cities together

It is multiplied by 100 to become a 2 digit integer.
This is funny because this means a Life Expectancy of 100 is currently impossible, because there is no way to have 0 :yuck:. Also, it's truly impossible to achieve a Life Expectancy superior to 100, unless we have negative :yuck:

Maybe this aspect could use some changes, if the mod goes well beyond RL current time
 
Yeah I know about c++ files, I was referring to Cy prefixed files, which seem to be where we expose c++ functions from the DLL to .py files so they can use these functions.

About Life Expectancy, yeah we can mess with that. By checking where I found this stuff in python, Life Expectancy is measured like this:

:health: / ( :health:+:yuck: ) * 100
Spoiler :
By :health: and :yuck: I mean the total value from all cities together

It is multiplied by 100 to become a 2 digit integer.
This is funny because this means a Life Expectancy of 100 is currently impossible, because there is no way to have 0 :yuck:. Also, it's truly impossible to achieve a Life Expectancy superior to 100, unless we have negative :yuck:

Maybe this aspect could use some changes, if the mod goes well beyond RL current time
I guess, that equation should be changed:
Eras should give you base life expectnancy to simulate ever increasing quality of life.
Equal amount of health/unhealth would mean multiplier of 1.
Only health - base life expancy is doubled
Only unhealth - base life expancy is halved
 
@TB
FYI, I'll be leaving for a 2 week vacation soon so I won't have time to start working on any more buildings until I'm back
 
I'd like to adress 2 things in this post:

1st About Life Expectancy
As I said before, the Life Expectancy formula doesn't give good results. In the Massive MP Game, in 5000 BC I have a Life Expectancy of 73 years, while in the last playable years in this mod (which are far into the future) Life Expectancy won't surpass 99 years because the formula doesn't allow it. I'm adressing this because fixing it is really easy, we just need to come with a mathematical formula that makes more sense then the one that's used now (even someone who doesn't understand any programming language can come with that), and put it into python replacing the current formula. This brings more immersion, which is really important for a game to be more enjoyable.


2nd About Trade Routes
I'd like to start digging into the Trade Route calculation process to maybe come with a better solution for the mess it is. Firstly I'll try to make a test to show how this algorithm can slow down the game by comparing a late game environment: One with trade route calculation and the other without any. Then, if the difference is considerable, I'd like to start a brainstorming (I hope this word means the same thing in english, because we use it in english here in Brazil, without any translation) so whoever is interested can give ideas about how we can make this process faster and keep a good degree of immersion (unlike RAND's approach of Connectiveness, which IMO is worse in immersion and harder to manage for the player, although it killed the process strain on turn-passing time). Also if there's anything being done in this direction by any other modder here, I'd like to join forces in this quest.
 
I don't think anyone is working on trade routes at the moment, it would be great if you looked into it. If you see anything that you feel is ineffective, plain stupid, or seemingly incompletly thought through; bring it up for discussion and we'll hammer out better souloutions together. By "we" I mean you, the C2C team, and anyone else that can contribute.

Have you been given modding privilege on the SVN yet?
I'd be OK with you changing the life expectancy formula however you see fit.
 
Have you been given modding privilege on the SVN yet?
I'd be OK with you changing the life expectancy formula however you see fit.

I remember TBrd saying something about this, but I don't remember if modding privilege was given to me. About the formula, if someone has anything in mind like raxo2222 did a while ago, please post here so we can discuss (or open another thread if it seems needed). I'll take a look into it later today or tomorrow, so if everything goes well, tomorrow we may have a better formula for Life Expectancy already working in the latest SVN.
 
I don't think anyone is working on trade routes at the moment, it would be great if you looked into it. If you see anything that you feel is ineffective, plain stupid, or seemingly incompletly thought through; bring it up for discussion and we'll hammer out better souloutions together. By "we" I mean you, the C2C team, and anyone else that can contribute.

Have you been given modding privilege on the SVN yet?
I'd be OK with you changing the life expectancy formula however you see fit.
I am in complete agreement with everything you just said here.

I have some ideas coming together too for resource access locally vs across trade routes and national trade agreements that both simplify and deepen things so as to answer to some game balance problems but those thoughts are still percolating. It would certainly be something to work it the picture if we are spending some time re-evaluating some trade mechanism details.

I remember TBrd saying something about this, but I don't remember if modding privilege was given to me. About the formula, if someone has anything in mind like raxo2222 did a while ago, please post here so we can discuss (or open another thread if it seems needed). I'll take a look into it later today or tomorrow, so if everything goes well, tomorrow we may have a better formula for Life Expectancy already working in the latest SVN.
I think I did. Didn't you send me your sourceforge username for that purpose? PM it to me again and I'll confirm.
 
@TB
FYI, I'll be leaving for a 2 week vacation soon so I won't have time to start working on any more buildings until I'm back
Things have been going very slowly at points on this building costing project since I've lost a lot of time to mod and have been needing to spend more time on some other things so as to help find a better sense of emotional balance (I'm never giving up, just have needed a break here and there as this is one exhausting journey!) So I'm sure you'll be able to stay ahead of me... but even if you didn't, I could give you a different frontier to work on and I can always include your step in this documentation assembly line as I go if needbe. So no stress man. As I've always said, I just appreciate what help you provide when you can provide it. :D
 
I have some ideas coming together too for resource access locally vs across trade routes and national trade agreements that both simplify and deepen things so as to answer to some game balance problems but those thoughts are still percolating. It would certainly be something to work it the picture if we are spending some time re-evaluating some trade mechanism details.

May I open a thread for that? I wish we can think this more in reimagining then simply recalibration of the process. Right now we have a system that allocates the best Trade Routes to the best cities, making it an almost perfect algorithm for maxing the total output of Trade Routes. Not only this seems unreal for much of the timeline of the mod's gameplay, but also incurs in a deep nest of loops, which means a lot of time consumed just to evaluate the best trade routes possible.

I think I did. Didn't you send me your sourceforge username for that purpose? PM it to me again and I'll confirm.
I don't remember, but my svn username is spirictum with no capital letters at all
 
May I open a thread for that? I wish we can think this more in reimagining then simply recalibration of the process. Right now we have a system that allocates the best Trade Routes to the best cities, making it an almost perfect algorithm for maxing the total output of Trade Routes. Not only this seems unreal for much of the timeline of the mod's gameplay, but also incurs in a deep nest of loops, which means a lot of time consumed just to evaluate the best trade routes possible.
Go ahead. Let's expand this discussion then. I tend to agree with you on your assessment of optimal is costly and perhaps not even the best method. I've always wanted to give the player access to hard changing the route assignment as well, especially with the Outbreaks and Afflictions in play so they can strategically avoid infected cities.

I'll take a look at the sourceforge list later then. Thanks!
 
Are you sure they are their own rogues stationed in the city? If you can be sure in the way you're looking, like through WB or something, then yeah, the problem is those rogues don't have rogue AI types. Somehow rogues were allowed to qualify for filling another role entirely, possibly city defense. I've not seen an example of this taking place ever but I suppose it could and if it were not uncommon for some reason, then it could account for some other meltdown situations we've seen.

Yes, I used World Builder, as long as that is accurate, then the rogues in the city were friendly rogues, not enemy or barbarian. They all said they were owned by Arabia and the city was too.

Ah.. yeah that's definitely a sign of a severe problem in the AI somewhere.

So, I'd like to help with this mod. I've done C++ and other programming. I found a bug related to the AI and the criminal units, and I was wondering where to start. I found the "CvTeamAI" .cpp and .h files that seem to do with AI calculations, but I'm not sure how or when these files get compiled to be used by the game.
 
So, I'd like to help with this mod. I've done C++ and other programming. I found a bug related to the AI and the criminal units, and I was wondering where to start. I found the "CvTeamAI" .cpp and .h files that seem to do with AI calculations, but I'm not sure how or when these files get compiled to be used by the game.
The first thing to do would be to setup visual studio for compiling a DLL. It's getting to be so long ago that I did this that I can hardly guide anyone through the process.

However, Spirictum has gotten setup recently. Perhaps @Spirictum could help to guide you to that simple first step? (I'm not going to have a LOT of time to tutor but we can patiently work through some of the AI structure and I can show you where to look, at least, for the problem at hand.)

The source codes you're seeing, are those from the Caveman2Cosmos/Sources folder?
 
I'd like to help with the Mod. I've been playing C2C for years now and I've finally got some time on my hand to work on it. I've done both Python and C++ (though mainly Python) for my degree, but i could also help with more general stuff (XML, balancing tests, whatever is needed really except for graphics). Is there some kind of general TODO list or could someone maybe point me to a smallish thing that needs to be done to get some feel for this?
 
I'd like to help with the Mod. I've been playing C2C for years now and I've finally got some time on my hand to work on it. I've done both Python and C++ (though mainly Python) for my degree, but i could also help with more general stuff (XML, balancing tests, whatever is needed really except for graphics). Is there some kind of general TODO list or could someone maybe point me to a smallish thing that needs to be done to get some feel for this?
There are numerous problem spots. I'll let others bring up what they can see that might work for an introduction first. My focus is on harder areas but maybe DH has some mop up projects he could use your help with?
 
If the others do not have a specific thing to do for me, I'd like to start on some rebalancing for both pollutions, if that is ok with you all. Right now some values dont make sense to me (i.e. a bonfire giving the same as a factory) and id like to shift the focus of the earlier pollution a bit more towards water since historically notable river pollution came ages before notable air pollution effects. (Part of that would be also buffing the anti-water pollution buildings since we have actually become quite good at managing that by now). As a stretch goal maybe some positive effects for high negative values of pollutions?
 
If the others do not have a specific thing to do for me, I'd like to start on some rebalancing for both pollutions, if that is ok with you all. Right now some values dont make sense to me (i.e. a bonfire giving the same as a factory) and id like to shift the focus of the earlier pollution a bit more towards water since historically notable river pollution came ages before notable air pollution effects. (Part of that would be also buffing the anti-water pollution buildings since we have actually become quite good at managing that by now). As a stretch goal maybe some positive effects for high negative values of pollutions?

This is an area that is on my To Do list. But I've just not had the time lately (RL issues). Imhpo almost all the early buildings hat give pollution are over done especially the Prehistoric and Ancient era buildings. I've complained about the air pollution from Smokehouse for years and did iirc actually reduce it some what. But yes this is an area that needs attention. Even some of the early Wonders like Hanging Garden should have an anti-pollution value. And a bit more :) and :health: too. But I've not touched the Wonders because that was Dancing Hoskuld's area for a long time.

Guess we need other members to chime in on this too. But I would like to see what you come up with for this specific area of concern.
 
Sounds good! I think having to deal with only one type of pollution early makes it also a bit easier for newer players. And Water Pollution wasn't really an issue at all throughout the game, to be honest. I still think the per pop water pollution should be increased...
 
Back
Top Bottom