Éa III, Sword & Sorcery: Bugs/Crashes thread

@Bob Morane, Could be a bug or it could be following rules that you don't know (and how could you?).

What we need is some UI in the GP's unit panel telling you "This person is keeping a low profile right now" (linked to unit invisibility). Then you could learn when they are and aren't supposed to be invisible, and know for sure if it isn't working properly.

The basic rule is that almost all actions make them visible. The two that don't (the only 2 iirc) are moving and healing (skip turn should work as moving, I think).
 
Ah, OK. Most probably occurred when building towers or temples (those are the main reasons my GPs would be standing in the open). That would also explain why i sometimes see AI GPs when they finish casting a spell (but not while they are casting multi-turn spells)

Speaking if Spells, Seeing Eye Glyph seems a bit funky. Sometimes it will reveal area correctly, sometimes not.
Spoiler :
EaScreen0001.jpg

In case you can get something from the log, here it is
 
Ea III v5a

A Lua message on turn 234 (the turn when an Ai liberated a city state from me, however I don't know if this is related):
EaCities.lua:1219: table index is nil
I tried to play afterwards, but got another lua message at each turn (not the same as the first one, but I guess my game was corrupted).
Lua log attached


a balance note : I was playing Ab and could get to mumakil a few turns after the lua error message (around turn 240). I had two research bonus from the civilization and from the tome of beasts, low population, and didn't research much outside of the elephant/hunting branches (eg my only research-oriented tech was writing, but generated mostly sages). I guess I could have been a little earlier if I hadn't tried and waged wars (wanted to play with my war elephant. Eliminated a city state and one of my neighbours) .
 

Attachments

Playing v5a: Despite not having Bronze Working, was still able to see some copper on the map (I don't remember what I did to be able to), and was able to build a mine on it. However, once the mine was complete, it and the copper vanished. Even after getting Bronze Working...no copper.
First time I encountered Goblins (and then some!). I like how the little weedy guys just keep getting mowed down but more keep coming in combat...
 

Attachments

@All, please try to separate your bug and balance/comments posts. I go through this thread only to clean up bugs - everything else gets in the way.

@Civtar, Copper and Iron are visible with mining (& visible means you can mine it). But you need Bronze Working to gain the copper. The landmark graphic for copper+mine is broken, so you have them but can see it (check mouseover text).

@Bob Morane, darn. Do you see any pattern there? (I don't.) There is something about dll visibility code that I'm not understanding.

@Barak, what the Lua.log tells me is that you loaded a game at turn 203 that is already broken. I want to troubleshoot these, but the only way can do it is if you give me Lua.log before you restarted Civ5 (the old one get over-written when you restart Civ5). I need to see what was happening when the game got broken.

@Vinnz, ok, there is a GameEvents called CityCaptureComplete and I'm not quite understanding its arguments in the case of liberation. It was called 3 times. Does this make sense:

(iPlayer, bCapital, x, y, iNewOwner, cityName)
5 true 72 21 0 Horn
5 true 70 15 0 Durathrór
7 false 64 30 34 Axuma

1st line: you took capital from player 5
2nd line: you took last city from player 5 (lua thinks they are dead now)
3rd line: this is where I don't (or didn't) understand args. I assume that player 7 liberated (from you) and gave back to player 34 (the CS, who lua thinks is dead). I thought that this event would show player 7 taking city from you (so 0 and 7 for 1st and 5th args). But instead is reads as if the CS took the city from the liberating Full civ. OK, if that's the way it works - fine. But I didn't understand so code is currently bugged. I think I understand now (after writing this) so can now fix...

Also, I found a totally unrelated error from your log related to showing Berserker GP in top panel UI. That'll be corrected in next hotfix.
 
@Barak, what the Lua.log tells me is that you loaded a game at turn 203 that is already broken. I want to troubleshoot these, but the only way can do it is if you give me Lua.log before you restarted Civ5 (the old one get over-written when you restart Civ5). I need to see what was happening when the game got broken.

I'd like to provide that for you. What do I need to do. I DO have a save from right before the issue happened (before I took the city), but i fear the log is corrupted and the save my be too.

How can I help?
 
@Barak, What I'm not sure about is if you are seeing errors, then quitting and reloading. Or if you only see errors after loading a game. Probably the best thing you can do is move Lua.log out of its folder and save it somewhere else when you quit Civ5 (or before restarting it again). Then if you see errors on loading, you can post both the before and after Lua.log.
 
@Vinnz, ok, there is a GameEvents called CityCaptureComplete and I'm not quite understanding its arguments in the case of liberation. It was called 3 times. Does this make sense:

(iPlayer, bCapital, x, y, iNewOwner, cityName)
5 true 72 21 0 Horn
5 true 70 15 0 Durathrór
7 false 64 30 34 Axuma

1st line: you took capital from player 5
2nd line: you took last city from player 5 (lua thinks they are dead now)
3rd line: this is where I don't (or didn't) understand args. I assume that player 7 liberated (from you) and gave back to player 34 (the CS, who lua thinks is dead). I thought that this event would show player 7 taking city from you (so 0 and 7 for 1st and 5th args). But instead is reads as if the CS took the city from the liberating Full civ. OK, if that's the way it works - fine. But I didn't understand so code is currently bugged. I think I understand now (after writing this) so can now fix...

Also, I found a totally unrelated error from your log related to showing Berserker GP in top panel UI. That'll be corrected in next hotfix.
I confirm
1st line, 2nd line: agree, I conquered another player capital, then their last city
3rd line: I had conquered a city state (probably before loading), and it is now taken from me by another AI player. I think they liberated it since the city reappeared as a city state on next turn.

About the UI panel: I remember that the GP mouseover didn't work at all (not showing the GP but the ressources iirc), not sure if this was consistent through this game or just occasional.
 
About the UI panel: I remember that the GP mouseover didn't work at all (not showing the GP but the ressources iirc), not sure if this was consistent through this game or just occasional.
Did you have policy that allowed Berserker subclass? I found error that would crash top panel GP mouse-over if it tried to display that subclass.

I'll have both these problems solved in hotfix.
 
Hotfix b for v5. "Extract Here" inside your MODS folder. Cumulative with previous hotfixes.
  • Mod should now deal with "civ resurrection" without error (i.e., when a city is liberated for a full or CS player that was previously wiped out)
  • Fixed error in Top Panel UI when trying to display Berserker subclass
  • Fixed code in TableSaverLoader to deal with nested tables being created and then destroyed
 
@Bob Morane, darn. Do you see any pattern there? (I don't.) There is something about dll visibility code that I'm not understanding.
Old stuff under there.
Spoiler :
No pattern yet :( Something i found while messing with visibility and apparently you didn't.
Code:
Map.UpdateDeferredFog()
I used it after changing plot visibility and it sorted some errors (can't remember exactly what didn't work without).
I searched all your lua files for this method and didn't found it so i guess you havn't used it. Here is how i used it
Code:
if Players[i]:IsEverAlive() then
	for pAreaPlot in PlotAreaSpiralIterator(Players[i]:GetStartingPlot(), 4, SECTOR_NORTH, DIRECTION_CLOCKWISE, DIRECTION_OUTWARDS, CENTRE_EXCLUDE) do
		pAreaPlot:SetRevealed(Players[i]:GetTeam(), true)
	end
	Map.UpdateDeferredFog()
What this did was reveal some area around starting position. Didn't work well without Map.UpdateDeferredFog(). The same code could be modified for the Scrying spell once you decide to implement it.

Thinking of this, what do you use to change visibility? I searched all files for methods i know and found none? Did you mod it on the dll side?
In case you want to try something different. I think i found the code Firaxis uses to reveal all the map with ctrl-z if you have debug enabled.
Code:
elseif ( wParam == Keys.Z and UIManager:GetControl() and UI:DebugFlag() and not PreGame.IsMultiplayerGame() and not PreGame.IsHotSeatGame()) then
    Game.ToggleDebugMode();
	local pPlot;
	local team = Game.GetActiveTeam();
	local bIsDebug = Game.IsDebugMode();

	for iPlotLoop = 0, Map.GetNumPlots()-1, 1 do
		pPlot = Map.GetPlotByIndex(iPlotLoop);
		if (pPlot:GetVisibilityCount() > 0) then
			pPlot:ChangeVisibilityCount(team, -1, -1, true, true);
		end
		pPlot:SetRevealed(team, false);

		pPlot:ChangeVisibilityCount(team, 1, -1, true, true);
		pPlot:SetRevealed(team, bIsDebug);
	end       
	return true;
This could probably be modified for use on seeing eye glyph. Unless it does not reveal GP correctly you could use a spiral iterator (i see you have whowards plot iterator in your lua files) around the plot where the glyph is cast and reveal it (it stays visible from turn to turn) then reverse visibility if glyph is dispelled.

EDIT : BTW you probably have your "know world spell"

I think i got something that does work. I edited EaSpells.lua, spcecifically the finisher for seing eye glyph to include methods from the debug function (in the spoiler)
Code:
Finish[GameInfoTypes.EA_SPELL_SEEING_EYE_GLYPH] = function()
	g_plot:SetPlotEffectData(GameInfoTypes.EA_PLOTEFFECT_SEEING_EYE_GLYPH, g_modSpell, g_iPlayer, g_iPerson)	--effectID, effectStength, iPlayer, iCaster
-- R.K. modified here to test lua method
	local range = Floor(g_modSpell / 5)
	print("setting visibility for plots within range "..range)
	local team = Game.GetActiveTeam();
	g_plot:ChangeVisibilityCount(team, 1, -1, true, true);
	g_plot:SetRevealed(team, true);
	print("plot done")
	for radius = 1, range do
		for plot in PlotRingIterator(g_plot, radius, 1, false) do
			plot:ChangeVisibilityCount(team, 1, -1, true, true);
			plot:SetRevealed(team, true);
		end
		print("ring "..radius.." done")
	end
-- /R.K.
	if g_iPlayer == g_iActivePlayer then
		UpdatePlotEffectHighlight(g_iPlot, 2)
	else
		UpdatePlotEffectHighlight(g_iPlot)
	end
	UseManaOrDivineFavor(g_iPlayer, g_iPerson, g_modSpellTimesTurns)
	return true
end
I havn't got a failed glyph with this. I can see AI GPs. I know by experience that this will probably also reveal hidden resources. No, it does not reveal resources you don't have the tech unlike ctrl-z so maybe this was another part of the debug code. Looks good if i can dispel them. Will try to find the code for that spell.
No way to remove this right now, but it can probably be done in the dispel glyph finisher. There might be some unexpected interaction with whatever method you used for glyphs as i didn't found it to disable it.
 
I got an error but it was not while casting my modified seeing eye glyph. It was after selecting an embarked druid. The druid did not even put a single glyph.
Code:
[11327.734] InGame: OnInterfaceModeChanged
[11327.734] InGame: oldInterfaceMode: 21
[11327.734] InGame: newInterfaceMode: 1
[11327.734] EaMain: OnCombatResult 	-1	-1	0	0	100	63	966701	16	39	100	-1	-1	0	11	8
[11327.734] EaMain: OnBarbExperienceDenied 	63	966701	-1	2
[11327.734] EaMain: OnCombatEnded 	-1	-1	0	0	100	63	966701	16	39	100	-1	-1	0	11	8
[11327.796] CityBannerManager: CityBanner CombatBegin
[11330.406] UnitPanel: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\EaMain\EaActions.lua:2230: bad argument #2 to '?' (Key must be of type 'number' or 'string'.)
[11330.406] UnitPanel: Stack traceback:
[11330.406] UnitPanel: 1: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\Utilities\EaErrorHandler.lua: 21
[11330.406] UnitPanel: 2: C function
[11330.406] UnitPanel: 3: ? E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\EaMain\EaActions.lua: 2230
[11330.406] UnitPanel: 4: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\EaMain\EaActions.lua: 565
[11330.406] UnitPanel: 5: Tail call
[11330.406] UnitPanel: 6: C function
[11330.406] UnitPanel: 7: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\Utilities\EaErrorHandler.lua: 121
[11330.406] UnitPanel: 8: Tail call
[11330.406] UnitPanel: 9: C function
[11330.406] UnitPanel: 10: C function
[11330.406] UnitPanel: 11: UpdateUnitActions E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\CoreUI_InGame\UnitPanel.lua: 265
[11330.406] UnitPanel: 12: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\CoreUI_InGame\UnitPanel.lua: 1234
[11330.406] UnitPanel: 13: C function
[11330.406] UnitPanel: 14: C function
[11331.531] CityBannerManager: CityBanner CombatEnd
[11346.312] UnitPanel: E:\Documents\My Games\Sid Meier's Civilization 5\MODS\Éa III, Sword and Sorcery (v 5)\EaMain\EaActions.lua:2230: bad argument #2 to '?' (Key must be of type 'number' or 'string'.)
[11354.671] WorldView: WorldView InputHandler 	false
[11354.796] WorldView: WorldView InputHandler 	false
[11354.796] WorldView: InterruptEaAction	0	8
[11355.875] EaMain: Running SerialEventUnitCreated 	0	40962	table: 5B8A4630	273	0	93	table: 5B8A46A8	table: 5B8A46D0	2	2	false	true	true
[11355.875] EaMain: Actual unitTypeID = 	196
Here is the full log

EDIT : Oh, i've just found hotfix b. Sorry, this was with hotfix a, but i don't see anything about embarked GPs in the changelog for hotfix b.
 
I'm almost certain Pazyrik will tell you it's the usual random civ-naming memory error
Code:
[5823.049] EaMain: SetNewCivName, iPlayer = 0; EaTrait Type = EACIV_ELEUTHERIOS
[5823.049] EaMain: Running OnTeamTechResearched 	0	109	1
[5823.049] EaMain: Changing player civilization to 	CIVILIZATION_ELEUTHERIOS_MAN
[5823.049] EaMain: Scaling image 	TextBox	testbackground_1.17_856x700.dds	2
You can probably get past this error if you reload previous turn autosave and play again (i never had it repeat personally)

Maybe ls612 should add this one to the known issues in the opener (in case people actually read it :p )
 
@Bob Morane,

For the embarked error, open EaMain/EaActions.lua and EaMain/EaSpells.lua. You'll find this line in both:
Code:
if SetUI[eaActionID] then
change to this in both files:
Code:
if not g_bEmbarked and SetUI[eaActionID] then

On the Seeing-Eye code: Thanks! this tells me how to do it. However, in your code you should get rid of your team assignment and replace it with g_iTeam. Your "team" is really team ID for active player (you), so will give you visibility if an AI casts spell. (And the nitpick problem here is that this is really an integer, which, by convention, should be called "iTeam" or "teamID" so not confused with the team object. Yes, I know this is Firaxis code.) But the variable g_iTeam already holds team ID for the caster at this point so no need for you to set it.

The other thing is that I think that you can remove the loop in your code and you only need apply this function to g_plot. The code I added in dll gives you visibility from the plot to proper range (including visibility of invisible GPs) as part of CvPlot::updateSight. However, I think that CvPlot::updateSight doesn't run on its own. It works sometimes because someone else sees plot and that fires the update (giving you proper visibility). What your code is doing is forcing that plot to update. Try it and let me know if it works. If it does then I'll add on dll side with undo code if the Glyph is removed for some reason.
 
I have a bug each turn that suggests gCities may be corrupted. It refers to EaCities, line 954, "city count error". It's getting a bit repetitive to have this whole window pop up every turn, is there something I can do about it?
 
@Opera, post Lua.log.

The game won't "heal itself". There's some bad data there, likely from bug, and it's only going propagate and cause more errors. The only thing you can do is post Lua.log so I can fix bug. Then you will have to go back to save from before error. Also make sure you tell me what version and hotfix you are using (or if you started with one and continued with another).
 
Yes, of course. I attached it here. Though I did play some more, so it's rather big.

The bug was there from the start. I'm using the latest version, v5, and the "b" hotfix.
 

Attachments

Yes, of course. I attached it here. Though I did play some more, so it's rather big.

The bug was there from the start. I'm using the latest version, v5, and the "b" hotfix.
Unfortunately, I can only tell you that the game was broken when loaded. I'd have to see Lua.log from before you restarted Civ5 and loaded game - because that is where the error occurred to corrupt the game data. Usually I can find the error and fix in minutes, but I have to see the initial error.

You're not the first player to have this problem. But I really need a Lua.log from before the restart/reload to troubleshoot this corrupt game data issue. No one has posted one of these for me yet, but I'll keep asking anyway.


@Everyone else, are saves basically working after hotfix b? There was code change in data persistence that should have fixed a particular error - but there is always the possibility that I broke it instead.
 
Back
Top Bottom