Category Archives: Uncategorized

Have you heard of it? I had not either, but its a thing, and its a free thing, and its pretty cool. Its a similar tool to nvidia nsight, which I used to love, until they basically broke it entirely for older copies of visual studio. I would love to live in this delusional world where people make dev tools and think that every developer is sat there, staring at their code thinking ‘it would be great to take a few days off to install a new version of this IDE, with virtually no improvements, but lots of changes and incompatibilities. Plus I am tired of having money, take my dollars…”

FWIW I develop Democracy 4 with Visual Studio professional 2013. Its great. It works, and I don’t see any reason to ever upgrade. I think the previous version I had was one I sued for about eight years, so theoretically I might consider upgrading in 2021… but why would I?

The question should always be ‘why should I upgrade?’ not ‘why should I stay on an old version. an IDE is just a tool. My office chair is a tool, and I think thats about 8-9 years old now. I expect it to last another 10 years minimum. Stick with stuff that works well.

Anyway, lets talk about GPUPerfStudio!

This is a free tool you can get here. Its a way of debugging the way you draw stuff in your game, and it seems to support directx, opengl and vulcan whatever that is :D Its not flawless, but its pretty easy to setup and use, which is one of the most important criteria for devs like me who code everything, and thus the debugging of rendering issues is only a tiny part of my job… With that in mind here is a tutorial on how to use GPUPerfstudio with your game.

It seems all you do is download and unzip the thing into a folder, and launch the executable (GPUPerfClient.exe). BTW whats weird about this tool is that to actually run a program and debug it, you click this top left icon that looks like a monitor… whats wrong with a ‘play’ icon? You then browse to the path of your .exe file (debug or release builds are both fine, and click on ‘next’, then ‘connect’.

This then launches some command line window which you can ignore, and your actual app. It then pops up a dialog box for you to confirm what graphics API you are using, and wahey! you can run and use your app as normal until you get to a screen you want to analyze. When you are there, you click back to the GPUPerfStudio window and hit the ‘pause’ button. NOTHING happens! Until you click back to give your game window focus. It then takes a snapshot, and you are in business, and its time to hit that (now highlighted ) frame debugger button. This then generates some cool stuff:

You need to click around on various stuff to get the layout the way you like, but to be simplistic about it, on the left hand side in a column of every draw call made to render this scene. To the right of that is a diagram showing the various stages in preparing and rendering each draw call, and to the right of that is a bunch of render targets and textures you can zoom in on by clicking on them. I’ve selected RT[0] which is essentially the screen, and selected one of the later draw calls. I’m not using fancy shaders so I don’t care about the RHS windows, I just want to see what is rendered when.

With that in mind, I can select an earlier draw call on the LHS…

Tada! Thats draw call #6 where a bunch of icons get drawn to the screen. I can click on the source texture for all that and see how much of it using and what the source looks like, and if I want more detail on the actual draw call data I can click on VAO for the vertex stuff, and actually inspect the contents of the vertex buffer I’m using…

BTW the pink highlights on the screen texture are showing you the verts you draw in the current call, which is clearer if I look at a later draw call:

You can see there that I just drew all those blue rectangles on the left of the screen (with a single draw call, for max speed).
Also check out this cool screen, the CPU API Trace, which seems to show you a timeline of all your draw calls and how long each thing took. If you suspect one draw call takes way too long, this may explain why, or at least confirm it…

BTW top tip: ctrl+mouse wheel on the top progress bar does fine-tuning of zooming in and out to see each item…

Ultimately, tools like this are a great way of working out when you are doing *really dumb stuff*. I found out yesterday that despite writing super cool code to batch drawing all of the voter strips in 3 or 4 draw calls, I was then rendering each one of them individually in bits again right afterwards due to a bug. I would NEVER notice this any other way, because obviously you cant tell when items have been drawn twice perfectly on top of each other, but it was killing my frame rate.

Anyway, this software is cool, interesting, seems to work, and its free. What else can anybody want?

As designer of Democracy 4, I’m obviously a full-on political geek. I have my own views on policy, but I also have views on a non-party basis about all the stuff thats wrong about our system. Heres a brief rundown of some of the easy-win stuff that we should have collectively decided to do decades ago, but our politicians are so useless we don’t…

Drug-test Politicians

You can now detect cocaine use from a fingerprint (new-scientist this week!), so why the hell do we not drug test ll our MPs when they cast a vote? You cannot fly an airplane when drunk, or operate on a patient when on cocaine, why do we not hold the people who MAKE our drug laws to the same standards? these people make life changing decisions. We need to know they are sober, and of sound mind. I’d even be happy with mere weekly checks.

Pay Politicians More

The average UK MP earns £76,011. That sounds a lot, but its pathetically low given the responsibility, and the pay offered to senior managers in the private sector. Its not much more than a ‘category manager’ at a john lewis store. I suspect category managers never vote on going to war, or changing hospital budgets, or giving the OK to arms deals. There is an argument that paying them more makes them ‘out of touch’ but MPs meet a lot of people through their work, and are likely more ‘in-touch’ than we think. Plus, if you want to attract talented people with great management experience and prevent them from trying to exploit their political connections to leverage future income…we need to pay them the appropriate amount.

Proportional Representation

There are many options, but frankly any system where the party that gets the most votes does not get the most MPs is not democracy. The results of the last election make it clear that the current system is a farce. Example:

Libdems needed 336,000 votes per seat won, Conservatives needed 38,000, Greens need 886,000 votes. This is not a democracy

House of Lords reform

Bishops sit in the house of lords (the UK’s second chamber) because… reasons. A huge number of members of the house of lords never show up at all, treating it just as a cool thing to stick on their headed notepaper. Their average age is 70 (how very representative…). 92 of the peers are hereditary, most of which can only be inherited by men. This is a ridiculous, embarrassing feudal relic. There are 782 members of the lords. They include convicted criminals like ‘Lord’ Archer.

Image result for queens speech

Electronic voting

UK politicians vote by going out of the room they debate in, then walking back in through one of two doors while someone counts them. This is the year 2020. For fucks sake. There is NO reason for this other than ‘tradition’. Our democracy is not a museum.

Speakers Constituency

One of our MPs is declared ‘the speaker’. they chair the debates. They are an MP, but nobody ever challenges them (normally) in elections. This ‘tradition’, means that everybody in the speakers constituency no longer lives in a democracy. Again, a complete farce. Simply appoint an outside expert as speaker, there is NO reason they should be an MP.

Modernize the system, away from the palace of Westminster.

The building needs fixing anyway, and besides that it is too small. Turn it into the museum it should have been for the last 100 years at least. While we do that, lets scrap a lot of the historical crap that makes our system of government feel like an old-boys club merged with a posh public-school debating society. People should be able to:

  • Call each other by name, without this stupid ‘the right honorable member…’
  • Ask the PM questions directly, without this ‘in addition to my duties in this house’ bullshit.
  • Say the words ‘the house of lords’ when in the commons and vice versa, none of this stupid ‘the other place’ crap.
  • Be ejected from the house if they jeer or shout. its not a rugby club, its a serious place where laws are made and policy challenged. it sounds like a group of childish little boys jeering.
  • Do away with ‘black-rod’, the ‘men-in-tights’, the mace, and the other stupid civil-war re-enactment bullshit that litters our parliamentary chamber.
  • The ‘queens speech’ is written by the prime minister and should be read by them. Its a stupid bit of diversion to try and imply she agrees with whats being said.
Image result for house of lords

Hold political broadcasts to advertising standards

They are exempt. WTF? This is a license to lie.

Prevent the sale of alcohol in parliament.

Not only is there a BAR in the place, it is dramatically subsidized, so we can ensure that our politicians are often drunk, at our expense, with no idea of the price the rest of us pay. Genius.

Publish tax returns for all members of parliament, as long as they serve + 5 years afterwards.

Pretty obvious measure needed to avoid corruption. There is no argument I can see against this. I’d be very happy to publish mine if I was an MP. There is so much history of corruption in politics that this should be a minimum requirement.

Term-limits for MPs.

My current MP has been the local MP for as long as anybody can remember. It has been a safe Tory seat since 1923. My current MP is likely to die in his post, unchanged and not seriously challenged. This is a recipe for corruption, and stagnation. MPs should serve 4 terms maximum.

What have I missed? :D