I recently took up playing/learning the subsim game Sub Command by Sonalysts Combat Simulations but only got three missions into the campaign when I hit a snag, I couldn't finish a mission successfully even though I had fulfilled all the mission criteria. So I did a Google search for the same problem and found there were a lot of other players with the same problem. Unfortunately there didn't appear to be a fix even though patch 1.05 was supposed to have addressed the problem. I even found a forum entry from one of the developers who said there was a problem with the goals system on this mission and that was what had caused Sonalysts to adopt scripting for the missions in their next game Dangerous Waters.
Anyway, the most up to date information I had was from 2007 (the game came out in 2001) and the bug was still not fixed as far as I could tell. So I decided to see if I could fix it - I used to do software support for a living but had never poked around a video game before and here was the perfect opportunity since Sub Command comes with a mission editor.
If you've come across this whilst searching for a solution to the same problem then you'll probably know some of the basics and you can skip to the solution at the end, for the rest of you I will wax lyrical about what to do and why - and the reason I'm posting it here is just as an example of applying some basic critical thinking and scientific methods to a pretty simple case. You don't have to be solving one of the great issues of our time to think logically and clearly!
OK, mission three of the Seawolf (and all of what follows also applies to the 688i campaign as well I think, although the mission design is somewhat different and I haven't tested it yet) campaign in Sub Command is to sneak up on a Russian Udaloy which is going to test fire a new SAM at a remotely controlled target drone (an Airbus A300 in the game). Close to within three miles by 11:28am, raise the periscope, watch the missile launch, take a photo, wait two minutes, mission complete. Only the mission complete bit wasn't happening for everybody. Well, almost everybody. I came across a couple of people who said that they had finished the mission, and a couple who had said that success seemed to be when the missile hit first time. Every time I had played it so far the Russian ship had launched two.
My first thought was that this was time related since the first missile appeared to be firing at 11:27 game time. So I figured I had to alter the time in the mission goal and then it would work. Only I couldn't load the campaign game into the Mission Editor. Looking at the scenario folder in the Sub Command directory I noticed that the user edited missions had a file extension of '.mu' and what I assumed to be the campaign missions had a file extension of '.mc'. So I took a copy of the file MissileTestSW.mc and renamed it to MissileTestSW.mu and sure enough I could now load it in the mission editor. If I had read more of the forums on mission editing more carefully during my research I would have been saved some time since this is apparently well known in the modding community for this game. Doh. Always do your research carefully!
Then I played around with the mission editor until I got the hang of editing goals and finding the edited mission. The goals in question are goals 13 and 14 for this mission, both labelled Observe Missile Test (which one you have to complete depends on whether or not you were detected in campaign mission 2). I wasn't detected so figured out after running some debugging missions (I added some messages to goals to say which ones were being completed so I could find out which enemy ships I was facing, so I could find out which goal I had to play around with to get the mission to complete). Goal 14 was the one that wasn't completing for me. So I changed the start time of the goal to before 11:27 and figured I'd be good.
Tested the edited mission. Still didn't work.
Maybe it was the radius around the mission goal. Nope.
Maybe the goal precedence? Nope.
Max/min depth or speed? Nope.
After many frustrating test missions where I played around with all sorts of settings I finally remembered the fact that some people said it worked when the first missile hit. So I focused on that - why wasn't it hitting? Eventually I figured out that the first missile was out of range of the target when fired. The first missile was being fired when the A300 first enters the Udaloys radar coverage (I think) but well outside the range of the SAM, so it ran out of fuel almost everytime it was fired and didn't hit the target. I concluded that maybe the goal was somehow tied to the first missile in programming I didn't have access to through the mission editor. So I figured that if I altered speeds on all the elements concerned I could arrange it so that the Airbus would be hit by the first missile. It wasn't easy to do but I did it.
And it still didn't work.
I was almost at the point of giving up and was looking for a database editor I could use to fudge the range of the SAM so that it would hit the A300 when I came across the Doctrine Language - this is the language the developers use to fine tune the dynamic campaign missions in Sub Command. As mission editing software goes it is pretty powerful. But you don't have access to it by default, which is why it took me so long to find it. Anyway, for those of you who don't know this is how you get access to the Doctrine Language (which I found out about through fan site subguru.com):
In the SubCommand folder of the installation there will be a file called editor.ini provided you have made and saved at least one user created mission in the mission editor - just create something with one ship, save it and the file will be present. Open editor.ini and it will look something like this:
[FILE] "Test timingSW.mu"Now add a new line after the last one that reads:
[FILE] "Copy of MissileTestSW.mu"
[FILE] "testing doctrine MissileTestSW.mc"
[FILE] "fixed doctrine MissileTestSW.mu"
[FILE] "testing doctrine MissileTestSW.mu"
[FULLOPTIONS] 1There is a space between the 1 and the last square bracket. Save the file and go back into mission editor, you will have access to the doctrine language AND you will now be able to load and edit campaign missions without having to go through the process of changing the file extensions.
Stay with me, almost there.
So now you could look at the fine detail of goals in the missions, and here is where I found what was wrong. To view the Doctrine Langauge for a particular goal select the goal, then go to page 2 of its properties. Select the Tick Box that reads Use Doctrine Language then go to page 3, you'll see the doctrines set for that particular goal. It is basically a crude macro system that allows you to set conditions to be met before the goal you are editing can be completed. For goal 14 this read as:
IF (CompletedGoal MissileTestSW.mc Goal 5: Start Collecting Data)
AND (CompletedGoal MissileTestSW.mc Goal 15: Kill Airbus 1)
AND (TimeSinceGoalTriggered MissileTestSW.mc Goal 15: Kill Airbus 1 > 00:00:02)
All of which is macro speak for if goals 5 and 15 have been completed, and two minutes has passed since goal 15 was completed, then goal 14 can be completed if all the conditions associated with goal 14 have also been met.
And here's the problem:
You approach with your sub within 3 miles of the Udaloy satisfying mission goal 5 by about 11:22 let's say.
Raise your periscope at 11:26ish and observe the Udaloy.
First missile fires at 11:27 and approx 30 seconds.
It flies for a bit and misses.
Time is now roughly 11:28.
Some time passes and second missile is fired, this time hitting the airbus and killing it, satisfiying goal 15.
Time is now approaching 11:29
Two minutes pass since goal 15 is satisfied, time is now 11:31 and goal 14 can be triggered.
The end time set for goal 14 on page 2 of its parameters is 11:30.
The mission parameters mean that unless the first missile hits the A300 goal 14 cannot be triggered successfully. But the first missile won't hit the A300 9.5 times out of 10.
I changed the end time of goal 14 to 11:32, saved it as the campaign mission and played through it and lo and behold the bloody thing worked. Only took me a week.
So there it is, the solution to the well infamous (in certain circles) Sub Command Missile Test mission problem.
And the slightly relevant to this blog bit is...?
Work up a hypothesis that you think explains your observations, test it. If it doesn't work refine it and throw out what failed. Test again. Repeat until successful. Then test it again. Then open it up for peer review and have others test it. If they can't replicate, find out why and then go back to the start. Well, go on then.
Let me know if this works/doesn't work for you.