v27 and above - Single Player Bug/Crashes report thread

Status
Not open for further replies.
@Hydro:

The Flamingo is upside down and backwards. :rolleyes: It must have wandered too far into the Salt Flats and died or something.
 

Attachments

  • Civ4ScreenShot0044.JPG
    Civ4ScreenShot0044.JPG
    221.2 KB · Views: 76
I've been doing quite a bit of that during this whole cycle actually. And there's a few things to bring up that need repairing that I've waited for the freeze to mention because I believe I mentioned them before:
Error2-1-5-13_zps3fb3f816.png


and

Error1-1-5-13_zps049c268a.png


Just a few references being called in the XML that don't exist anymore. Not causing a crash on load but they come up EVERY time I run the debugger which is a lot these days...



As a note, there's also something wrong with the numUnitCount and numVisiblePlots (or something like that) in the AI codes that takes place a lot as soon as games develop to where AI's are on the scene. I've tried taking a look but I don't understand that region too well. I suspect it may be wrapped up into the 'Sometimes Invisible units that should still be invisible are being detected when they shouldn't be' bug.


Also: I have a few known longstanding bugs I'm going to be attempting to resolve. Last night I filtered through my list to pick those out as 'the things to focus on now'. We have a less bugged version than most have been already, but there's still some longstanding issues to address.

Sadly, OOS problems are likely to continue to be an issue for this release though.

The first two are really simple to fix, so long as I know what the correct targets are for that XML. The next two have been around forever and Koshling said he didn't know what was causing them, so I wouldn't worry too much about them.

I think those two might be a part of some bigger problems but yeah, that whole section is a bit beyond me. I think it may be making the count out of the proper sequence or something but I just can't seem to figure it out. It just doesn't seem to be like it should be happening, kinda like the building processing bug that is somehow finding a higher total defense from buildings than the present and active buildings add up to. (My theory on that one does seem to have some flaws but I'm not sure enough on what's going wrong to act on it...)

So yeah, I've let it lie and every now and then look back over it to see if I've been able to improve enough to spot it but I'm not tweaking it since I know I don't understand it.
 
@Dancing Hoskuld

1. In civpedia when I click on the Vanilla resource I get a messed up pedia page.

Which is what I said when I added it. I asked if someone could have a look to see if they could see the problem. It is only the pedia, every thing is OK. I can remove it if you like.

2. Where did the Armadillo and Opossum go? They seem to have diapered from the game.


I have not added them yet. The art for them is now in my FPK rather than in my folder.
Where did you get the Event info from??

With the new way of adding buttons for unit actions you need to write the event. As I said the one I wrote worked for the lawyer but when I copied it and changed it for the Story Teller (also immigrant, captives, statesman and diplomat) they did not work.
 
Ok, so I just wanted to take a moment to explain to you guys something I've figured out tonight.

I have been looking into the Tunnel problem (land units in tunnels can be attacked by naval units and vice versa) and it appears to be a much more complicated issue than I had suspected it would be.

In short, there are very sweeping rules as to whether units can attack or move over and through enemy units and pretty much only invisibility is able to handle things on a by-unit basis. Otherwise, if you can see an enemy you attack it if you move onto the same tile unless you are yourself invisible and the plot allows you to move in (as in a rogue moving into a city when not officially at war.) I actually suspect that its such a sweeping rule that if any enemy unit is visible on a plot, any of those enemies can be attacked, to the point that it would be entirely possible for an invisible unit to come up as a stack defender if the stack somehow determined it was the best to defend (there could be a few lines to enforce that such invisibles never come up before visibles to accomodate this.)

The structure that guides all this is very intensely complex and tends to evaluate things in a manner that is heavily reliant on the plot circumstances and visibility so any restructure that would enable the kind of dynamic we are looking for with tunnels would be a much much more major project than a pre-release fix would be appropriate for.

I eventually plan to work visibility on a per unit basis rather than a team/plot basis which it is currently functioning on and during such a project, things would become much easier to address the tunnel issue. So for now, I'm putting it on a backburner.

I bring this up to apologize as I was really hoping to get a fix for this before the next version release. It's just too big a project with a lot of potential for error enforcing the need for a lot of trial and error and playtesting to make sure I haven't accidentally changed the functioning of something that shouldn't have been altered for that. So to be careful, such a project should begin at the start of a cycle, not the end, and the next cycle has too much planned for that already. So it'll have to wait much longer than I'd hoped.


I also looked into the text manager issue regarding the compiling of the Property Manipulators on unit promotions along promotionlines. Wow is that one complex too or what? I understand what AIAndy did with the text display enough to know its just an amazing piece of work. Unfortunately, its handled so differently to the usual way promotion tag values are handled that its very difficult to get them to display in such a compiled manner. I would suspect all of the promotion values there work, but they will display for each until someone with a lot more skill and patience than I can address it. Part of the issue there is the way he enabled the tag design to have so many variable ways to be expressed. So it can't be easily compiled into a singular sum with any ease. I suppose if I were to take a few weekends to sort it all out I could probably fix it but that's just how complex that issue really is. It's a truly mindbending puzzle to work out and a testament to the incredible intelligence possessed by the designer!
 
About the Tunnel problem I see two possible solutions though how easy they would be to implement I don't know:

Both require an "give promotion while on a tunnel plot or an improvement" that all land based units can have, but is removed when no longer on said plot.

1. If possible to add it to the road improvement a Spy or Special Invisibility promotion comes into effect while on the plot. Special would be needed so units meeting each other in sea tunnels can fight each other. It might be needed to have something enabling them to move along the tunnel even through enemy boats though, that might be the trickiest part.

2. If not possible to add it to a road improvement then make the Tunnel a dual build improvement, making a Tunnel as well as a sea improvement (or feature if that's better) that then grants the invisibility promotion.

The problem with moving through enemy boats that are on the surface is another matter and probably the most difficult one to solve.

Cheers
 
My current game freezes when ending the turn.
The only way I'm able to continue playing I've found so far is to either delete a few (2) of Alaric's cities or most of his units.
It also seems to continue if the city of Scandza is subdued by an agent and falls back to the Goths, whereas in that process I'm again at war with them.

I'm normally playing on v27 release, but have also tried with the newest SVN version (4622), which didn't solve the issue. Though I'm receiving an error log message with the newest SVN just before the game freezes:
"Error in BeginPlayerTurn event handler <bound method Revolution.onBeginPlayerTurn of <Revolution.Revolution instance at 0x1D2858A0>>"
Not sure if that's related or something else entirely.
 

Attachments

"Error in BeginPlayerTurn event handler <bound method Revolution.onBeginPlayerTurn of <Revolution.Revolution instance at 0x1D2858A0>>"
Not sure if that's related or something else entirely.

I'm not certain about the rest, but this part sounds like an issue with the Python interpreter.
 
My current game freezes when ending the turn.
The only way I'm able to continue playing I've found so far is to either delete a few (2) of Alaric's cities or most of his units.
It also seems to continue if the city of Scandza is subdued by an agent and falls back to the Goths, whereas in that process I'm again at war with them.

I'm normally playing on v27 release, but have also tried with the newest SVN version (4622), which didn't solve the issue. Though I'm receiving an error log message with the newest SVN just before the game freezes:
"Error in BeginPlayerTurn event handler <bound method Revolution.onBeginPlayerTurn of <Revolution.Revolution instance at 0x1D2858A0>>"
Not sure if that's related or something else entirely.

We need the PythonErr.log (not PythonErr2.log) from that game to isolate the cause. It will tell us which line in the Revolution code (Revolution module) the problem is occurring.
 
About the Tunnel problem I see two possible solutions though how easy they would be to implement I don't know:

Both require an "give promotion while on a tunnel plot or an improvement" that all land based units can have, but is removed when no longer on said plot.

1. If possible to add it to the road improvement a Spy or Special Invisibility promotion comes into effect while on the plot. Special would be needed so units meeting each other in sea tunnels can fight each other. It might be needed to have something enabling them to move along the tunnel even through enemy boats though, that might be the trickiest part.

2. If not possible to add it to a road improvement then make the Tunnel a dual build improvement, making a Tunnel as well as a sea improvement (or feature if that's better) that then grants the invisibility promotion.

The problem with moving through enemy boats that are on the surface is another matter and probably the most difficult one to solve.

Cheers

Well, you do seem to understand the depth of the problem. I could quite easily make units in tunnels invisible but that doesn't really solve it because they could still attack enemy ships AND if I made it so that other units in tunnels could see units invisible for this reason then as soon as they do, ships could also attack them. So its not a sufficient enough solution sadly.

It will require a major restructuring of some very game critical processes and checks and there simply isn't the time to address it before the release unfortunately.
 
This is such an excessive amount of missionaries - since they cost $1 a turn and he just has them sentry there like a .

Notice he has another small pack of them to the north west too. Also, the fact that a great prophet is sitting there on that horse tile undefended, and a great general amongst this pack of missionaries undefended is worrying..
Earlier in the game the greeks wandered a great merchant through my territory - I could have easily picked it off with a rogue since it was undefended. AI need to be told to guard there great people/generals.

Spoiler :
11KoTg3.jpg
 
the AI City in screenie, the unit that was there (horse crossbowman) attacked and left the city helpless??

This game is were all the errors/bugs etc, listed in the Freeze thread is also happening?????:huh:
 
The first issue seems to be a result of simply having all three units selected and thus seeing all promos on all those units, including the blue ones on the Explorer.

The second is an AI issue BUT does seem to make some sense as the horse unit wouldn't be gaining any defensive bonuses despite being in the city and may have some benefit in attacking over trying to stage a defense at all. Not saying it perhaps shouldn't be changed but the end result would probably not be much different as when they then attack the next round, the horse would've suffered if the same or worse odds when they attack.

However, I was hoping for a save to show some of the issues being discussed so thanks for that!
 
This is such an excessive amount of missionaries - since they cost $1 a turn and he just has them sentry there like a .

Notice he has another small pack of them to the north west too. Also, the fact that a great prophet is sitting there on that horse tile undefended, and a great general amongst this pack of missionaries undefended is worrying..
Earlier in the game the greeks wandered a great merchant through my territory - I could have easily picked it off with a rogue since it was undefended. AI need to be told to guard there great people/generals.

Spoiler :
11KoTg3.jpg

Post a BBAI log for that and we can potentially figure out what the AI is doing wrong (although probably not before release of V28).
 
We need the PythonErr.log (not PythonErr2.log) from that game to isolate the cause. It will tell us which line in the Revolution code (Revolution module) the problem is occurring.

The PythonErr.log contains the following entries:
Code:
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "Revolution", line 566, in onBeginPlayerTurn
  File "Revolution", line 998, in checkCivics
AttributeError: 'NoneType' object has no attribute 'getDescription'

However this doesn't seem to be the root of the problem, as it only occurrs when opening the save game with the SVN release and not on v27, where the file is empty.

And more importantly, it seems the game is stuck in an endless loop concerning AI Promotions. At least the "RandomLogger - Player 0 - Set xx.log" file is continually being filled with entries like
Code:
[0640]     4 of 15    -- AI Promote
[0640]    11 of 15    -- AI Promote
[0640]     1 of 15    -- AI Promote
[0640]     5 of 15    -- AI Promote

I've terminated the game after the log file had reached 100 MB.


Actually I've now hit this freeze 3 times in this specific game. The first time I was able to work around by deleting all units of one specific Goth city, the second time, which is my original post, I'd deleted basically ALL of the Goth's units (and gave back after that turn), and now I've just hit the third occasion where the game freezes and fills up the log file with AI Promotion entries.
I have no idea how to fix this besides AGAIN deleting units...
 
The PythonErr.log contains the following entries:
Code:
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "Revolution", line 566, in onBeginPlayerTurn
  File "Revolution", line 998, in checkCivics
AttributeError: 'NoneType' object has no attribute 'getDescription'
It is attempting to identify the civics that the revolutionary group should select. This could mean that the leader of the revolutionary group has a preferred civic that does not exist but probably not, I think those would show up as XML errors. OK perhaps I should look at the code:mischief:

Line 998 in the Revolution.py is
Code:
			RevEvents.recordCivics( iPlayer )

However I do notice that this module checkCivics does not check that iPlayer is valid. Which would occur if the revolutionary group had been destroyed. I should probably put check in there even if this is not the cause of this particular error. Although it does check for no cities. The recordCivics module does check that iPlayer is valid.:confused: I'll put the test in as I can't see anything else wrong in the code.

the error is probably occurring on the previous line when the iPlayer is invalid as it tries to get its description. So putting a test in for a valid player may actually solve the problem. ;)
 
I have a weak theory as to what MAY be causing that second issue there with promos but it is decidedly a longshot.

On some code review, the ai will use this a lot as build choices and tech selections are going to cycle through all units and check various promotion values. It's not just used for the units to determine their own promo choices. Makes that whole section a bit heavy and there was one spot I was wondering about that might be a bit 'off' in the way it processes depending on the circumstances and that I've patched in the code on my end and will be available on the next update.

For ls612's sake I'll explain the change:
Spoiler :
Code:
	if (kPromotion.isBlitz())
	{
		//ls612: AI to know that Blitz is only useful on units with more than one move now that the filter is gone
		if (GC.getUnitInfo(eUnit).getMoves() > 1)
		{
			if ((eUnitAI == UNITAI_RESERVE || 
				eUnitAI == UNITAI_ATTACK ||
				eUnitAI == UNITAI_ATTACK_CITY ||
				eUnitAI == UNITAI_PARADROP))
			{
				iValue += (10 * iMoves);
			}
			else
			{
				iValue += 2;
			}
		}
		else
		{
			iValue += 0;
		}
	}
This is what you had. This is the minor change I've adjusted it to:
Code:
	if (kPromotion.isBlitz())
	{
		//ls612: AI to know that Blitz is only useful on units with more than one move now that the filter is gone
		if ([COLOR="Red"]iMoves [/COLOR]> 1)
		{
			if ((eUnitAI == UNITAI_RESERVE || 
				eUnitAI == UNITAI_ATTACK ||
				eUnitAI == UNITAI_ATTACK_CITY ||
				eUnitAI == UNITAI_PARADROP))
			{
				iValue += (10 * iMoves);
			}
			else
			{
				iValue += 2;
			}
		}
		else
		{
			iValue += 0;
		}
	}
This is because iMoves is defined above with:
Code:
	int iMoves;
	if (pUnit == NULL)
	{
		iMoves = kUnit.getMoves();
	}
	else
	{
		iMoves = pUnit->baseMoves();
	}
They did this because there are a few ways this segment may be processed and some of those ways involve not having an actual in-game unit defined but rather only the unit type itself. If that second case is in play, the GC.getUnitInfo(eUnit).getMoves() could cause some issues. I kinda doubt this is actually the problem being reported here but its the only theory I can come up with based on any recent changes to that segment. Haven't been many of late.

I've made a lot of mistakes figuring this out about the unit references in this section but they always led to crashes I spotted in playtesting after adjustments were made which is why I kinda doubt this is the issue. I'm thinking if it was truly problematic it would be causing a CTD.

More likely, we probably have some kind of repeated over-evaluation taking place on the build selections or tech choices somewhere and it's checking this function a lot as a result. Unfortunately, that would be a lot harder to find!

On a side note, I'm not sure that getMoves is quite the right reference for an actual unit either... but I haven't looked that deeply at it yet. I'm not sure if its the actual move maximum the unit currently has or if its the base moves unmodified by other sources like existing promos and such.
 
sp00n since I can't test this could you? The extracted file goes in the assets/python/revolution/gameready folder. If it fixes your problem I will put it on the SVN. I don't think I made any typos in it but I am due at the dentist to have a painful molar out in an hours time.;)
 
And more importantly, it seems the game is stuck in an endless loop concerning AI Promotions. At least the "RandomLogger - Player 0 - Set xx.log" file is continually being filled with entries like
Code:
[0640]     4 of 15    -- AI Promote
[0640]    11 of 15    -- AI Promote
[0640]     1 of 15    -- AI Promote
[0640]     5 of 15    -- AI Promote

I've terminated the game after the log file had reached 100 MB.


Actually I've now hit this freeze 3 times in this specific game. The first time I was able to work around by deleting all units of one specific Goth city, the second time, which is my original post, I'd deleted basically ALL of the Goth's units (and gave back after that turn), and now I've just hit the third occasion where the game freezes and fills up the log file with AI Promotion entries.
I have no idea how to fix this besides AGAIN deleting units...

I have a weak theory as to what MAY be causing that second issue there with promos but it is decidedly a longshot.

On some code review, the ai will use this a lot as build choices and tech selections are going to cycle through all units and check various promotion values. It's not just used for the units to determine their own promo choices. Makes that whole section a bit heavy and there was one spot I was wondering about that might be a bit 'off' in the way it processes depending on the circumstances and that I've patched in the code on my end and will be available on the next update.

For ls612's sake I'll explain the change:
Spoiler :
Code:
	if (kPromotion.isBlitz())
	{
		//ls612: AI to know that Blitz is only useful on units with more than one move now that the filter is gone
		if (GC.getUnitInfo(eUnit).getMoves() > 1)
		{
			if ((eUnitAI == UNITAI_RESERVE || 
				eUnitAI == UNITAI_ATTACK ||
				eUnitAI == UNITAI_ATTACK_CITY ||
				eUnitAI == UNITAI_PARADROP))
			{
				iValue += (10 * iMoves);
			}
			else
			{
				iValue += 2;
			}
		}
		else
		{
			iValue += 0;
		}
	}
This is what you had. This is the minor change I've adjusted it to:
Code:
	if (kPromotion.isBlitz())
	{
		//ls612: AI to know that Blitz is only useful on units with more than one move now that the filter is gone
		if ([COLOR="Red"]iMoves [/COLOR]> 1)
		{
			if ((eUnitAI == UNITAI_RESERVE || 
				eUnitAI == UNITAI_ATTACK ||
				eUnitAI == UNITAI_ATTACK_CITY ||
				eUnitAI == UNITAI_PARADROP))
			{
				iValue += (10 * iMoves);
			}
			else
			{
				iValue += 2;
			}
		}
		else
		{
			iValue += 0;
		}
	}
This is because iMoves is defined above with:
Code:
	int iMoves;
	if (pUnit == NULL)
	{
		iMoves = kUnit.getMoves();
	}
	else
	{
		iMoves = pUnit->baseMoves();
	}
They did this because there are a few ways this segment may be processed and some of those ways involve not having an actual in-game unit defined but rather only the unit type itself. If that second case is in play, the GC.getUnitInfo(eUnit).getMoves() could cause some issues. I kinda doubt this is actually the problem being reported here but its the only theory I can come up with based on any recent changes to that segment. Haven't been many of late.

I've made a lot of mistakes figuring this out about the unit references in this section but they always led to crashes I spotted in playtesting after adjustments were made which is why I kinda doubt this is the issue. I'm thinking if it was truly problematic it would be causing a CTD.

More likely, we probably have some kind of repeated over-evaluation taking place on the build selections or tech choices somewhere and it's checking this function a lot as a result. Unfortunately, that would be a lot harder to find!

On a side note, I'm not sure that getMoves is quite the right reference for an actual unit either... but I haven't looked that deeply at it yet. I'm not sure if its the actual move maximum the unit currently has or if its the base moves unmodified by other sources like existing promos and such.

I betcha this is the reason WHY the turn times have become sooo long now again??? They used to be 20-30 seconds, now they are over 1 minute, closer to 1 1/2 minutes long, and this is in Classical Era:mad:
 
Status
Not open for further replies.
Back
Top Bottom