{"id":123,"date":"2009-11-11T18:09:57","date_gmt":"2009-11-11T05:09:57","guid":{"rendered":"http:\/\/www.paradicesoftware.com\/blog\/?p=123"},"modified":"2009-11-12T19:51:06","modified_gmt":"2009-11-12T06:51:06","slug":"paying-your-windows-taxes","status":"publish","type":"post","link":"http:\/\/www.paradicesoftware.com\/blog\/2009\/11\/paying-your-windows-taxes\/","title":{"rendered":"Paying your Windows Taxes"},"content":{"rendered":"<p>In Windows (like every operating system), when you&#8217;re writing an application or game there are certain things that your application is responsible for handling: some of them are easy, some of them take a little bit more effort. On his excellent blog, Microsoft&#8217;s <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2005\/08\/22\/454487.aspx\">Raymond Chen<\/a> calls these responsibilities &#8220;Taxes&#8221;, and there are good reasons why you should pay them. Windows taxes include things like:<\/p>\n<ul>\n<li>Respond to Windows messages correctly<\/li>\n<li>Respect user action (don&#8217;t silently cancel a Sleep request)<\/li>\n<li>Non-standard installs (don&#8217;t assume C:\\Windows!)<\/li>\n<li>Run fine as a Standard User<\/li>\n<li>Respect the user&#8217;s settings<\/li>\n<\/ul>\n<p>Raymond talks about more complex taxes too (internationalisation, heirarchical file systems), but I&#8217;m sticking to what I&#8217;m comfortable with!<\/p>\n<p>Unfortunately, amongst all applications, games appear to be the worst at being good Windows citizens, there are far too many games out there (not just freeware ones either) that don&#8217;t pay <strong>any<\/strong> of the above taxes, and (to sustain the metaphor) some start trying &#8216;tax-fraud&#8217; schemes like:<\/p>\n<ul>\n<li>Trying to disable Alt-Tab<\/li>\n<li>Refusing to be minimised (automatically restoring themselves after 1 sec)<\/li>\n<li>Preventing the system from shutting down<\/li>\n<\/ul>\n<p>I might make this another series because there&#8217;s plenty to talk about, and most of it&#8217;s not even that difficult these days: you just have to be aware of the situation, and what the correct behaviour is. (I must admit I never gave thought to multi-monitor situations before I got my second monitor).<\/p>\n<p>For now though, I will limit myself to a list of ten &#8216;golden rules&#8217; which I believe all games should obey, at a minimum (not all of them are Windows taxes &#8211; some of them are just treating your users properly). In fact I will expand on some of these in later posts too, because they&#8217;re worth talking about.<\/p>\n<h3>Top ten Golden rules for Games: being a good Windows application<\/h3>\n<ol>\n<li>1. Fullscreen games: <strong>always<\/strong> allow an option to run in a Window.<\/li>\n<li>2. Provide gamma and volume controls, and separate music from sound.<\/li>\n<li>3. Always allow your game to be paused, saved and quit. At any time.<\/li>\n<li>4. Provide a way to skip <strong>anything<\/strong> non-interactive: from cutscenes to credits.<\/li>\n<li>5. Respect multi-monitor: If you were dragged to monitor 2, next time open on monitor 2.<\/li>\n<li>6. Respect the filesystem: don&#8217;t open files in Read\/Write mode if you only want to read from them.<\/li>\n<li>7. Respect security: A game <strong>does not<\/strong> need an Administrator account to play!<\/li>\n<li>8. Respect UI settings: if the user has selected &#8216;Use Large Fonts&#8217; in Windows, use larger fonts in your game!<\/li>\n<li>9. Respect sessions: if the user logs off\/hibernates\/shuts down, handle it gracefully. Don&#8217;t try to block the action, and don&#8217;t lose their progress.<\/li>\n<li>10. Adapt to a changing system: if you last opened on 1680&#215;1050, but the system now says the monitor can&#8217;t support that, open in a res it <strong>can<\/strong> support.<\/li>\n<\/ol>\n<p>I&#8217;ll talk about how to implement some of these (and why they&#8217;re so important) in future posts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Windows (like every operating system), when you&#8217;re writing an application or game there are certain things that your application is responsible for handling: some of them are easy, some of them take a little bit more effort. On his excellent blog, Microsoft&#8217;s Raymond Chen calls these responsibilities &#8220;Taxes&#8221;, and there are good reasons why<\/p>\n","protected":false},"author":2722,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,19],"tags":[77,17,11],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-code","category-game-golden-rules","tag-code","tag-taxes","tag-windows"],"_links":{"self":[{"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/users\/2722"}],"replies":[{"embeddable":true,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":18,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":147,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions\/147"}],"wp:attachment":[{"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.paradicesoftware.com\/blog\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}