Mission 6 - Fields of Death Crashing

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Mon Jan 31, 2011 9:11 am

Your new version still crashes, files send to your email.

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Tue Feb 01, 2011 1:21 am

Thanks a ton for all of this testing guys. Have not been able to isolate exactly what is causing the game to do this other than some sort of problem with reading .mem files which results in a null plan node. At least we have eliminated a lot of stuff with the testing.

So at least this does not look like a scripting issue. Nor does it appear to be an issue with a .mem file for a single ship class. As I have mentioned in prior posts, it is really weird how this always affects some people only in this particular mission and others are unable to reproduce.

It is interesting that your first time through works and then other attempts crash. Not only that but it is repeatable behavior according to your reports. I do not find this coincidental and sure that there is something odd behind the scenes.

As I just mentioned, I find it odd that this happens with this mission in particular. This is what I am going to focus my troubleshooting efforts on now. I am going to see if perhaps a single AI command is bugged. This will be easy to determine if that particular instruction is used only in mission 6. If I can isolate it to a single instruction then the work-around would be to use a similar AI command that would achieve close to the same results. However if the crashing is a result of a common AI instruction used throughout the campaign then this will be much harder to prove.

Will see where this gets me and let you guys know what happens!
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Tue Feb 01, 2011 1:46 am

OK, now I feel stupid. Should have noticed this all along since we have had the neat logging function provided by KOMAT and the great logs you guys have been providing.

The script is failing on the following error:

Code: Select all
KA:0:MemoryFile::ReadFromFile pathname ships\FCC filename FCCKCCP
KA:0:Reading file ships\FCC\FCCKCCP.mem
KA:0:(4) Something wrong reading memoryfile - exiting MemoryFile::ReadFromFile with failure
KA:0:New MemoryPlanNode created for node FastOrbitAttackPlan
KA:0:New MemoryPlanNode created for node CircleBehindEnemyPlan
KA:0:New MemoryPlanNode created for node MainFightPlan
KA:0:MC:   Chosen plan is CircleBehindEnemyPlan for agent USS Salad Czar
KA:0:USS Ranger ordered to attack IKS TammoHchal
KA:0:USS Ranger given plan FightPlan
KA:0:Plan FollowTargetShipDuringInSystemWarpPlan for USS Ranger deleted
KA:0:Plan FollowTargetShipDuringOutSystemWarpPlan for USS Ranger deleted
KA:0:ERROR: no plan selected below node FightPlan
KA:0:Error EPG004a: null current node found at plan node FightPlan.


Now we have been suspecting the memory file read error for some time now since it has appeared in every case. I just finally noticed the naming of that particular .mem file as FCCKCCP.mem. It just came to me that the naming of these memory plans are prefixed by the attacking ship and suffixed by the defending ship.

Knowing this the Ranger was ordered to attack the IKS TammoHchal, which is defined as ship class shpPOKTARL in the script. According to the SHPCLASS.SSI file in KALIB this is a KCCP class cruiser.

So putting this together we were actually not too far from the actual problem when we went and changed the Federation ship class. I should have changed the Klingon ship class since there is something wrong with the .mem file for Poktarl's ship class. I am not sure if this particular .mem file is missing or simply bugged. In any event this explains a lot. Poktarl's ship probably does not appear to be attacked in many of the missions except for mission 6.

I will put together another version of the script that replaces that ship with another class and we can see what happens there!
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Tue Feb 01, 2011 1:59 am

Mission with Poktarl's ship class changed can be downloaded here
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

Dater
Elite Warrior
Elite Warrior
 
Posts: 212
Joined: 23rd Jun 2003
Location: Germany

Postby Dater » Tue Feb 01, 2011 5:36 am

I didn't finish mission 2 yet, but I have high hopes I will arrive at mission 6 eventually! ;)

It still was very interesting to read up on your progress! Really good team work!

Now, where do I need to put this file, assuming we are in the KA directory?
Dater: "Yeah, Teeth. Thanks for pushing me into a black hole!"

Image

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Tue Feb 01, 2011 6:26 am

Dater wrote:Now, where do I need to put this file, assuming we are in the KA directory?


The k06x.int file should go into your KA scripts folder. Scripts is a folder under the main KA directory. If you have a stock install you will have to create this folder and then place the file into it.

Thanks for your help in testing this!
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Tue Feb 01, 2011 11:47 am

No changes in your new script. I think I now know what's causing the error.

First look again here:

KA:0:Regula 1 Science ordered to spin and shoot
KA:0:Regula 1 Science given plan SpinAndShootPlan
KA:0:USS Salazar ordered to attack IKS TammoHchal
KA:0:USS Salazar given plan FightPlan
KA:0:Plan FollowTargetShipDuringInSystemWarpPlan for USS Salazar deleted
KA:0:Plan FollowTargetShipDuringOutSystemWarpPlan for USS Salazar deleted
KA:0:MemoryFile::ReadFromFile pathname ships\FCA filename FCAKCCC
KA:0:Reading file ships\FCA\FCAKCCC.mem
KA:0:ERROR: no plan selected below node FightPlan
KA:0:Error EPG004a: null current node found at plan node FightPlan.
HW:Deinitializing DX9 emu

----CRASH HERE----


The error is caused because the AI of the USS Ranger is ordered to attack the IKS TammoHchal with "FlightPlan" but the IKS TammoHchal is not yet actual in the system!

I now confirmed that something changed if you shut down your pc completely and and wait to get the RAM deleted (at least I suspect sth. with the RAM, maybe Win 7 Prefetch system (which happens to store also ka.exe for faster restart / tried to delete it from %windir%/prefetch but with no effect)). I turned off the motherboard current complete for only a restart wouldn 't do the trick and the crash came immediatly in the first run. So if you cut power and do a system reboot you get NO crash doing mission parameter start > Janus system > Regulas system because THEN the IKS TammoHchal warps in FASTER/EARLIER and when USS Ranger (or other ship) declares an attack order the FightPlan can be handled normally.
If you get this in the log the warp in is completed succesfully and no crash occuring:

KA:0:AFTERWARPIN CALLED FOR IKS TammoHchal
KA:0:in warp complete callback

So I made more tests and switched the target list to friendly ships to see what the IKS TammoHchal is doing at my warp in in Regulus system. After my warp in I switched fast to IKS TammoHchal and could see that
1. if I run the test right after a pc bootup (first run of a session) the IKS TammoHchal was at 70-90k from me and not in warp / or gotten out of warp very quickly (before the AI could give the attack order)
2. if I run the test in a second ka start (of a session) the IKS TammoHchal is STILL in warp (like 100-400mk and dropping) and the crash occurs at that point. This seems in agreement with the logs that show no AFTERWARPIN CALLED event then.

In conclusion, I think it might be possible to fix this crash by giving the AI (IKS TammoHchal and their wingmates) more time in the script to warp into system AND/OR the

KA:0:IKS TammoHchal ordered to wait to attack until enemy gets within distance 100000.000000
KA:0:WARNING!!!!! IKS TammoHchal given plan WaitPlan frame 4584 while warping (plan queued to next frame)!!!!

flag is missing in this part of the script and must be added, so that the attack event on IKS TammoHchal can be queued up for when the AFTERWAPIN CALLED event is finished (not sure if that's possible in this way).

On a next note, I think the developer's plan here first was to let the mission play without the help of IKS TammoHchal and co. in the Regulus system IF you go first to Janus but somehow they screwed up and the the IKS TammoHchal comes in anyway. They probably oversaw this event chain or didn't have the time to fix it.

Hope this helps.

teeth_03
Order of Kahless
Order of Kahless
 
Posts: 3073
Joined: 2nd Jul 2003
Location: Somewhere in the Matrix

Postby teeth_03 » Tue Feb 01, 2011 2:27 pm

well,I just figured something out

using the stock script,if you wait for the other klingon forces in janus to warp out first, they will be in Regula before you therefore it wont crash

at least for me anyway

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Tue Feb 01, 2011 5:08 pm

what other klingons?

teeth_03
Order of Kahless
Order of Kahless
 
Posts: 3073
Joined: 2nd Jul 2003
Location: Somewhere in the Matrix

Postby teeth_03 » Tue Feb 01, 2011 6:53 pm

Poktarl and his escorts

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Tue Feb 01, 2011 7:15 pm

ok this might be true, but consider that I ment the version where you warp first to janus and then to regulas hence no poktarl there. in your version of events this is right though (I got this crash when right now when trying to play the campaign). But in this case you get a slight different error:

KA:0:AFTERWARPIN CALLED FOR IKS Lon Tul
KA:0:in warp complete callback
KA:4:SCRIPT DEBUG: k06.SSL(1374): OnShipPostWarp...
KA:4:SCRIPT DEBUG: K06Sys4.ssi(532): Regula : Post Warp... IKS Lon Tul
KA:4:SCRIPT DEBUG: K06Sys4.ssi(551): Regula : Post Warp...Done
KA:0:WarpCleanup CALLED FOR IKS Lon Tul
KA:0:Deleting CameraFollowPlan for External Camera
KA:0:IKS Lon Tul given plan AIGunnerPlan
KA:0:IKS Lon Tul given plan AIGunnerPlan
KA:0:ERROR: no plan selected below node FightPlan
KA:0:Error EPG006a: null current node found at plan node FightPlan.
HW:Deinitializing DX9 emu

Error EPG006a instead of Error EPG004a

teeth_03
Order of Kahless
Order of Kahless
 
Posts: 3073
Joined: 2nd Jul 2003
Location: Somewhere in the Matrix

Postby teeth_03 » Tue Feb 01, 2011 9:54 pm

why would you warp to janus first though? That fails a secondary objective

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Tue Feb 01, 2011 10:10 pm

because that was the only combination ob the events that got me an error in the first place (at that time)

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Wed Feb 02, 2011 5:10 am

Play, that is an exquisite test report. The prefetch analysis is very interesting and would explain exactly what you describe. It is possible that events are happening before they are intended and result in AI commands being issued at the wrong time.

This can be easily corrected. I can simply have the AI wait to attack until targets are within a specific range or create a flag that forces the operations to happen when the post-warp handler has already been executed for those target ships.

You are also most likely correct about getting the extra help from the IKS TammoHchal when events are done out of order. I have seen other things that are not working correctly when the player chooses a non-linear path through the script such as the cloak/decloak detection of the player when they reach the Regula system.

I will explore these options and make another version soon. Currently I am mired in a bunch of oncall issues with work :(

Thanks again for the detailed analysis from you and all of the others that have participated in the testing!
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Wed Feb 02, 2011 8:44 am

Ok as teeth and others already reported the error also occurs if you make the normal mission run to the janus system and then warp out to regulus before colonel poktarl does. In this case however, it happens all the time even in the first ka start of a session!

So from my point of view there are now two mission event combinations where the error is reproducable:

1. start > petrus system > janus system > regulas system. if you don't wait for poktarl to warp out first you get an ka error. this is reproducable and happens in every case even if you start ka the first time in a pc boot. you get Error EPG006a!

2. start > janus system > regulas system. in the janus system poktarl isn't there so yo can go to regulus. at regulus both secondary mission objectives fail but you are allowed to proceed with the mission. mission runs through the first ka start of a new pc boot but crashes every try after in the same pc session. you get Error EPG004a!

Not sure with the prefetch because of my testing and ofc it also crashed on systems without prefetch. we should concentrate on making sure the AI warps in quicker or that the attack plans to those AI get issued later.

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Sat Feb 05, 2011 4:24 am

New version can be downloaded here

I changed the routines for friendly and enemy AI commands in the Regulas system so that they are executed only after a 30 second delay. I am hoping that this is enough of a delay to avoid the script issuing AI orders to ships that are still warping in.

Let me know how this version works. Thanks!
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

Play
Warrior
Warrior
 
Posts: 167
Joined: 19th Dec 2004
Location: Berlin, Germany

Postby Play » Sat Feb 05, 2011 5:54 pm

Ok this now works, but there might be the need of a bit fine tuning, better try like 15-20 seconds, because now the poktarl's lead ship stand a bit still in space after warp in until the feds are close to him. also if going to petrus system not killing the feds going to janus and then to regulus might give the situation where the feds from petrus system warp in also at regulus since they haven't been killed before. But good work!

RedHotChiliDog
Field Marshal
Field Marshal
 
Posts: 2742
Joined: 14th Nov 2000
Location: Gahanna, Ohio

Postby RedHotChiliDog » Sun Feb 06, 2011 7:30 am

That is outstanding! I am glad that this change was able to prevent the crash from happening. Thanks Play and the rest of you for your help in isolating this particular bug since I was unable to reproduce it on my setup.

Play, as you had mentioned this will need a bit of cleaning up before it is final. Wanted to do the quick change to make sure that it would have the intended impact but there are definitely cleaner ways of coding this than the way I used in the test script. Will work on getting that completed for final patched version of mission 6. In the meantime if anybody is crashing on this mission then the current version linked in my prior post may help you get past the mission until I get a cleaner solution coded.
RedHotChiliDog

Klingons and Potato Chips are better with ridges.

brianmoler.com - Mission scripting and other strangeness

Dater
Elite Warrior
Elite Warrior
 
Posts: 212
Joined: 23rd Jun 2003
Location: Germany

Postby Dater » Mon Feb 07, 2011 8:53 pm

Great to know I can safely advance in the story line! Thanks guys! :) I am still at mission 3 haha
Dater: "Yeah, Teeth. Thanks for pushing me into a black hole!"

Image

Dater
Elite Warrior
Elite Warrior
 
Posts: 212
Joined: 23rd Jun 2003
Location: Germany

Postby Dater » Wed Feb 09, 2011 9:36 pm

OK I got to mission 6 today. Didn't experience any crashing yet (although I didn't even use the new script)

But I have to say, that is one hard mission! I always fail to protect the Mobile Base Cargo Ship... I really hate the three miranda's ability to launch two aft photon torpedoes!

Too bad nobody could join and help me out haha!

Any hints for defeating the miranda's?
Dater: "Yeah, Teeth. Thanks for pushing me into a black hole!"

Image

PreviousNext

Return to Mission Scripting