Single Player bugs and crashes - After the 13th of August 2013

If that is already happening but not being reported because it is a fraction that is being rounded away, I would be most grateful if the game would report that.
I can't say for sure, but I performed bombing with more then 100 ballista elephants and there was no change in the defense of a city I attacked, so it does not look like this. I'm afraid, that at least a part of the problem may involve the python code, so it can take more time fix.

@Thunderbrd, I have a feeling, that there may be two problems. One may be, the evaluation is done on integer numbers not on floating-point, so if a bombing strength would be for example 0.4, it will be in this case 0. The second thing is, I've noticed, that strength of bombings is downgraded by some factor. When I bombed one city with the defense something between 100-200%, ballista elephants was making some damage (1 or 2% if I remember correctly). When after few turns, I bombed a city with ~240%, they did nothing. But this is certainly not the matter of the protection against defense reduction, as siege rams performed still a damage.

The second can explain everything, if the factor is additive, not multiplicative, as the elephants may have bombing strength reduced to 0 then.

BTW, isn't it, that someone is too eager in implementing new formulas here?
 
[ Stonehenghe and In(something)suk ]

Yes you are not allowed to build both in the same city.

O.K. It seems that it is done in such a way that Stonehenghe "builds" Monuments (required for the second GW) in almost all cities and disables it in the city with Stonehenghe (it does not appear in the list of buildings), so it is a different mechanism than for some other wonders excluding each other.

S.
 
@Koshling, if you can tell, where to or how to find the code responsible for evaluating bombardment together with the parameters for it, I can look at it.
 
@TB

I tweaked castle bombarddefense from 20 to 0 and now my siege ram do 3% defense reduction each. So we should tweak castle and pus it to svn and also put variable max_bombard_defense and set it to 80% to avoid that kind of problems in future

CAstle is placed in towers hydro directory
 
@Koshling, if you can tell, where to or how to find the code responsible for evaluating bombardment together with the parameters for it, I can look at it.

It will be somewhere in CvUnit.cpp, but until I get back to my PC I cannot be more precise. As I recall, the effectiveness of bombardment even as a percentage, is reduced by greater bombardment defense, so the defense acts in a squared manner. Rounding can also be an issue - during the calculatons it multiplies up by a fairly large factor, to avoid integer truncation issues when dividing, and then divides back down b the same factor at the end of the calculation. However, the resulting defense that is left after a unit bombards is still an integer percentage (I.e. - the displayed number), so if the unit will reduce by less than 1% (or possibly 0.5%, I don't remember the exact rounding calculation) it will have no effect. We could (should?) replace this with some sort of stochastic mechanism, where the calculation becomes a probability of reduction, so that a result of one quarter (say) would be a 1 in 4 chance of reduction by 1.
 
Ow! Gooood morning Mr Visual. With what new problem will you amaze me today? Ow, you can't read a project file from Visual 2010? What delightful.

@Koshling, but seriously. There is something fishy about the project file. Shouldn't it be .vcxproj for VS2010?

edit
BTW, is there any place for a technical discussion on this forum?
 
And i have big BUG. latest svn

I wait 30 minutes but this turn is endless...
 

Attachments

@Nimek, I've checked the code. Yep, you are right, the bombarddefence parameter probably sums from all buildings into some big value. But it is not the case of the castle, but of all buildings with this bonus. Temporarily, you may try scale it down to lower the value, but maybe a better long time solution would be to make this bonus multiplicative.

I generated a minimum catch in that system that would hedge against this sort of problem but I'm not sure if or how the bombard mechanism is protected from an over 100% bombard defense.
@Thunderbrd, there is MAX_BOMBARD_DEFENSE field in Assets\XML\A_New_Dawn_GlobalDefines.xml .
 
@Hydro

Just going through this and found that you have Dene and Navajo Bonuses. They are the same tribe, just different names.

ie: The Navajo (Navajo: Diné or Naabeehó), pls use Navajo thx.

Actually they are diffrent ...

Navajo
http://en.wikipedia.org/wiki/Navajo_Nation
The Navajo Nation (Navajo: Naabeehó Bináhásdzo) is a semi-autonomous Native American-governed territory covering 27,425 square miles (71,000 km2), occupying portions of northeastern Arizona, southeastern Utah, and northwestern New Mexico. It is the largest land area assigned primarily to a Native American jurisdiction within the United States.

Dene
http://en.wikipedia.org/wiki/Dene
The Dene people (Dené) are an aboriginal group of First Nations who live in the northern boreal and Arctic regions of Canada. The Dené speak Northern Athabaskan languages. Dene is the common Athabaskan word for "people" (Sapir 1915, p. 558). The term "Dene" has two usages. More commonly, it is used narrowly to refer to the Athabaskan speakers of the Northwest Territories and Nunavut in Canada, especially including the Chipewyan (Denesuline), Tlicho (Dogrib), Yellowknives (T'atsaot'ine), Slavey (Deh Gah Got'ine or Deh Cho), and Sahtu (the Eastern group in Jeff Leer's classification; part of the Northwestern Canada group in Keren Rice's classification). But it is sometimes also used to refer to all Northern Athabaskan speakers, who are spread in a wide range all across Alaska and northern Canada. Note that Dene never includes the Pacific Coast Athabaskan or Southern Athabaskan speakers in the continental U.S., despite the fact that the term is used to denote the Athabaskan languages as a whole (the Na-Dene language family). The Southern Athabaskan speakers do, however, refer to themselves with similar words: Diné (Navajo) and Indé (Apache).

In short they speak the similar root language but are completely different groups.

Diné (Navajo) vs Dené

I know it can be confusing. Basically the Navajo are a Desert people and the Dene are an Arctic people. And from the root language similarity looks like the Navajo came from the Dene and migrated south to the American Southwest.
 
My bad:blush:, funny how 1 letter makes a difference that much, HUH?? Even with the same accent.

Diné vs Dené

Here we go ...

http://en.wikipedia.org/wiki/Navajo_people
The Navajo are speakers of a Na-Dené Southern Athabaskan languages known as Diné bizaad (lit. 'People's language'). The language comprises two geographic, mutually intelligible dialects. It is closely related to the Apache language as the Navajo and Apache are believed to have migrated from northwestern Canada and eastern Alaska, where the majority of Athabaskan speakers reside. It has been suggested[by whom? that speakers of various other Athabaskan languages located in Canada can still comprehend the Navajo language despite the geographic and linguistic derivation of the languages.

Archaeological and historical evidence suggests the Athabaskan ancestors of the Navajo and Apache entered the Southwest around 1400 CE. The Navajo oral tradition is said to retain references of this migration.

So around 1400 CE the Athabaskans split off and migrated south to the southwest and become the Navajo and Apache.

Thus they are now significantly different cultures. Such as the difference between the USA, Canada, South Africa and Australia. All speak "English" and have origins as being part of the British Empire but have since become their own cultures with their own accents/spellings.
 
Thankfully I have not had this problem with proper siege units yet, but I have noticed it with Siege Quins, Dromons and Ballista Elephants. I assumed it was 'working' (I use the term loosely): I have 4% attack, he has 5% defence, so no effect.

I am hoping you will change it so that some proportion of damage still gets done.

If that is already happening but not being reported because it is a fraction that is being rounded away, I would be most grateful if the game would report that. Failing that, please just tell me (truthfully lol) that that is what's happening, and I'll go away happy:D.
The maximum defense has been shown to be 100%. What now confuses me until I try to read the code further is how we are getting not all units that bombard having their bombard ability reduced to nothing, no matter how 'strong' their bombard ability actually is. It makes me wonder if there's some kind of 'counter' like a 'puncture' that works from the unit to reduce the defense itself when encountered. It would be helpful to identify what that unit 'ability' is tagged as.

hmm... I could take a look at the code but I'm working on some other things here and every time I've looked into bombarding to try to understand it I come up with the opinion that its terribly overcomplicated in its programming because I get lost somewhere along the calculation path. Then again... its been a while since I really looked into it.

I can't say for sure, but I performed bombing with more then 100 ballista elephants and there was no change in the defense of a city I attacked, so it does not look like this. I'm afraid, that at least a part of the problem may involve the python code, so it can take more time fix.

@Thunderbrd, I have a feeling, that there may be two problems. One may be, the evaluation is done on integer numbers not on floating-point, so if a bombing strength would be for example 0.4, it will be in this case 0. The second thing is, I've noticed, that strength of bombings is downgraded by some factor. When I bombed one city with the defense something between 100-200%, ballista elephants was making some damage (1 or 2% if I remember correctly). When after few turns, I bombed a city with ~240%, they did nothing. But this is certainly not the matter of the protection against defense reduction, as siege rams performed still a damage.

The second can explain everything, if the factor is additive, not multiplicative, as the elephants may have bombing strength reduced to 0 then.

BTW, isn't it, that someone is too eager in implementing new formulas here?
As stated above, perhaps its that the strength of bombings gets around defense differently by a less visible variable on particular units.

That person actually isn't me. This is an Afforess design issue where bombardment is concerned I believe. It's behaving with all the same nearly bug-like concerns I've had since I played AND and I just haven't really tried to sort it all out (though I have interacted with some of the codes in places I think...)

I had THOUGHT I'd read that Koshling had resolved all this but apparently I must've misunderstood what he was saying he'd done with bombardment defense a while back.

@TB

I tweaked castle bombarddefense from 20 to 0 and now my siege ram do 3% defense reduction each. So we should tweak castle and pus it to svn and also put variable max_bombard_defense and set it to 80% to avoid that kind of problems in future

CAstle is placed in towers hydro directory
I'd actually suggest to put it at 95% for now. HOWEVER, what I'd REALLY like to do is NOT change it all that much. Instead, I'd like to make it have a diminishing return mechanism applied to it. A while back, ls612 and I put a diminishing return (not sure if we completed this project) on withdrawal and I came up with an idea as to how we could generate this sort of thing on any value quite easily. I think the total Bombard Defense should apply to a diminishing return.

What this would mean is that after it exceeds 50%, the next points thereafter are half as valuable. So it takes a total of 100% to reach 75%. At that point, the value of additional points is 1/2 again (1/4) as valuable. Thus you reach something like 87(.5) with 150%. Then the next 50 pts are half again as valuable. Thus the next 50 pts gets you to 93.75 (reached at 200%) and it continues as such, never actually reaching 100% until fractions of a point over 99% make it impossible not to at an astronomically high actual % pt value.

We really shouldn't have to cap it at this point.

It will be somewhere in CvUnit.cpp, but until I get back to my PC I cannot be more precise. As I recall, the effectiveness of bombardment even as a percentage, is reduced by greater bombardment defense, so the defense acts in a squared manner. Rounding can also be an issue - during the calculatons it multiplies up by a fairly large factor, to avoid integer truncation issues when dividing, and then divides back down b the same factor at the end of the calculation. However, the resulting defense that is left after a unit bombards is still an integer percentage (I.e. - the displayed number), so if the unit will reduce by less than 1% (or possibly 0.5%, I don't remember the exact rounding calculation) it will have no effect. We could (should?) replace this with some sort of stochastic mechanism, where the calculation becomes a probability of reduction, so that a result of one quarter (say) would be a 1 in 4 chance of reduction by 1.
I thought that a fraction of an integer would ALWAYS round up in C++? Thus .1 = 1 if converted to INT? Is this inaccurate? Does it always round down instead?

@Nimek, I've checked the code. Yep, you are right, the bombarddefence parameter probably sums from all buildings into some big value. But it is not the case of the castle, but of all buildings with this bonus. Temporarily, you may try scale it down to lower the value, but maybe a better long time solution would be to make this bonus multiplicative.


@Thunderbrd, there is MAX_BOMBARD_DEFENSE field in Assets\XML\A_New_Dawn_GlobalDefines.xml .
(Please define multiplicative in this context. I'm not quite following you on that. Surprisingly enough, I'm not well educated on mathematical terminology but have been learning a lot here in that realm.)

Yeah, I looked at that field and kinda think its insane to have it set at 100% - I suggest 95% as a quick fix for now.
 
I suggest 95% as a quick fix for now.

LEts count. 20% base defense reduction rom siege ram :

20 - (20*0.95) = 1%

I think 1% is a very small number. Lets put it to 80% and than we will have 4% defense reduction from each siege ram.
 
Skiteiget leaderhead's icon is terribly oversized, which makes spiritual and financial traits leader list look awful and difficult to read (I am reporting it because I haven't played the mod for a few versions and that bug is still there).
 
Skiteiget leaderhead's icon is terribly oversized, which makes spiritual and financial traits leader list look awful and difficult to read (I am reporting it because I haven't played the mod for a few versions and that bug is still there).

Which civ is that?
 
What now confuses me until I try to read the code further is how we are getting not all units that bombard having their bombard ability reduced to nothing, no matter how 'strong' their bombard ability actually is. It makes me wonder if there's some kind of 'counter' like a 'puncture' that works from the unit to reduce the defense itself when encountered. It would be helpful to identify what that unit 'ability' is tagged as.
Do you mean, that for example my ballista elephant which had 5% bombing strength done no damage, but arsonist, which had to 5%, reduced the defense quite well? Or that, that those units with high bombing strength perform some damage or those with low do nothing?

I could take a look at the code but I'm working on some other things here and every time I've looked into bombarding to try to understand it I come up with the opinion that its terribly overcomplicated
Doesn't look so horrible, I've seen much worse. Maybe it was reorganized. :) However, the code responsible for reducing city defense is quite amazing.

As stated above, perhaps its that the strength of bombings gets around defense differently by a less visible variable on particular units.
No, I was wrong. I thought the the protection against defense reduction was the value below which you can't reduce the defense. Like you can't reduce it with bombing below 10% (btw is it some const, or it si given by some building)

I'd actually suggest to put it at 95% for now. HOWEVER, what I'd REALLY like to do is NOT change it all that much. Instead, I'd like to make it have a diminishing return mechanism applied to it. A while back, ls612 and I put a diminishing return (not sure if we completed this project) on withdrawal and I came up with an idea as to how we could generate this sort of thing on any value quite easily. I think the total Bombard Defense should apply to a diminishing return.

What this would mean is that after it exceeds 50%, the next points thereafter are half as valuable. So it takes a total of 100% to reach 75%. At that point, the value of additional points is 1/2 again (1/4) as valuable. Thus you reach something like 87(.5) with 150%. Then the next 50 pts are half again as valuable. Thus the next 50 pts gets you to 93.75 (reached at 200%) and it continues as such, never actually reaching 100% until fractions of a point over 99% make it impossible not to at an astronomically high actual % pt value.

(Please define multiplicative in this context. I'm not quite following you on that. Surprisingly enough, I'm not well educated on mathematical terminology but have been learning a lot here in that realm.)
This diminished return (strange name) is a little bit like multiplicative aggregation of a bonus. I think an example will be the best explain.

Lets have some buildings with the bombard defense bonus in a city (values are my imagination): walls (10%), high walls (20%) and castle (25%). Then we perform a bombardment with a siege ram (20% of bombardment strength). The attack hits the city and is firstly reduced by the castle (20 - 20*25% = 15), then what is left is reduced by the high walls (15 - 15*20% = 12) and then what is left is reduced by the walls (12 - 12*10% = 10.8). Now when we transform a little those evaluations we get the result to be 10.8 = 20(100%-25%)(100%-20%)(100%-10%).

This too can't reduce the bombing strength totally to 0, if only bombard defense bonuses are < 100%.

Still the problem is, what if the strength of bombardment is reduced to something like 0.9, which will be downgraded by the integer arithmetic to 0.

@Koshling, if you have few minutes, can you tell me, what is this?
Code:
void CvCity::changeDefenseModifier(int iChange)
{
	if (iChange != 0)
	{
		int iTotalDefense = getTotalDefense(false);

		if (iTotalDefense > 0)
		{
			changeDefenseDamage(-(GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange + (iChange > 0 ? iTotalDefense : -iTotalDefense)/2) / iTotalDefense);
		}
	}
}
This method is used by the bombardment. But I can not see, how can this work correctly. GC.getMAX_CITY_DEFENSE_DAMAGE() is set in the xml to 100, so for a siege ram and a city with defense 50%, we get changeDefenseDamage(40). :crazyeye:

And one important thing, how to compile this thing? C2C (VS 2010).sln points to C2C (VS 2008).vcxproj, that does not exists and after changing it to C2C (VS 2010).vcproj, the VS 2012 can't cope the project file. Is C2C (VS 2008).vcproj up to data? I can also try to move it to Qt, but don't know does it have some dependent code.
 
Back
Top Bottom