Checking for Corruption

In regard to last weeks post, and a few good suggestions in the comments, the launcher and video mode changes now only comes up when needed. The first time the game starts you’ll see the launch dialog and options to change video mode. If the game starts and exits properly, you’ll never see it again.

If the game crashes or doesn’t shut down properly, the dialog will be shown on the next run of the game. You also be able to bring the launcher up manually by holding CTRL while the game starts, using the command line parameter ‘/launcher’.

I made a few other changes to some of the video system. The game now allows the windowed mode to be resized to any desired size, and keeps track of the location of the window so that it comes up in the last place it was when the game was shut down.

The field of view for extremely wide aspect ratios now works properly – something that had to be fixed for variable size window sizes. This also allows 32:9 or 48:9 multi monitor displays to work properly. There’s certainly more that could be done for super wide displays in terms of user interface elements, but that’s fairly low on my list of things to do.


I’ve also been fixing some errors that occur due to corrupt save games. I’m not sure exactly how this happens – the power goes out and the file write doesn’t finish? Something weird happens and bytes in the save game are changed? I guess something timing related and unexpected can happen, like auto save is occurring in one thread, and another thread or the main thread crashes at the same time.

For extra security, I may also change the save system to output to a temporary file, and then issue a move command once the write completes successfully.

Either way, a corrupt save game causes the save/load dialog to crash. So now extra checks and CRC computations are made to make sure files save games aren’t corrupt to the point that they can’t be loaded.


This issue can also occur with the file that is output that changes the display of the main menu to the last viewed scene when the game quits so I’m working on fixing this as well.

The rest of this week and next I’m going to be tackling the some of the reported game play bugs and hopefully try to get a proper update out soon after that. After that update I’ll be working on getting the mod kit out.


Hardware Compatibility

Today I’m working on trying to finishing up better support for the myriad of graphics cards out there.

The main issue is that many graphics cards report themselves as working with DirectX 11, but they seemingly don’t fully support it. There’s all sorts of random crashes occurring in draw calls, and many times crash reports show the game dying in the graphics driver DLL itself, with no call stack, leaving no opportunity for meaningful debugging.

On my development machines, with DirectX in debug mode, I get no errors or warnings, so I don’t believe the code is doing anything bad that would cause this issue. I could still be doing something wrong at initialization, but so far I can’t track it down.

Most all video cards drivers that exhibit this problem work just fine with DirectX 9. In hindsight, having the game start in DirectX 9 mode would have been a better choice – but since DirectX 11 provides a much better frame rate, I decided that should be the default. Even so, if a player were to change to DirectX 11, there’s a chance that the game would then crash.

DirectX 10 and 11 have much stricter feature requirements than DirectX 9 did, so I’m not sure where this issue comes from. Especially since the frame outputs of the two modes should be nearly visually identical, and at the lowest level the native commands sent to the video cards should be the same, except for the method of instancing support. And in most cases the crash occurs before any instanced geometry renders.

There are a few other edge cases that I’m taking care of, such as monitors that don’t have 60Hz output modes, machines with multiple graphics adapters, the game getting stuck in undisplayable video modes, and exception handling and recovery for video drivers that crash on initialization.

Too that end, I’ve added more video options and a front end launcher to the game, instead of players having to use registry hacks or deleting dlls from the game directory when things do go wrong.


In some ways this is annoying. Many users have no issue with their video cards, so this is just an extra click when starting to play. I’ve considered adding a ‘Don’t show this dialog at startup’ type check box so that players can just jump into the game, but in the event of a crash, it would have to come back up to allow the player to change settings – it’s hard to know if a crash was caused by a graphics event.

But this launcher is also a good place to allow users to select which mods are going to be loaded (when I finish support for that…) so in the end it’s not terrible. I’ve seen other games with this sort of setup.

From the launcher, all video settings can be changed, and there are now options for picking which video adapter to use and what refresh rate to use in full screen mode.

Video Options

Coding wise this isn’t as clean as I’d like it to be. This interface requires an additional set of UI code that basically does the same thing as the in game configuration. While a lot of code is shared, if I add more video options at any point, the interface needs to be changed in two places.

But since the in game UI requires the graphics hardware to render it, an operating system backed UI is really the only option to be able to display and change settings before the game engine fully initializes.

In game, the video options are the same as the launcher, and can be changed without shutting down the game. I’ve tried to make this system more robust so that invalid video modes can’t be selected, but in the event they do, players can make changes and fix the issue next time the game starts by using the launcher.

Game Video Options

When the game gets ported to other platforms, the front end launcher will require more similar UI code – or none at all, depending on what system it is. I plan on using a cross platform UI library for the widgets, but there will still be differences – for example there’s no need to pick between DirectX versions or switch to a different graphics adapter on a Mac, it’ll just use OpenGL, and assume usage of the video card that drives the system.

I had it much better than I realized back when I did console programming. Once a game was rendering on the development machine, you knew it would run on every system at the same frame rate. The land of PC development is much rockier. I’d like to get back to making console games for that reason, but at this point with a fairly robust game engine I’d imagine I’ll always release games on PC’s as well.


Post release is a busy time

The time after shipping a game is harder work than it looks on the surface. When I made console games, a game would ship, and I’d start coding on the next project before the discs hit the shelves. So my impression before Banished was released was that I’d be able to jump right into further development, prototyping new games, and have a general period of relaxation.

This is not the case.

Because I’m not just a programmer on a team – but the whole team – there’s a flurry of email, customer support, dealing with press, trying to keep up with social media, phone calls, meetings, future planning, and attempting to fit everything into a five day work week. Having time away from the screen is still very important to me too. Overtime just isn’t my thing. Somewhere in there I’m trying to find time to fix the bugs and work around compatibility issues.

My coding time has been reduced significantly lately and the fixes aren’t coming as fast as I’d like, but I am working on them. There’s the beta patch out there but it doesn’t yet address all the issues I’d like to get to. I really want to get to more work on the mod-kit and ports and future projects.

I’ve certainly thought about getting help with the coding, but it takes time to find someone, get them up to speed, and start producing work. Not to mention the complexities of expanding a business to have employees.

I’ve also had to put a little time into another project – back when I wasn’t sure making indie games was going to work I starting making tools for game developers in the hope that I could make a living with writing development tools instead of games, or a combination of both tools and games. I started a small company with an artist, and developed a product called Handplane. It actually helped fund the development of Banished and get it finished.

It’s a little complicated if you’re not a games graphics artist, but Handplane takes an object-space normal map generated from a hires/lores baking process and converts it into a tangent map for a lot of different game and graphics engines. It lets you make models without smoothing splits and import it perfectly into the Unreal, Unity, Source, and Creation engines, as well as Max and Maya, regardless of where the source model or object space normal map came from. So people have been using it to make nice objects in Fallout, Skyrim, Dota, Unreal, and other games without spending time tweaking models so that the normal maps display correctly.

Because I wrote the code and am the only programmer at Handplane3D, there’s still support and update issues for that product too. While I’ve generally let Banished take most of my time, Handplane is still something I have to work on occasionally – especially since I’m not the only person working at that company.

Could I be more busy? Probably, but I don’t want to be.

On a non-time and busyness related note, I’ve encountered an interesting phenomenon in dealing with support that I didn’t expect. The amount of positive feedback, number of players, and people having a good time with the game is an absolutely huge percentage.

But even as the good feedback is out there, as the developer I see all the bugs, startup problems, and strange issues up close and personal, everyday, and in a volume that’s large enough to make the game release seem like it has a lot of problems when taken out of context of the full number of people that have had success and bug free play time.

This is somewhat hard to deal with – at first reports of bugs and the game failing to start made me cringe and stress over getting them fixed as fast as possible. But I know most software has small percentages of issues because of hardware and software incompatibilities. And I know bug reports need to be taken just as a bug to be fixed. And it takes time to reproduce bugs and find fixes that won’t break other things. But it’s hard to separate personal feelings from just dealing with support issues when releasing a project to the world that has been a personal project for many years.

I get the feeling I’m not the first indie developer to feel this way – but really I just needed to get past it, fix the bugs, and continue working on Banished and new games.

And finally, I’ve been meaning to update the devlog more often, but time flies when you’re busy. Things are calming down around here so hopefully soon I can get a patch out for more of the bugs and get to work on the Mod Kit. More soon!


Working on an update…

Yikes! It’s a busy time. Releasing a game is crazy. I’ve been busy with feedback, support, and bugs, so updates to the devlog have been slow.

I’ve been trying to get through some of the more fatal bugs – there’s a save crash – it’s rare, hard to reproduce on demand, and after it occurs the game crashes at some indeterminate time in the future when a player starts to save. That’s been most of my focus.

Anyway, there’s a test patch available. It should fix most all save games. If you’re interested in testing the new version, I’d love to get some feedback.

If playing on Steam you can opt into the Test beta version. If you’ve got a save game that won’t save after a few minutes of play, this will probably work for you. To do this, right click on the game in your Steam library, select Properties, and then pick the BETAs tab. You can switch to the Test version.

If you’ve got a standalone version of the game, you can download new exe’s and dlls. Just replace the ones in the game directory.

I may also add a few more fixes to this update before pushing it live to everyone – there’s a few bugs dealing with multiple adapters and refresh rates which cause people to be unable to start the game. I thinking I might add a front end launcher where you can select video modes and settings.

After that I’ll be looking at some of the gameplay bugs.

Here’s the full list of changes in the test build.

  • * Fixed a bug causing save games to fail.
  • * Fixed a crash in the music player.
  • * Fixed a startup crash when a video card doesn’t support depth sampled textures.
  • * The startup menu scene no longer displays the last seen area.
  • * Added a command line switch /dx9 to force the game into dx9 mode.
  • * Added a command line switch /dx11 to force the game into dx11 mode.
  • * Added a command line switch /windowed to force the game to start windowed instead of fullscreen.

The Morning After…

So release went pretty well. I hope most of you are enjoying playing the game. It’s great to finally have released it after working on it so long. Thanks to everyone for buying the game and playing!

So whats next? I’ve got a ton of email to get through, as well as support requests and bug reports on the forums. I know people are experiencing some startup issues, and those are going to take priority.

I’m just one person doing all the support and development on Banished, so please have patience while I’m getting through everything. I’d like everyone who bought the game to have a good experience and know that I’m working on any issues.

Some common issues

The main issues I’ve seen deal with the game starting and the game not having audio. I’m posting these few work arounds right here, as they seem to be the most common issue. You can also find more info on the forums.

The main issue with startup seems to be that some video cards aren’t starting up or working properly in DirectX 11 mode. There are some work arounds for this.

To force the game into DirectX 9 mode, you can rename or delete VideoDX11-x32.dll and VideoDX11-x64.dll. These are in the directory that the game was installed to. For steam, these are VideoDX11-steam-x32.dll and VideoDX11-steam-64.dll.These are most likely in Program Files (x86)\Steam\steamapps\common\Banished.

After renaming or deleting them, the game will startup in DirectX 9 mode, which seems to be more compatible with most video cards.

You can also edit the registry to fix this issue.

  1. Run regedit.exe.
  2. Navigate to HKEY_CURRENT_USER\Software\Shining Rock Software LLC\Banished\
  3. You may have to create these folders if they aren’t there.
  4. In the right hand window, find VideoInterface, or add it by right clicking and selecting New->String Value.
  5. Set the value of the VideoInterface key to 0.
  6. Try to restart the game.

You can also change the resolution of the game and some video options to reduce the video memory needed for the game. These are the keys and the valid values. All keys are of String type, and can be set just like the instructions above.

  • VideoFullscreen – can be set to ‘true’ or ‘false’
  • VideoWidth – sets the width of the output. The lowest valid value is 800.
  • VideoHeight – sets the height of the output. The lowest valid value is 600.
  • VideoInterface – sets the renderer. 0 = DirectX 9, 1 = DirectX 11.
  • VideoMultisample – sets the multisample AA mode. 0 mean no AA. Higher numbers have internal meaning. Only set to 0 and use in game options to set other AA modes.
  • VideoShadowScalar – 0 = highest. 2 = lowest. 2 uses the least video memory.

The other issue is for people with the standalone non-steam installer. After starting the game, some of you may not have sound. I missed a module that needed to be included in the installer.

The simple fix is to download and install the DirectX End User runtime. You can download it here.

I’ll be working hard on fixing these issues and anything else that comes up. Again, thanks for playing, and thanks for your patience while I work through these problems.