Wednesday 11 February 2015

TS2015 - Scenario Scripting in LUA Part 9 - Ending the Scenario Early

Sometimes when a scenario is being played you want to be able to reflect sufficiently bad playing by ending the scenario early.  The game can already do this in some circumstances, for example leaving the firebox door open when you go in to a tunnel or running out of water in the boiler can both terminate the scenario early.

Wouldn't it be great if you could build some of this gameplay in to your scenarios, coming up with unique situations that fit what is going on?

Let's take a previous example - where you're driving along with wagons that have a lower speed limit than the maximum line speed, so you've scripted something that will watch the speed and then stop the train if you do it too much.  It works by first warning you, then by stopping the train - but what's the next level of escalation?  In reality you would be relieved of your duties pending a review and disciplinary action, and the closest thing to that in the game is just simply to end the scenario early and essentially make the player start again and pay more attention next time.

You can end a scenario as a failure

SysCall ( "ScenarioManager:TriggerScenarioFailure", "Scenario failed! Please try again." );

Or you can end it as a success:

SysCall ( "ScenarioManager:TriggerScenarioComplete", "Scenario completed!" );

It's easy to come up with reasons to end a scenario with a failure, though I would certainly caution against using this too much, use it where you really do think the player has done so badly that it is inappropriate to allow them to finish the scenario.  Think of it as an "ultimate penalty" and you absolutely should have a multi-level approach to this including warnings, don't just bang them out, that makes for a frustrating experience and they're unlikely to come back for another go.

However, ending a scenario early as a success? What on earth is going on there!

There are fewer uses for it, but there certainly are some potential uses.  One example is that you could set up a career scenario which has you run along a line and you mark out 5 stops each worth 200 points.  During the initial journey for these first four stops, you have some background script checking the performance of the player, perhaps you track how many seconds are spent overspeeding, or if they over-drive the engines by pushing the ammeter in to the red and track how many seconds they do that.  When the player then arrives at the fourth stop, you then make a decision.  Has the player done well?  If they have not, then end the scenario early with a success.  They have now technically finished the scenario but they cannot possibly access a gold medal.  If they have done well, then don't end it, let them complete the journey to the final stop and receive the additional points.  In this way, you're actually limiting the possible score (and medal) that the player can earn based on wider driving attributes and skills than simply their ability to not speed and not be late, but they're still actually able to get a medal/tick even if they're not doing very well.

Those are some simple ideas, I leave it to you to come up with some more interesting gameplay concepts and i'm looking forward to seeing what you can come up with!





No comments:

Post a Comment