

String _button = "ToolbarDialog:transport" // wait for transport to be pressedįinally I needed a way to display information to the user explaining what they should do. Once the goal is met the tutorial moves onto the next step.
#Banished cheats and codes code#
Again this was done without adding code to any real game system - everything is limited to the tutorial system. Int _speed = 1 // set game speed to normal.īool _forcePlay = true // force the game into the run state if it was paused.Įach tutorial step also has a goal - what should the user have to do for the tutorial to proceed? Press a button? Place a house? Set a certain number of workers? The tutorial system has a bunch of different goals it can wait for - they all just monitor the state of the game. There are also other setup items that can occur, like changing the speed the game runs at. String _highlight = "ToolbarDialog:transport" ĭialog _highlightDialog = "Dialog/TutorialHighlight.rsc" highlight the transport button with standard arrow and highlight "ToolbarDialog:options" // allow options button so user can save/load/quit "ToolbarDialog:transport" // allow toolbar 'transport' group to be pressed

The setup for what UI elements are available looks like this. The configuration for the tutorials works the same way as all my other data serialization. I also added the ability to add an overlay dialog to highlight any widget so the user would know on screen where things are.

Once that system was in place, the tutorial can disable all widgets except for a few buttons per step. This allowed all UI code to proceed normally without knowledge that the tutorial is occurring. So instead I built the tutorial system to just disable all UI widgets with a special flag that only the tutorial uses. I didn't want to inject any tutorial code into the main UI code - that's just messy coding and bug prone. In most tutorial steps the player should only be allowed to only press one button, or place one object. There are lot of buttons and widgets that the player can fiddle with. The first issue I dealt with in trying to do this is that Banished has so much user interface. Given that, the tutorial needs to be a predictable experience where the player can't get anything wrong. They could try to build a stone house instead when there isn't any stone available. If you say, 'Place a Log House' and let the player pick the location, they could place in a location where the townsfolk can't get to it. There are way to many things that can go wrong if the tutorial gives the player freedom. In addition, anything the player is allowed to do that isn't part of the tutorial shouldn't invalidate anything in the tutorial. Whatever they do, the next tutorial step has to be valid as well. If you tell the player to do something, you have to make sure they can actually do it, and do it without error. There is a hard issue to deal with tutorials in a city builder or RTS. Implementing them has been a typical round of designing something, getting halfway through it, and realizing there is a better way I could be doing it. Given that, there's very few systems that I needed to write for Banished that I hadn't had any exposure to at all.

You talk over algorithms with other programmers, make sure your systems work well with others, and help fix all sorts of bugs near ship time. After working on consoles for a long while, you get to know the all the systems in a game engine - even ones you don't actively work on.
