White Shining Rock Logo
White Shining Rock Logo

Tutorials & Achievements

October 10, 2013 | Dukus | 108 Comments

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. 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. Given that, there's very few systems that I needed to write for Banished that I hadn't had any exposure to at all. These past few weeks I've found two. Tutorials and Achievements. 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.

TutorialWASDThere is a hard issue to deal with tutorials in a city builder or RTS. If you tell the player to do something, you have to make sure they can actually do it, and do it without error. Whatever they do, the next tutorial step has to be valid as well. In addition, anything the player is allowed to do that isn't part of the tutorial shouldn't invalidate anything in the tutorial.
There are way to many things that can go wrong if the tutorial gives the player freedom. 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. They could try to build a stone house instead when there isn't any stone available.

Given that, the tutorial needs to be a predictable experience where the player can't get anything wrong.

The first issue I dealt with in trying to do this is that Banished has so much user interface. There are lot of buttons and widgets that the player can fiddle with. In most tutorial steps the player should only be allowed to only press one button, or place one object. I didn't want to inject any tutorial code into the main UI code - that's just messy coding and bug prone. So instead I built the tutorial system to just disable all UI widgets with a special flag that only the tutorial uses.

This allowed all UI code to proceed normally without knowledge that the tutorial is occurring. Once that system was in place, the tutorial can disable all widgets except for a few buttons per step. I also added the ability to add an overlay dialog to highlight any widget so the user would know on screen where things are.

The configuration for the tutorials works the same way as all my other data serialization. The setup for what UI elements are available looks like this.

TutorialUISetup enabletransport
	String _exclusions
		"ToolbarDialog:transport"  // allow toolbar 'transport' group to be pressed
		"ToolbarDialog:options"    // allow options button so user can save/load/quit

        // highlight the transport button with standard arrow and highlight
	String _highlight = "ToolbarDialog:transport";
	Dialog _highlightDialog = "Dialog/TutorialHighlight.rsc";
	int _highlightRotation = 0;

There are also other setup items that can occur, like changing the speed the game runs at.

TutorialChangeGameSpeed normalspeed
	int _speed = 1;     // set game speed to normal.
	bool _forcePlay = true;  // force the game into the run state if it was paused.

Each 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. Again this was done without adding code to any real game system - everything is limited to the tutorial system. Once the goal is met the tutorial moves onto the next step. A typical goal looks like this:

TutorialGoalButtonPress goaltransport 
	String _button = "ToolbarDialog:transport"; // wait for transport to be pressed

Finally I needed a way to display information to the user explaining what they should do. This is a simple dialog with some text and images on it. The setup for this looks like so:

// grabs the icon from the toolbar for display in the tutorial window
TutorialImageToolbarIcon icontransport : "baseIcon" 
        Toolbar _toolbar = "Game/Toolbar.rsc:transport"; int _locationX = 0; int _locationY = 0; 

// hotkey images read from user input map so it always shows the current key
TutorialImageHotKey hotkeytransport : "baseKeyPress" 
        Toolbar _toolbar = "Game/Toolbar.rsc:transport"; int _locationX = 2; int _locationY = 0; 

TutorialStep stepPlaceRoad0 : "baseStep"
	bool _isSafeRestart = true;  // safe resume point if returning from a save game
	StringTable _stringTable = "tutorialStrings";  // all strings for the tutorial

	String _preText = "Step_Road_0_Pre";  // text to display before the images
	String _postText = "Step_Road_0_Post";  // text to display after the images

	TutorialGoal _goals [ "goaltransport" ]   // list of goals
	TutorialSetup _setup [ "enabletransport", "normalspeed" ]  // list of setup items
	TutorialImage _images [	"icontransport", "or", "hotkeytransport" ]   // list of images

After all that setup, what do we get? A step in a tutorial that waits for a button press!

The only other major thing I had to add was a way to show the user where to place things, and not allow them to place them in any other location or orientation. Unfortunately this did require some code added to the system that allows the user to place something - it has to know if it's in a 'restricted' mode where the current item has to be placed in a specific location. It also resulted in nicer placement footprints that show building orientations and where roads can overlap the building area.


The process of building the tutorial is slow - mostly in testing and deciding what things to cover and in what order. I've got the first 'Getting Started' tutorial finished - it shows the basics of survival, building things, and basic resource production. I'm planning on doing a few more tutorials on the different methods of food production as well as long term survival. These tutorials show how to play, but really won't give away any best way to play. There's more than one, and that's for the player to twiddle with.

So with the tutorial system out of the way, I turned to finishing the achievements.

AchievementsWhether you love them, hate them, or use them to show off your gaming prowess with your friends, Achievements seem to be an integral part of games now. In some ways they've always been there - just not formalized. For me, finding a room full of goodies and then and seeing only 34% of secrets found at the end of a level made me play Wolfenstein3D levels over and over and over. I generally only try to get 100% of achievements in games I really like - where the extra gameplay time isn't a grind.
Like the tutorial, the achievements are setup so that they don't interfere with any actual game code, they just monitor the state of the game and keep their own state.

I've tried to keep the achievements for Banished reasonable, but also make them things that aren't likely to happen except when you build big cities and do a good job while doing so.
Here's what the setup for the achievement looks like - very similar to tutorials, but with different goal types. This particular achievement requires a certain amount of food be produced in a single year by every type of food production building.

Achievement foodie : "AchievementList.rsc:achievement"
	String _sprite = "AchieveFoodie";
	String _text = "Foodie";
	String _description = "FoodieDesc";

	Goal _goals [ "hunter", "gatherer", "fisherman", "pasture", "cropfield", "orchard" ]

StatGoal base
	StatType _stat = ProducedFromBuilding; // count total produced from buildings
	StatOp _op = GreaterEqual;
	int _count = 2000;  // must get 2000 for achievement to be met
	RawMaterialFlags _rawMaterial = Edible; // only count edible items

StatGoal hunter : "base" { WeakExternal _object = "Template/HunterLodge.rsc"; }
StatGoal gatherer : "base" { WeakExternal _object = "Template/GathererShelter.rsc"; }
StatGoal fisherman : "base" { WeakExternal _object = "Template/FishermansDock.rsc"; }
StatGoal pasture : "base" { WeakExternal _object = "Template/Pasture.rsc"; }
StatGoal cropfield : "base" { WeakExternal _object = "Template/CropField.rsc"; }
StatGoal orchard : "base" { WeakExternal _object = "Template/Orchard.rsc"; }

Here's an image of me testing this achievement, and nearly filling the screen with the UI.

The second worst part about all these achievements is making an icon that goes with each achievement and somehow represents what it is. It took at least an entire work day to make 36 icons that I was pleased with. The actual worst part of achievements is testing them.

A lot of the achievements have population requirements or time requirements. For example, one achievement is to maintain high health for a population of more than 200 people over 10 years. For most people this is somewhat likely to happen as you play, but getting there is tough. You can build a town of 200 people in maybe 5 hours (if no disasters occur and you're familiar with the game already.) Then maintaining the health of those people for ten years takes at least another hour if the game is running at fastest speed. Now do this for all the achievements....

My guess is that to truly test all the achievements would take me more than two weeks of nonstop play. Instead I've been testing them using cheats. Being the developer, I can build things with no resource cost, disable health and warmth concerns, and get people to survive without homes. I can add resources and unlock things you normally have to trade for. This really speeds things along and makes the goals for the achievements attainable in a reasonable time. However when I do use the cheats, I try to cheat in a way that makes sure to validate the attainability of the achievement. Even with the cheats, getting 100% of the achievements took about 11 hours. With cheats! Phew!

For those of you that noticed it in the image above, no I'm not planning on having that 'Debug' dialog available in the final version of the game, and yes you can switch the temperature display to Celsius. And if the overhead map area looks small, that's because I'm playing on a small map. πŸ™‚

So what's next? Not sure. My schedule has fewer and fewer items on it each day! Am I actually coming to the end of development!? Sweet!

Leave a Reply

Your email address will not be published.

108 comments on “Tutorials & Achievements”

  1. I have only one comment.... WHEN CAN WE PLAY!!!! Actually this looks great so far, and I'm very excited for the release version. Keep being awesome. πŸ™‚

  2. Always excited to see a new update! Beyond just this game, I'm excited about the future of this (one man) company!

  3. Shut up and take my money!

    Or rather...keep the blog updates coming. For a non-programmer, this is fascinating stuff and I could not be more hyped for your game. Keep it up!!

  4. Will these achievements integrate with Steamworks or steam achievements? Personally really enjoy looking through what I've completed compared to everyone else.

  5. Hey, been a silent watcher for several weeks now and I must say I am impressed, I posted about the game over at a forum I'm an admin on and I know some people there are interested in the game. So looking forward to the game when it comes out. Keep up the amazing work!

  6. Please, there is one more way to move the camera that you should take in consideration. (Used for example in every C&C game)

    You keep right-click and start to move the mouse. The camera will move in that direction. The farther the mouse goes the faster the camera moves.

    This is one of the way to move the camera. Please take it in consideration

  7. I've been lurking around for some time and just wanted to say: "Keep up the good work and don't be afraid to ask a fair price for this game! I'm sure most of us will pay a fair amount for it. Maybe you should contact some expert to see which price margin renders the most profit.

    We all want you to make a proper profit so you can go keep on doing what you are doing!

  8. As a person who loves to tinker, I'd love it if you'd leave debug in as an option - maybe you'd have to enable it in a config file, or use it as a launch flag - but being able to dig around in the guts of a game actually prolongs its life for me. (Think "Infinity Machine" TSR in the DOS days that let you edit values in RAM in a running game - that prolonged the life of Star Control 3 a great deal for me!)

    Also - I've never noticed you saying, but - are the maps generated algorithmically, or by hand?

    (I love both options, of course, but each has its definite advantages. Systems that allow both are the best!)

  9. There is another great use of the mouse for panning that I love in the Paradox series – hold the mouse wheel down and drag to pan.

    It's such a simple way of getting around (and if you've played any you'll understand you pan the map of the world constantly!)

  10. Horray for getting closer to launch! I don't know about other people, but I usually blaze through the tutorial to get my hands dirty and enjoy the trial and error of real gameplay. This with the apparent complexity of creating tutorials, maybe just make video walkthroughs for people and keep tutorials to a minimum. But do what you think is best -- it's your game!

  11. Yes, as Wisse stated, a fair price is important. While, of course, you will sell thousands of copies and will be paid well at a $15 to $20 price, I would be more than happy to pay $40 or so for your game. It would give me great pleasure and happiness to support you with a larger sum of cash.

    However, $40 might be too high for the majority of players, so to be quite honest, in order to get this game into the hands of the most people, I would stay under $30 for sure.

    Btw, Luke, you are consistently awesome and I am blown away with not only your development and hard work, but also your meticulous documentation and willingness to publish it for all to see !!

    You are the man !

  12. You might have a problem with using the Function keys (F4 and such).
    They are usually used by recording software but then again, this is no problem if you can re-bind the keys.

    Just wanted to mention it. Love the work you have done and can't wait for it to be released. Really wish I could throw money at the screen and it would get to you.

    Good Luck and don't forget to take a break and have fun sometimes πŸ™‚

  13. Well, SC5 failed, i feel this will win, one person game beats all EA money grabbing idiots any day!

  14. I haven't been this excited for a game in a long time! I really can wait - every post makes me want it more. I will be able to get it in England, won't I?

  15. Looks fantastic, I can't believe we're so close to completion now. It's been an amazing ride. Thank you

  16. That's awesome, that's some major progress!

    By the way, can I proofread for you? I noticed an error. πŸ˜‰

    "move the mouse to the edges of the screen TO move" (you forgot the 'to' where I capitalized it).

    Teasing aside, do have someone proofread it. It always looks a little unpolished to have those errors. On the other hand, it's not a major thing, and I'm super excited about the game! I can't wait!

    I have to wait, I know I have to wait... but I can't wait!

  17. Hey man!

    Your work is just awesome! You've to charge us a fair price, that cover your work and costs, letting yet a profit margin to you, and certainly no one will complain about it. Also, if you need translators, I offer me to translate the game to Portuguese BR.

  18. I like how you are so patient developing and improving the game while there are so many people waiting for you to take their money. Don't hush, we'll be waiting.

  19. Would die to play the game now, but failing that, please do keep those blog posts coming, preferably with AMPLE screenshots and videos -- I find myself repeating them quite a few times, just to satiate my burning desire to play this game!

  20. As everyone else, I'm very excited about this game.

    Could you enlighten us about what is left on your to-do list ?

    If you are getting close, maybe it would be time to start thinking about distributionΒ­.

  21. "Am I actually coming to the end of development!? Sweet!"

    You have NO IDEA how sweet!!

    Sweet for you. Sweeter for us.

    Every update makes the game seem better. Again... I cannot wait much longer without spontaneously combusting. Only TWO months left in "end of '13."

  22. I too would like to see the debug menu in game, just for the option of tooling around with it. As Overand said, even if it's something that has to be enabled in a config menu it would be cool to access.

  23. I second the idea of keeping the debug in. Definitely have it turned off by default, but having it there to play with, would be great. A friend of mine mentioned that he was planning to make videos using in-game content, and having the debug system would be incredibly useful to him.

  24. I agree with CCCPY... this one will sure beat SC5.

    Eagerly waiting for you to release the game Luke and then enjoy holidays!

    All the best.

  25. Luke, it will be great if you can get two updates a week on your blog with videos and snapshots till you wrap this up, package and deliver... your time permitting of course.

  26. any thoughts on when we can pre-order this wonderful looking game? been watching for a while now and starting to get itchy... πŸ™‚

  27. pre-orders yes please, was looking at something like this ever sine I got bored of tropico πŸ˜› looks great!

  28. Have you begun researching artists the soundtrack yet?
    For me, music makes or breaks the gaming experience.
    I can imagine a score similar to Actraiser.
    something soothing but with undertones of hard labor.

  29. I've a question: Will the UI stay the same? Even though it looks very practical, this black,gray,shadow-scheme also looks very artificial in my eyes and therefore as if it doesn't really fit into such a game. Will there be something else (e.g., wood)?

  30. Game looks great and I'm really excited to actually get my hands on it. After the let down that was SC5 this one looks like it will really be up to snuff.

  31. This looks awesome and I will be paying you money for it as soon as you deem it ready.

  32. I'm glad to see reasonable achievements in the game. I'm definitely the type of person who likes to go for 100% complete. It looks great. I can't wait to pay.

  33. Hi there, I've discovered this game a week ago and have been reading almost everything. Watched all videos, read some interviews and I'm really excited about Banished! πŸ˜€

    Every time I read a blog post I listen to the music of the game because it adds a kind of relaxation factor that also makes me feel I'm in the game already. http://www.youtuberepeater.com/watch?v=6oJW013U638

    Any way I hope you take all the time (and rest!) you need because it looks so awesome! There aren't much games around that actually have a relaxation factor like you made available as play option (maybe (Open)Outcast does something like that).

    I also think that de debug options would be a nice thing for people that tend to make video's and fan made trailers. They could be really useful to quickly generate a scene.

    Last thing I ant to say: I'm really really looking forward to Banished and whatever will follow after it. A town making game (or city builder) like this is really something I've been dreaming about. The closest thing I've seen before this has to be Black & White 1.
    I can't wait to pay you for all the hard work, I'm looking forward to see this game getting released. πŸ˜€

  34. >> "no I’m not planning on having that β€˜Debug’ dialog available in the final version of the game"

    Well, "cheat happens," so are you planning on leaving the classic feature of allowing cheat codes (that disable achievements for the period) to the excitement/thrill of some of us (sore loser) gamers?

    Beats certain game companies that remove the option for the sake of "online integration"...

  35. WOW! I never thought about all that goes into the tutorials. I can not wait to play this game! It looks so awesome!

  36. Still really looking forward to this game and loving the blog updates!

    I know someone suggested Steamworks - please don't force me to use Steam, Desura etc!!!!

    My biggest bugbear with tutorials is if you want to be reminded how to do 1 thing you've forgotten you need to redo the full tutorial - maybe you could have a fast forward button or similar for these instances?

  37. A windowed full screen mode is also appreciated for those of us with one monitor and something a ton of companies seem to forget can happen. πŸ™‚

  38. I found out about "Banished" while searching for city building games. Like many one recently published game was a severe disappointment, sure it is was like the shiny and bright stone we all pick up as kids and play with for a couple of minutes and then throw it down for there is no interest any longer. From all the development blogs and videos,and I have read and seen them all "Banished is that rare gem of a stone that we will have to play and play and play, to put that personal shine on each game. I want to thank you for the continuing updates, and am looking forward to polishing my stones.

  39. Tutorial graphics awesome !! I actually enjoy playing tutorials and I can see that I am going to really love playing them in Banished as you have taken such care in compiling them.
    Happy that its close to release !!

  40. Great work as always. Glad thinks are starting to come together after such a long haul.

    During testing a lot of people will tell you what the game should be, but just remember to make it what you want to. Obviously there will be bugs and improvements, but I'm sure that one of the biggest upsides to being solo is not having to conform to a market or other peoples ideas.

    Keep it up, you are almost there.

    If you price it too low, ill simply buy more than one copy πŸ™‚

  41. This is looking amazing.

    As said earlier, leaving the debug menu in would help extend the life of the game. One of my favorite pastimes is figuring out subtle details of a game. It is a lot of fun get to equivalent states but with slightly different configurations and then watch how different perturbations will affect the system.

    I look forward to playing your game when your see fit to release it, and hope you have enjoyed it's development.

  42. Please be careful, I've played some games where it tells me to do something and because I can't do it the tutorial refuses to let me continue.

    For example, an RTS once told me to practise zooming using the mouse wheel. I was on a laptop and had no mouse wheel, since I wasn't zooming the game refused to move on and I never got to play beyond that.

  43. You should change the roads texture to a road like this:


    Ya know what I mean.

  44. @Overand, we will be able to choose the level seed we wish to play on (if we don't want a random map), so I'm pretty sure it's some sort of procedural code generating the maps if I'm not mistaken. Luke emailed me about the level seed, it's included for sure.

    OT: Lookin' good! Can't wait.


  45. Don't forget to inform your bank if you don't want DEA knocking your door the next morning of release πŸ™‚

  46. I don't want to offend you but the UI is still looking extremely boring and outdated! Do you think it is not that important or are you convinced that what you created looks good? I know there will be enough fanboys around to tell you that it just looks great the way it is and that you should release the game instead of fiddling around with the looks of the UI but you really should think about this again. A game is a piece of art where everything even the UI is a part of and has to be considered like the frame of a painting.

    Have Fun

  47. Go Baby Go!

    Can't wait for the next blog post and the game to be released ! Looks just great and a city building game that I would like to play!

  48. @mac : yes UI is "poor" but seems usefull. The next stage of the game is BETA (i hope), so he have time to refresh and improve it.

    This UI is not horror, just functionnal πŸ™‚

  49. Thanks for the update. The game is looking better and better.

    RE the price, I personally think that anything under US$50 would be selling your self short. Your game appears that it will be certainly a lot better than a recently released 'city' building game that cost significantly more.

    RE debug mode, personally, I think I would rather not have the ability to turn this on - it would have the potential to 'cheapen' the game experience.

    RE UI, I think it could be somewhat significantly lifted if you were to add some sort of grain to the backgrounds (e.g. like a wood grain) rather than having it as a solid colour.

    BUT, it's your game so it's up to you and I'm sure it will be awesome regardless of which direction you take in any of the above areas.

  50. Will houses use less firewood for warmth if they are packed all in a row instead of standing by themselves?

  51. I have been following the development for a while now.
    So please take the following as constructive critisicm.
    I love RTS and RPG games. But as i have grown older, the time i can spend on gaming has grown smaller. My time is actually more in the line of casual gaming, but city ville, farmville and hay day are not deep enough for me.
    So i still like to play the "big" games, but don't like to spend hours upon hours and then realize i have to start all over again. Therefore i appreciate it very much when there are build in cheat codes, so that i can 'leap forward' instead of starting all over again.
    I hope you will evaluate your customer user profiles, and finde that "my kind" is worth having on board.

    When that is said i look forward to playing your game.

  52. TYPO! Just a note...I see in the first Tutorial image that you're missing the word 'to' in the last sentence. ...'edges of the screen TO move the camera.' Looks exciting!

  53. looks Amazing keep up the good work. It'd be a good idea to have some of the acheivments "hidden" so you cant just work towards them to fast.

    As always keep up the good work. Cant wait to play!!

  54. I hope after release there will extras to buy like an all Japanese version.. Japanese style house and the people wearing Japanese style clothing. Or a Viking one or a south seas islander version.....

  55. To all those who are thinking of an Asian version: Keeping true to the theme "Banished," there is an excellent parallel to consider: The history of the Hakka people travelling from central China down south.

    Of course, the winter aspect may have to be revisited...and that they were more connected to the outside world.

  56. Can't wait for this game to be released. Has been on my top list of games to play for about 6 months now.

  57. On a VERY separate note:

    Dear fellow Canadians: Happy Thanksgiving! We'll repeat this announcement for our dear neighbours down south in a month's time...and hopefully, to match the theme of this game...be REALLY THANKFUL as we play the official release? *winkwink*

  58. You could skip most of the tutorial by doing something like Civilization 5 does.
    Just have an advisor give tips to the player as he plays. If the player decides to ignore it, then thats his choice

    No tutorial, just tips. And civ 5 is very successful game

  59. The mere idea of adding a tutorial to a game of this kind is a great one. This will help people to enjoy the game from the beginning instead of rebuking them by a system they are not used to deal with. Great work on this one, the achievement part is good too and it is true it is mostly present in every single game released nowadays.

    What I am honestly wondering though and I think it would be great to have an answer on this one is concerning updates after the game is release.

    Do you plan on putting more stuff in when the game is release or not? If so, could we have a place to post our suggestion?

  60. Not sure if somebody pointed it out already, but there is a spelling mistake in your first picture. You are missing *to*:

    "to the edges of the screen *to* move the camera around"

    Looks brilliant!

  61. this game looks to be awesome, cannot wait!

    Minor question though, as a dual monitor user. Will you make sure there is Cursor Lock, or however you might call that? What I mean is that a lot of newish games tend to leave that out, it can be very annoying when you want to scroll around with your mouse and your cursor leaves the game-screen...

  62. to whom spoke about ui.
    ui is an useless part of the game, these one are professional and impersonal.....in my opinion good

  63. @grinder I agree with you!
    if luke, later, wants to improve them it's ok, but now ui looks fine!

  64. I have got an idea seen as you can only harvest herbs and game from forest that have existed for decades, you could start a forest at the start of the game and afk for 20 in game years and that forest would have herbs and game in it

  65. I feel like this is going to be the best game ever. It seems to include everything I've ever wanted in a game. Awesome work! Can't wait!

More Posts

Code Rot

April 17, 2022
1 2 3 47
Back to devlog
Back to devlog
Β© Copyright 2021 Shining Rock Software
Website Design & Branding by Carrboro Creative
menu-circlecross-circle linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram