Single Player bugs and crashes - After the 29th of March

Status
Not open for further replies.
The number of exp you get from combat is based on the following values in XML for the unit that lost
Code:
			<iXPValueAttack>6</iXPValueAttack>
			<iXPValueDefense>3</iXPValueDefense>
and how that number relates to the value in
Code:
			<iCombat>100</iCombat>
I have always gone with iXPValueAttack about twice iCombat and iXPValueDefense at about the same as iCombat. I am not completely sure how this works but the number of exp you get from combat is related to your iCombat and their the other two values. With the minimum of 1. I notice that some of the new units have not changed the values in the first two tags. All three above are from one unit definition so you would only get 1 exp from that unit no matter how you beat it.

v29 - I am convinced that there is a bug in here; it's been happening for my whole game. I am only getting ~1 exp per battle, no matter what the combat odds say. This occurs regardless of what unit I use to attack, or what type of enemy unit I attack (barbarian, animal, or AI player). Dynamic exp is off, battlefield promotions is on, barbarian experience/generals is on.

In the attached example, my Mammoth Rider attacks a Bandit Rider (owned by Mongolian AI player). The Mammoth begins with 30.6 exp and combat odds says he will get +3 more. After the attack, however, he only has 31.6 exp, or a gain of +1.

I have never seen my units gain less than +1.0 exp. When they do gain more than +1.0, it's never more than about +1.5 and it's only when combat odds says they will get a TON (like 8+) when attacking.


Edit: It might have to do with Battlefield Promotions, OR I stumbled upon a 2nd bug. On that same same turn, I attacked the remaining bandit rider on that square with my Horse Archer right above it. Combat odds said I would get +4 exp, but instead of exp the horse archer got a promotion (Raider I). However, the horse archer also received an additional "level-up" promotion (as if he reached the level at 37 exp). When I selected the promotion, the "next level" exp requirement went to 50, but the archer is only at 36.4 exp (not enough to have reached that level).
 

Attachments

  • Experience - Combat Odds.JPG
    Experience - Combat Odds.JPG
    399.7 KB · Views: 50
  • Experience - After Attack.JPG
    Experience - After Attack.JPG
    401 KB · Views: 43
  • Experience - Combat Log.JPG
    Experience - Combat Log.JPG
    394.7 KB · Views: 49
  • Experience Bug.7z
    3 MB · Views: 50
  • Experience - Horse Archer.JPG
    Experience - Horse Archer.JPG
    407.7 KB · Views: 68
v29 - possible bug regarding research production per turn. Depending on the technology I select, my :science:/turn changes:

Nothing selected - 6901 per turn
Aesthetics - 9316 per turn
Democracy - 10696 per turn
Martial Arts - 7936 per turn
Stirrup - 8626 per turn

I first started noticing this partway through the ancient era. Nothing appears to change within the cities, either (i.e. my capital has same specialists, same :science: production, regardless of the technology I select. Nothing changes in Financial advisor as well, except for the Research field (but not the total commerce or anything else). Is this normal?
 

Attachments

  • Researching Techs.7z
    3 MB · Views: 45
  • Research Per Turn.jpg
    Research Per Turn.jpg
    276.6 KB · Views: 72
Ok, pinned this down. Testing the fix now, should be pushed later today. Thanks for the saves.

I'm desperately curious as to what was causing this! And how you pinned it down when a reload would somehow seem to resolve the situation! (Not to point fingers by any means... just to get a clue of what was going on in the code.)
 
v29 - possible bug regarding research production per turn. Depending on the technology I select, my :science:/turn changes:

Nothing selected - 6901 per turn
Aesthetics - 9316 per turn
Democracy - 10696 per turn
Martial Arts - 7936 per turn
Stirrup - 8626 per turn

I first started noticing this partway through the ancient era. Nothing appears to change within the cities, either (i.e. my capital has same specialists, same :science: production, regardless of the technology I select. Nothing changes in Financial advisor as well, except for the Research field (but not the total commerce or anything else). Is this normal?

That is indeed normal. It has to do with how many OR prereqs the tech has and how many of those prereqs you know. It can also be related to Tech Diffusion, and how many nearby civs know that tech.
 
v29 - I am convinced that there is a bug in here; it's been happening for my whole game. I am only getting ~1 exp per battle, no matter what the combat odds say. This occurs regardless of what unit I use to attack, or what type of enemy unit I attack (barbarian, animal, or AI player). Dynamic exp is off, battlefield promotions is on, barbarian experience/generals is on.

In the attached example, my Mammoth Rider attacks a Bandit Rider (owned by Mongolian AI player). The Mammoth begins with 30.6 exp and combat odds says he will get +3 more. After the attack, however, he only has 31.6 exp, or a gain of +1.

I have never seen my units gain less than +1.0 exp. When they do gain more than +1.0, it's never more than about +1.5 and it's only when combat odds says they will get a TON (like 8+) when attacking.


Edit: It might have to do with Battlefield Promotions, OR I stumbled upon a 2nd bug. On that same same turn, I attacked the remaining bandit rider on that square with my Horse Archer right above it. Combat odds said I would get +4 exp, but instead of exp the horse archer got a promotion (Raider I). However, the horse archer also received an additional "level-up" promotion (as if he reached the level at 37 exp). When I selected the promotion, the "next level" exp requirement went to 50, but the archer is only at 36.4 exp (not enough to have reached that level).
Alright then, I've got this on my list of medium priority release goals to investigate further. Please leave your savegame loaded here until I can let you know I've taken a look. (It's not TOO critical since at least you are getting some xp for each combat.)
 
v29 - Just researched Martial Arts, but I can't build a Training Dojo in any of my cities (although I meet the prerequisites stated in the pedia for the building). However, I am able to build the Shaolin Temple wonder.

Do you think it's because the Martial Arts I promotion requires Taoism (religion)?

Edit: Confirmed, both the Training Dojo and Masters Dojo require Taoism (religion) to be present in a city. Is this by design?
 

Attachments

  • Martial Arts I.JPG
    Martial Arts I.JPG
    305.7 KB · Views: 45
  • Training Dojo.JPG
    Training Dojo.JPG
    318.1 KB · Views: 67
  • Training Dojo.7z
    3 MB · Views: 33
v29 - Minor glitch, but my worker apparently received the Winter Born promotion when he was built. It serves no purpose for a worker, since it only provides attack/defense bonuses. Also to note, the picture/icon for Winter Born is a scorpion, which doesn't quite fit the "winter/tundra" theme...

Spoiler :
Been running into a lot of bugs as I play through, so I'm going to start posting images this way so I don't run out of attachment space.

 
v29 - Minor glitch, but my worker apparently received the Winter Born promotion when he was built. It serves no purpose for a worker, since it only provides attack/defense bonuses. Also to note, the picture/icon for Winter Born is a scorpion, which doesn't quite fit the "winter/tundra" theme...

Spoiler :
Been running into a lot of bugs as I play through, so I'm going to start posting images this way so I don't run out of attachment space.


The initial military promotions mod probably has not been updated for the change in workers that gives them promotions. The test it uses probably was fine before.

If you can come up with a better icon that would be appreciated. I asked for better icons when the mod was merged but none were forth coming.

Edit found it - Initial Military Promotions has not been updated to ignore all the new worker types.
 
There appear to be 2 different circumstances where an attacking unit will not use its movement when attacking a city. (In R2R, again, so they might not be exactly the same circumstances as in the current version of C2C.)

The first is when the defender withdraws. This leaves the attacker with the movement arrow thing connecting to the city and number indicating they are 1 turn away, but showing the red circle thingy indicating they can't go there (because the enemies are still there, of course, and it already attacked this turn). No movement is used. This appears to happen every time the defender withdraws when in a city. I expect the code in the DLL is just having the attacker advance which would naturally use up the movement point - if this is the case, it should happen when attacking a stack outside a city as well since the non-withdrawing enemy units will still be on the plot, unless there is some city check in the code which is doing something wrong in that specific case.

The second is, I think, happening only when the defender is exactly the next to last defender of the city. It dies, leaving one more defender, and the attacking unit does not lose any movement. It is not showing the "moving here" indicator like the withdraw case does, it just has not used any movement but can not attack again. It is free to move even if it should have no movement left, so if you take the city with some other attacker it can move into the city on that same turn. (I have not tried this with a unit that has the Blitz type multiple attacks.) I'm not sure what would cause this in the code for the next to last defender, except it is probably misinterpreting something somewhere that makes it act as if it was the last one instead of there still being one more defender left.

There may be other cases, like withdrawal of a defender when attacking a stack outside a city. I saw both of these two happen multiple times in a game. I decided to attack a civ in an already on-going game just to see if I could spot a pattern to this issue (well, he also kept bothering me but never improved his attitude towards me even when I gave him techs he asked for), and I unexpectedly spotted two while taking all of the civ's 8 cities. I'm pretty sure the "next to last defender" version happened for all 8 cities, and the "city defender withdraws" thing happened about 4 times too. The instance I reported before was also for a next to last defender.
 
Here is my test game (SVN rev. 5200). Industrial era. I have all requirements (great person, techs, resources), but I can't found any corporation.
 

Attachments

  • Shadowclaw_test.rar
    2 MB · Views: 51
Got this error message and then CTD, but NO minidump, when trying to enter the WB?

[307284.934] FBMode = FBMODE_MULTISAMPLES_2
[307285.122] CvApp::OnActivate
[310183.875] ERR: Memory allocation failure - exiting program.
Reason:bad allocation


EDIT: After a complete re-start of my PC it worked again??
 
Charismatic trait is bugged.
(Developing leaders, focused traits, SVN 5211)

EDIT: I think these tags are wrong:

Code:
\Assets\Modules\ls612\Traits\ls612_CIV4TraitInfos.xml

<Type>TRAIT_CHARISMATIC</Type>
			<iMilitaryProductionModifier/>
<Type>TRAIT_CHARISMATIC1</Type>
			<iMilitaryProductionModifier/>

If I replace them with "<iMilitaryProductionModifier>-15</iMilitaryProductionModifier>" it seems to be working corectly.
 

Attachments

  • Charismatic.jpg
    Charismatic.jpg
    284.2 KB · Views: 47
  • Charismatic2.jpg
    Charismatic2.jpg
    289.2 KB · Views: 49
  • Charismatic.rar
    3.4 MB · Views: 34
Charismatic trait is bugged.
(Developing leaders, focused traits, SVN 5211)

EDIT: I think these tags are wrong:

Code:
\Assets\Modules\ls612\Traits\ls612_CIV4TraitInfos.xml

<Type>TRAIT_CHARISMATIC</Type>
			<iMilitaryProductionModifier/>
<Type>TRAIT_CHARISMATIC1</Type>
			<iMilitaryProductionModifier/>

If I replace them with "<iMilitaryProductionModifier>-15</iMilitaryProductionModifier>" it seems to be working corectly.
Yes, I know about that and it should be fixed now on the SVN for my traits.
 
Turns up until now have only taken a few seconds. But I seem to be permanently hung on waiting for this one now. The AI log shows this:

[341002.375] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) advertising for work
[341002.375] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341002.375] ...already at target plot.
[341002.625] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341002.625] ...already at target plot.
[341003.125] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341003.125] ...already at target plot.
[341003.625] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341003.625] ...already at target plot.
[341004.156] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341004.156] ...already at target plot.
[341004.656] Unit Hunter (475175) for player 12 (Russian Empire) at (195,25) found work at (195,25) [to join 483371]
[341004.656] ...already at target plot.

That's the abridged version. As you might guess, it keeps on going, and is getting longer by the second.

This is the same game I was talking about in the AI thread, so I'd quite like to keep on going if I can! I've attached the save to my original post http://forums.civfanatics.com/showthread.php?t=492747
 
does anyone know why ocean tiles randomly pop up on coast tiles?

Global Warming effects I believe. It CAN cause a known bug in some cases but its usually not problematic.
 
The next-to-last defender causing the attacker to not lose a movement point is due to the change to the CvPlot::plotCount function in revision 4848 which has it no longer counting dead units (which is determined by a unit currently having damage sufficient for it to be dead). We were asked to report any unanticipated side effects of this change that we have noticed, so consider a side effect reported.

In CvUnit's updateCombat if it is finalizing the combat (bFinish is true) and pDefender is dead, once you get pas the initial stuff there is a piece of code that determines if the attacker can can advance.

There is a line of code that looks like this at line 3669 (at C2C revision 5201):
Code:
bAdvance = canAdvance(pPlot, ((pDefender->canDefend()) ? 1 : 0));
The call to pDefender->canDefend() will return true (it essentially just checks for base strength > 0). Therefore the 2nd argument to canAdvance will be 1.

This 2nd argument causes canAdvance to ignore that many defenders, which will be 1. The number of defenders is determined via pPlot->getNumVisibleEnemyDefenders. This uses the plotCount function which was modified to ignore dead units. Before the modification, the actual defender was counted so the next to last defender would cause plotCount to return a value of 2. After the modification it returns a value of 1. Therefore, with the 2nd argument set to 1 the canAdvance function used to return false since it would find 2 units on the plot and 2 is more than the specified value of 1. Now it returns true since it only finds 1 unit on the plot which is not more than the 1 that it was told to ignore.

So bAdvance used to be set to false for the next-to-last defender, but now gets set to true. It therefore does not decrement the moves value of the attacker.

So with the change to plotCount from rev. 4848 you no longer need to ignore 1 unit. Therefore the above line of code should just always specify 0 for the 2nd argument in the call to canAdvance. (When it is on the last defender, it will not be counted since plotCount will see it as already dead, so the apparent number of units on the plot will now be 0 and you also do not have to ignore one anymore.)

I have tested this and it does fix this problem.

Any other cases where this issue crops up could be due to the same change in behavior. On the other hand, it looks to me like the defender withdraw section of the code is simply missing the call that changes the attackers movement points in R2R, although the code is a bit different in C2C and it does appear to do it (probably changed while adding the various options that can affect this in the Combat Mod) except a quick looks seems as if it may not be quite correct either since the attacker will apparently never move onto the defenders plot unless it is doing a stampede or onslaught or it has enough movement points left to do so after deducting a moves worth of movement points, I think.
 
Status
Not open for further replies.
Top Bottom