[131.47] Unable to start with a World builder Map

Hi Thal

Was thinking that IU first saw any signs of more or less consistent CTDs with VEM when I used version 131.12. I think this was just after you restructured the opportunities abandoning the script for events (opportunities) I helped you with.

I have no idea if its related and no idea if the bug preventing you from starting from a world builder map and the ctd bugs ingame are related.

We discussed the ctd's in 131.12 here:

http://forums.civfanatics.com/showthread.php?t=455201

\Skodkim
 
The opportunity system does not run until at least turn 10, and the issues described in this thread happen on turn 0. Based on what bwoww78 said it sounds like we might be able to narrow down the problem with a divide-and-conquer search: disable vem (works)... disable half of vem (see which half works)... disable half of that half... etc.
 
So if I take v141.2 (or latest) tonight and test a scenario loaded map past, say, 30 turns, would that get past a couple of opportunity thresholds? Assuming standard game pace?

If not, let me know how many and I can start off some compartmentalized testing to help out.
 
When testing I make the opportunities happen every turn. Open up this file:

/CiVUP/Triggers/T_Events.lua

Change this line:
if player:IsMinorCiv() or Game.GetGameTurn() < 20 then

to

if player:IsMinorCiv() or Game.GetGameTurn() < 0 then

Change this line:
local trigChance = MapModData.VEM.TrigChance[playerID] -- (player == activePlayer) and 100 or 0

to

local trigChance = (player == activePlayer) and 100 or 0 -- MapModData.VEM.TrigChance[playerID]
 
Doing (at least a little of) my part to keep as a huge fan to keep VEM train rolling for scenario maps...

All tests conducted with the following mods on the attached test map (variation of tiny earth with all available vanilla natural wonders). I also always cleared the cache, logs and moduserdata folders.

  • VEM v142
  • infoaddict v16
  • civwillard v1

test 1: VEM with modified opportunities lua per Thal guidance.
Spoiler :
result: crash on turn 6

When testing I make the opportunities happen every turn. Open up this file:

/CiVUP/Triggers/T_Events.lua

NOTE: made the changes, but opportunities still never triggered...



test 2: full VEM v142
Spoiler :
result: crash on turn 6. no opportunities witnessed.



test 3: disabled the following folders

  • Diplomacy
  • Terrain
  • Triggers
  • WWGD

Spoiler :
result: crash on turn 8. no opportunities witnessed.



test 4: disabled the following folders

  • Armies
  • Barbarians
  • Cities
  • Leaders
  • Policies
  • Research
Spoiler :

result: no issues through turn 30. completed an opportunity myself and saw in the notifications completion of several others by other civs.


test 5: disabled the following folders

  • Cities
  • Policies
  • Research
Spoiler :

result: crash on turn 4. no opportunities witnessed.


that's all i could get in for now. hope it helps!


EDIT:

FYI: on a hunch i tested again with just Barbarians folder disabled and resulted in crash on turn 8
 

Attachments

UPDATE: the issue is definitely in the Leaders folder. started the same game type as above and got 30 turns with an opportunity and no issues. hope this helps.
 
I doubt it's anything related to opportunities; I think the earlier issues skodkim and I experienced were a coincidence.

The leaders folder is a promising place to start looking. Probably... VEL_Events.lua. If disabling that means no crashes then it's a problem somewhere in that file's code. Thankfully the file is very small so finding the issue should be easy, if it's there.
 
Thalassicus said:
I doubt it's anything related to opportunities; I think the earlier issues skodkim and I experienced were a coincidence.

The leaders folder is a promising place to start looking. Probably... VEL_Events.lua. If disabling that means no crashes then it's a problem somewhere in that file's code. Thankfully the file is very small so finding the issue should be easy, if it's there.

Glad I could do something to help. Hopefully its an easy fix! Thanks again
 
Thanks to bwoww's help, I've tracked the issue down to the "FreeUnitAtTech" function in VEL_Events.lua. I'm now tracing it through the function to see what precisely is the problem.

Update: it appears to be an internal bug with the vanilla "TechAcquired" event. I'm finding a way to work around this issue since I can't solve it directly. I suspect it is a core c++ bug because 1) no error message reports to the lua console 2) it crashes to desktop, instead of crashing the lua environment.
 
Thanks to bwoww's help, I've tracked the issue down to the "FreeUnitAtTech" function in VEL_Events.lua. I'm now tracing it through the function to see what precisely is the problem.

Update: it appears to be an internal bug with the vanilla "TechAcquired" event. I'm finding a way to work around this issue since I can't solve it directly. I suspect it is a core c++ bug because 1) no error message reports to the lua console 2) it crashes to desktop, instead of crashing the lua environment.

glad to help and thanks for putting your attention to it!
 
i'm also having problems loading scenarios with 138.10 loaded. i get to turn 12 or 13 and it crashes, doesn't matter which civ i've selected. the same map/scenario worked fine before with 131 (but now i don't have a copy of 131 to use!).

wanted to make sure skodkim and Core Xii don't feel alone... hoping that VEM can support scenarios in the future (at least by the time G&K comes out)
U can always use it from the civ in game way and it keeps all past versions
 
I think what Jake's trying to say is that if you open up the ingame mod browser, every mod has all past versions available for download. Just click the box with the version number at the top.
 
Thalassicus said:
I think what Jake's trying to say is that if you open up the ingame mod browser, every mod has all past versions available for download. Just click the box with the version number at the top.

Huh i did not realize that, a very smart suggestion, thanks. I have always manually installed mods, so good to know in the future.

(Btw Thal, i haven't tested the new version with your fix yet, but should be able to soon after the weekend. Will update)
 
Thanks to bwoww's help, I've tracked the issue down to the "FreeUnitAtTech" function in VEL_Events.lua. I'm now tracing it through the function to see what precisely is the problem.

Update: it appears to be an internal bug with the vanilla "TechAcquired" event. I'm finding a way to work around this issue since I can't solve it directly. I suspect it is a core c++ bug because 1) no error message reports to the lua console 2) it crashes to desktop, instead of crashing the lua environment.

i've got bad news...

i tried playing and (subsequently tested my previous test map) using a wb scenario with VEM v145 tonight and got consistent crashes within the first 6-12 turns...

i'm sorry that i seem to be bringing up more work to do, but as you can imagine, this is a major bummer...



Thal: would there be a quick fix like just isolating the "freeunitattech" file? there are so many cool new changes to VEM, it'd be a shame not to have them for the scenarios i have in mind.
 
Here you are. I used the same conditions & map as my tests above (cleared catch, etc. and same scenario). this crash was at turn 5. let me know if you need more info or if there's any more i could do.
 

Attachments

[5536.459] Runtime Error: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:1618: attempt to index local 'capital' (a nil value)

[5544.634] TU_Initialize: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:854: Cannot find key - Naval

Not that I understand any of it, but it was interesting to look at.
 
I doubt it's that; scenario maps are working for me now. Could you attach the lua.log file of what happens during the problem?

Hi Thal

Just wanted to say that I'm also able to start from my old scenario. I haven't had time to play much though so I don't know about the CTD's. I have logging on so I'll post any logs if it happens but as you may know from previous bug reports I use other mods as well.

\Skodkim
 
Core Xii said:
[5536.459] Runtime Error: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:1618: attempt to index local 'capital' (a nil value)

[5544.634] TU_Initialize: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:854: Cannot find key - Naval

Not that I understand any of it, but it was interesting to look at.

Agreed. I posted the scenario I'm using to test as well above---maybe the bug is there? I'm actually glad to hear this is seemingly isolated, but then again I have no idea what that log info means.

I'm using Spain in the scenario, if that helps any troubleshooting. Potentially later I can try with another (even more vanilla?) scenario map. Svenn's Europe was going to be my next epic game, but that can wait.

like skodkim, I would like to add additional mods (just additional wonders, native wonders, and ingame editor; all of which had no problems before), but I can live without those until we get this fixed (well, I do include infoaddict and civwillard, which for all intents and purposes could really just be added to VEM in my book).
 
[5536.459] Runtime Error: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:1618: attempt to index local 'capital' (a nil value)
The most common reason for this is a player was placed on a scenario map without a Palace. The game does not automatically add a Palace to scenario-made players, and without it, they have no capital.

The bug is in the vanilla GetCapitalCity function, so I'll replace it with a fixed mod version. (I only recently learned it's possible to replace these.)

[5544.634] TU_Initialize: [string "C:\Users\reedbr\Documents\My Games\Sid Meie..."]:854: Cannot find key - Naval
This one's related to a bug lukeloh reported, which should be fixed for v146. It was attempting to find the "naval" promotion category for swapping out promotions on upgraded units. Naval units can't upgrade to any other type of unit, so I didn't create a category for them. That section of code was running for ships when it should not have been.
 
Back
Top Bottom