Game Design, Programming and running a one-man games business…

I’ve been using GPUPerfStudio

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?

Legacy car companies and the shift to EVS. Why they cannot win.

BTW if you followed my tip on tesla stock last year, you would have tripled your money…

Yesterday General Motors gave a presentation about Electric Vehicles and how they were a big part of GMs future. They rolled out a long line of executives onto a stage to make passionately written (but embarrassingly delivered) speeches about how they were going to continue to be the world leaders in EVs. The CEO even wore a leather jacket. It was excruciating, but the presentation is not the problem. The problem is the facts, and the facts are harsh.

Image result for GM EV day

There is a very powerful attempt to drive down the price of tesla stock (an attempt that is failing, but nevertheless, well funded by oil companies). part of the narrative is that tesla is doomed because ‘competition is coming’. This was a claim first made when tesla produced the model S. It was repeated for the model X, then for the model 3, and the model Y gets released this week, and we are hearing it again. So far the claim has turned out to be bullshit, because 58% of EVs sold in the USA are made by tesla still. Thats bad enough, but the future is even worse for the ‘competition’.

There are a bunch of reasons why big legacy auto companies cannot compete, and they aren’t all obvious. I thought I’d list them here for anybody considering selling tesla stock and buying GM or Ford.

Software/hardware expertise

EVs are just TOTALLY different to conventional cars. The expertise in making petrol or diesel engines is useless when it comes to an EV. the actual body design has to be different too. Tesla puts the battery in the floor and the motors between the wheels, but trad companies are still putting the motors in the front because…thats where the engine used to go. This means zero front crumple zone, and no frunk storage, but they do it anyway. A bottom heavy car is safer, as it rarely (if ever) flips, but even now the big gas-car companies don’t get it. They are stuck in gasoline car hardware design mode.

Software wise its even worse. tesla make their own software, and are even now making their own self-driving AI chips. Thats right, they are designing the silicon for their cars in-house. Thats a crazy amount of expertise. Legacy companies instead use dozens of chips each from different manufacturers, with virtually no in-house software expertise, and have a nightmare hiring decent auto-experienced software devs, who all clearly want to work for elon musk.

Image result for tesla autonomy day

BTW that self-driving chip is not just a prototype, they have been shipping it in cars for months already.

Factory Design

Teslas fremont factory used to be a legacy car factory and its a MESS in design terms. It was originally built to make ICE cars a long time ago, and is far from optimal design or layout for modern production. EVs require a totally different approach. This is why their chinese factory is built from scratch as a huge EV-only factory to produce super-modern cars. Legacy firms can’t demolish old factories and re-start, they have neither the time, money or the support of unions/governments to do so. Teslas 2nd purpose built factory (Germany) is breaking ground this month.

Workforce

Legacy auto is heavily unionized and unions HATE EVs. They have good reason to, as an EV is much, much simpler to build, and requires a much smaller workforce. A shift from legacy cars to EVs threatens jobs and the unions know it. Teslas workforce is, and always has been EV-only.

Dealerships

Tesla sells direct, but legacy is stuck with a dealership network they have to support for legacy cars. The dealerships HATE EVs, because so much dealership income is from maintenance and servicing, and EVS require almost none (My own EV has been serviced once in 4.5 years. Nothing was wrong). Also virtually nobody at any dealership knows anything about EVs. Consumer feedback from dealership visits is highly critical. often the customer knows more than the sale staff, who want to sell you an ICE car anyway. You are lucky if 1/10 cars in the ‘showroom’ is an EV anyway.

Late to market

Make that VERY late. Tesla made it clear EVs could be cool with the roadster in 2008. Then came the model S in 2012. Thats eight years ago. EIGHT years after the first mass-market electric vehicle, and the legacy auto firms are talking about delivering a certain number of cars in five years (optimistically). Its WAY too late. Many people already equate electric car with Tesla. 58% of USA EVs are Tesla. Their market lead is huge.

(BTW I didnt forget the Audi E-tron, Jaguar I-Pace and Nissan LEAF in that chart, they just dont even make the top 5… BTW this is not the end-game, tesla is still growing like crazy:

Batteries

Tesla make their own batteries in Nevada (and soon in China too). They partner (for now) with Panasonic to do this, but the tech is owned by tesla. They are the first company to go all-in on building a massive EV-battery production facility. other companies rely entirely on outside suppliers. Tesla have the best battery management technology in any EV. (See chart below),

Image result for tesla battery efficiency chart

If you want to work in EV battery research, its absolutely clear who you go to work for, and its not GM or Ford. Batteries are VERY expensive. Anybody can make a 400 or even 600 mile EV, you just have to put a staggering amount of batteries in it, but making an affordable 300 mile car is VERY hard, and its purely about battery tech.

Tesla Model 3

Marketing

Tesla tout EVs as the future, and ICE cars as the past. They are right. Everybody knows it, but the legacy autos cannot say it. They make the overwhelming amount of their profit from ICE cars. Even GM admit that the bolt loses them money. They cant market their cars as the future or superior without admitting 99% of their lineup is inferior and the past. They HAVE to be pro-ICE cars because thats what they make, but in doing so, they have a conflicted marketing message. Meanwhile Teslas advertising budget is still ZERO dollars.

So to sum up..

Legacy autos have a workforce that hates EVS, assembled in factories designed for ICE cars, Their sales people hate EVS, and their hardware and software experience is minimal or actively damaging. They outsource the most important components, they are woefully behind, and their own product line prevents them from marketing EVs successfully.

TL;DR: Don’t believe the bullshit. The ‘competition’ for Tesla is fucked. There is way more chance that BYD or even Google/Apple could be a serious EV player than any of the old auto companies.

Impact report on school #2

I just got a big info dump about the second school I paid for in Cameroon. Also lots more pics. For the first time I got proper pics of the old school (before we had pics of a different school, which eventually we changed from to this site):

which doesnt look too good and had numerous issues:

“Since 4 out of 7 seven available classes had dilapidated and were
abandoned, only the 3 available classes in a manageable state could be
effectively used. Classes 1 and 2 had to share a single classroom, classes 3 and 4 and classes 5 and 6 also shared a room respectively. The classrooms were therefore overcrowded making teaching and learning very difficult.
Whenever lectures of one class were more interesting, pupils from the other class sharing the room were distracted and could not concentrate on their lectures. This impacted negatively on the performance of the pupils.”

With the old school, the stats were as follows:

“The total number of pupils in the school when feasibility studies were carried out stood at 205, of whom 114 were girls and 91 were boys. At the time of the feasibility, the school had a total of 4 teachers including the head teacher who were all employed and paid by the church. Some of the teachers had to teach 2 classes as the teachers were not enough to cover the classrooms.”

The main problems:

  • Insufficient and inadequate classrooms
  • Insufficient benches, tables and chairs for pupils and teachers respectively
  • Inadequate toilet facilities in the school
  • Lack of water in school

The new school looks like this:

The project had the following outcomes:

  • 3 classrooms, an office and store have been constructed and handed over to the school
  • A 3 compartment toilet block with hand washing facility constructed and under use in the school presently
  • 27 Benches, 3 teachers tables and chairs provided and in use

More interestingly:

  • An improvement in pupils’ performance have already started to be noticed since they started using the new infrastructure and equipment in 2019/2020 academic year. The syllabuses can now be covered as no time would be lost to rainfall disturbances or cleaning of dusty floors
  • Enrolment have increased by over 92 pupils at the beginning of the 2019/2020 academic year with the presence of the new infrastructure and would continue to increase
  • A reduction in the prevalence of illness among the children and improved hygiene and sanitation in school. Upper track respiratory track infections have reduced as well as jiggers
  • School attendance have improved to over 100% since the use of new infrastructure especially for classes using them and this would continue.

I’m very pleased to have hard numbers on this stuff. More kids getting an education, and more kids getting a BETTER education, plus a reduction in health problems. Awesome. Total cost is about £24k.

Its worth noting that sometimes the shortage of teachers is related to the condition of the school. Basically a nice, modern, clean school will attract the best teachers, and more of them.

Regrettably, Cameroon is facing serious problems, and they badly need help. I currently have a bad back AND bad toothache (just got back from dentist), but its humbling to realize just how amazeballs lucky and healthy I am, mostly because I happened to be born in the UK. Anyway, thanks again to everyone who buys my games and puts me in a position to do this kind of thing.