Monthly Archives: January 2020

Electric car tradeoffs.

January 18, 2020 | Filed under: electric cars

Some recent reading of comments on the topic of electric cars has prompted me to summarize my views on where electric cars should be heading next. There is a big disconnect between the reality and the general opinion of people who do not already own an EV. I thought I’d like to shine some light on the discussion, so here goes.

There is nothing magical about the batteries in an electric car. Until about 8 years ago, they used to tend to be large ‘pouch’ batteries, but these days they are more likely to be just an assembly of small round batteries like you stick in a TV remote. The most common is the ‘18650’ batteries used by tesla:

Image result for tesla 18650 battery

It might sound nuts that this is what powers a car but its true. The difference between that and your laptop/TV remote battery is the ‘battery management system’ meaning some hardware and software that warms/cools/monitors and controls a LOT of these batteries once assembled in a big pack:

Related image

When it comes to the battery in an electric car, there are a lot of misconceptions, lies, FUD and confusion about how they work, how good they are, and whats important. This is partly because the battery tech has moved SO FAST, and partly because there are deliberate campaigns by anti-EV lobbyists (oil companies) to spread lies and fear. Lets clear some up!

Firstly, NO they are not dangerous. Stats show that a fossil fuel car is way more likely to catch fire or explode. EV batteries are heavily shielded. One famous case of a tesla battery fire was eventually found to be a result of someones handgun going off whilst pointed at the car floor(battery)…errr…don’t do that! (in ANY car!).

Secondly, no, the batteries do not just die after a few years. Battery degradation is REALLY low. My own car is 4.25 years old, has gone 34,000 miles and the battery degradation is 2.69%. Not only that, but a lot of evidence suggests that they degrade a lot (relatively) the first year, then that rate trickles off. I have no doubt my car battery will last another 50 years minimum (unlike my frail human form)

Thirdly…no, it doesn’t take four hours to charge an electric car at a car charging point. The speed here REALLY depends on the charger itself. My home charger is pretty slow, and will take maybe 10-11 hours from empty to full, but a tesla supercharger will charge insanely faster. The exact empty-full time will depend on temperature, but here is a rough guide:

What people forget is that your car charges at home WHILE YOU SLEEP. So 11 hours sounds a lot, but thats then 200-300 miles of range. I don’t travel 200 miles a day on a commute, so I don’t care. Note that not all cars, or chargers are the same. Some older charging networks have really slow speeds, and many cars cannot cope with 150kw. Your Mileage May Vary, but if you think there isn’t a car with 300 mile range that you can ‘fill up’ in 30 mins…well you are wrong :D

Oh and last thing before I talk about trade-offs… the price. I pay about 12p/unit for my electricity (apart from the power I get from my solar panels :D). because I live in COLD England, I average about 350wh/mile in my car, meaning that a mile is using about 4.2p of energy. Not bad

Note that Tesla supercharger prices vary, but are free for many S/X owners. The average rate is about 20-25p/unit. The new ionity chargers are charging 70p/unit so…buyer beware. Its STILL cheaper than petrol though :D

So now lets talk about battery trade-offs, namely the problems of Price, Range, Durability and charging speed.

When designing an EV and its battery these four things are always pulling against each other. Making a stupidly-long-range EV like this 2020 Tesla roadster is easy:

Image result for tesla roadster 2020

You just layer 2 model S 100kwh packs on top of each other (making the car heavier, and a bit cramped), and enjoy a crazy range of 620 miles. The only downside: OMG its expensive (think £250,000 minimum).

At the other end of the spectrum check out this super cheap electric car, the twizy (Starts at £6,690).

Image result for twizy

It has an amazing range of…err…56 miles. Not so good. The trade-off there is absolutely to make the cheapest EV possible, but range (as well as performance and interior capacity is totally sacrificed.

At the less extreme end, here is the Nissan leaf, starting at £26,345. It has a range of 168 miles but is limited to slow 50kw chargers. Its also a bit slow for an EV (max speed 90, 0-62mph 7.9secs).

Image result for nissan leaf acenta

Essentially all these cars are trying to balance out the priorities of fast charging, long range, price and battery lifetime. Pouring tons of energy into a small battery very fast will affect its lifetime. Having a much bigger battery boosts range *and* allows fast charging, but hugely increases cost. What to do!

My personal opinion? Well I drive a 2015 model S 85D, with an 85kwh battery pack. It can take me comfortably 240 miles, or further if I’m careful and don’t drive like a maniac, or if its super warm and sunny (batteries, like petrol cars prefer warm weather). I would guess 95% of my charging is done at home while I sleep, with me only using a supercharger for long trips ( a quick top up with coffee when I visit london, for example). It seems that most EV drivers you talk to are doing the overwhelming majority of their charging at home or while at work, just like me.

So…

The current best-in-class rate of public charging is about 150kwh. Thats VERY fast., any faster would *actually be annoying*, because the current speed lets me grab a coffee and a bun, and a call of nature before returning to the car. I only need to do this on super-long trips anyway and I WANT a break. Even with autopilot, driving is kinda dull. I want to stop and have a hot beverage.

The speed of filling an EV vs petrol/diesel cars is a HUGE red-herring because unlike most petrol/diesel drivers…we EV drivers hardly EVER need to do this. Its a rare thing for long trips only. If it takes us 15-20 mins, we grab a coffee. You don’t have to sit there holding a pump like those old fashioned petrol cars :D

Image result for supercharger tesla

So for me… NO, speed of charge is now fine. I wouldnt trade anything else to get my EV to charge faster, which leaves range, lifetime, and price.

As I said above, the current battery degradation of my 2015 battery is minimal, and Tesla are now saying they are heading towards a million-mile lifetime battery. In short… this problem is SOLVED. We don’t need batteries that depreciate less, we already have that, AND the charging time thing sorted.

So… that leaves a simple two-axis trade-off between price and range. This is something easily solved by the free market.

Every car in tesla’s lineup comes with a standard and long range variant. You can get a cheap(ish) car with good range, or a pricey car with excellent range. Which you pick is basically a factor of whether you drive a lot of long distances or not, and how much money you have. Its important to note that you should NOT compare your petrol-car range to your EV range. Every time you leave the house you have a ‘full tank’ in an EV. This is a game changer, this is huge!

TBH most of the time (including right now) I don’t even bother plugging my car in at home. Its just parked. I always plug in if I know I’m doing a road-trip the next day, or if its getting low on charge, but its certainly not daily. The range on my car is *more* than sufficient for my needs, even though I live in a rural location and its a 15 mile journey just to go to a shop.

Image result for old gas station

I think eventually people will get over this old-fashioned and silly ‘Until an electric car has 400+ miles range I won’t buy’ trope. Thats thinking like a petrol car. You NEED 400 mile range because refueling is a trip out of your way to some specified location. Thats annoying, and inconvenient, and…old fashioned. EVs make every single house a fuel station.*

So to conclude…I’m thinking the correct trade-off is PRICE. People designing EVs need to focus on price above everything else. EVs are STILL too expensive for many people, and a BIG chunk of the cost is the battery. The industry is already making great progress in this area. The huge scale up between 2012-2020 in terms of EV battery production have sent battery costs down lower and lower, and this should continue to be a point of focus.

So for anyone analyzing the EV market…look at who is making CHEAPER batteries, not the biggest or the ones with the fastest charge rates.

And for anyone looking into getting an EV, ignore battery lifetime and charge rate (these are solved!) and don’t get hung up too much on range either). I follow this market super-closely and would say by a HUGE margin, if you can possibly afford it, the Tesla model 3 is the BEST combination of all these factors.

Image result for tesla model 3

If you cant afford that, I’d suggest maybe the Nissan Leaf, but that is a big shift down in terms of spec.

If you can’t afford either hang in there…but do NOT buy an expensive hybrid car. Hybrid is the worst of both worlds. Keep your current car struggling along another year or two and watch decent EVs come down in price even more.

*i know this is currently only for houses with offstreet parking, but roadside lampost charging will come soon enough.

Whenever there are business stats released about games, I always find myself fascinated by what seems to be the huge gulf between the amount of money (and sales) the big games make, and…everybody else. Increasingly I get the impression that the mid-tier games, developed by 3-30 people, are just disappearing due to becoming financially nonviable.

In an ideal world, there would be a perfect path that led from part-time bedroom coder with a day job, right through to full-time bedroom coder, to bedroom coder with a few contractors, to smallish studio, to medium studio…to epic/activision/valve.

I don’t think this is the case these days, but I think its especially bad for the ‘small indie’. I think there is a valley between part-time indie and the BIG indie. lets call it the difference between the $10,000 budget game and the $400,000 dollar game.

At $10k budget, you are likely holding down a day job, or doing contracting part-time. You don’t bother with a website (you just use steam or the apple app-store as your exclusive store front). You likely use coder art, or free art or royalty free art, or a friend helps out. Your marketing budget is zero, you attend no shows. You use the PC you owned anyway, and the game is made in less than six months.

Image result for game developer tycoon
screenshot from gamedev tycoon

At that level, even a few sales can help you break even. Even a cheap $10 indie game *can* sell a thousand or two thousand copies without any marketing whatsoever, as long as you are skilled, you picked a decent genre, you did a good job, and you optimized your store page, did some social media marketing, and generally did the guerrilla ‘no-budget’ marketing thing in evenings and weekends.

At the mid-tier (in the valley). Things get tough. You are full-time, and have an office with 2-4 other people. You suddenly need separate work PCs because of the office, and office furniture, and need to pay rent, and office internet costs, and power, and likely some admin/insurance/employment related costs too. You now have a proper accountant charging at least $1,000 a year. You probably have a lawyer if you are American. You are now paying for webhosting, some unity subscriptions, some money each month to adobe, and to a few other bits of software that in 2020 are inexplicably subscription based.

Your 3 people now have no pension in the UK and in the US, no healthcare, so add another $1,000 a month minimum on top for that, and together with the rent blah blah, you are probably paying $2-$3,000 a month before anybody gets paid. Assuming nobody will actually starve, you can easily look at paying $150,000 a year for your people, and you need to get that back.

But hang on! a 3 person team is NOT 3x as effective as a single dev. They have discussions, disagreements, arguments, confusion. They are demotivated by implementing other peoples ideas. They are distracted by someone who slurps their coffee in the office. They want the office cooler / hotter / lighter /darker than anyone else. They are sad because their cat is no longer at work with them…

I guess a 3 person indie team is the equivalent of maybe 1.5 solo devs (at best). But they don’t cost 3x as much, they cost maybe 5x as much.

Eventually, as you scale UP and UP and UP things work out. Your 200 developer team now has 5 people working FULL TIME to make hilarious / amazing / exciting video and social media content that gets your name EVERYWHERE. Your game design and code is top notch because its got dedicated people working on everything. The number of devs who can compete with you is smaller because they simply do not have the scale or the marketing firepower. You can suddenly employ full-time professional HR and business-management experts who can actually handle people properly, so fewer arguments about heat / light / cats. Productivity has been achieved.

Image result for blizzard developers
Blizzards WoW team

I think WAY too many indies are stuck in the valley of financial impossibility. I’m not sure you can survive with a 3-5 person team any more. if you get ‘funding’ from somebody then maybe, or a grant, or some dumb hardware company has no clue and throws cash at you…yeah sure. But purely on the basis of the free-market… i’m not sure it works.

So how am I still going? (before you ask). Well I am a weird edge-case that is VERY hard to replicate. My magic powers are:

  1. Rural location so no sky-high-rent / distractions etc.
  2. Solo dev for most of career so working from home
  3. Back-catalog of pretty big hits, so cash not that much of a problem
  4. Actually earning decent money from stock trading so…see above.
  5. Age 50, child-free, 39 years coding experience, workaholic. Impossible to compete with that combo tbh..

BTW TOP TIP: people often make a critical business mistake. They look at other people doing X at a company and think ‘they are doing X it must be viable’. It often is not. That other company may be in debt/a multi-millionaires hobby/funded by a spouse/some sort of money laundering scheme. Do not think all those 3-5 person indie teams posting online are surviving. They may well be in serious trouble.

Are my numbers in this post COMPLETELY insane? let me know. Whats the running cost of your 3-5 person indie studio?

I went to see a production of snow white recently (long story). Anyway, it was good, innovative, at times very funny & very cleverly done. It was also THE MOST WOKE PERFORMANCE ever. I could write an entire book about how woke it was, but suffice to say one of the dwarfs had to be sedated at one point because they temporarily ‘lost their mind’ and talked about building a wall, and keeping out immigrants. There was a lot of talk about recycling, carbon-neutrality, organic tea, the patriarchy, gender-roles, body image and so on.

Did I mention this was snow white?

Naturally the dwarves didn’t do any mining, which I guess was against their eco-agenda.

Now I AM a massive environmentalist, and should have found it very funny, and loved all that, and I’m a remain voter so should have loved the jibes at Boris Johnson and leave voters and brexiteers etc…but it was a little bit painful in places to watch it happen. Don’t worry, I will relate this to democracy 4!

(Some environmentally irresponsible dwarfs)

The problem is, the writers had obviously 100% decided that the audience would TOTALLY agree with them on every issue they mentioned. If you were a brexit-supporter, or a conservative, or against gay marriage, or a conservative, or not 100% into identity politics, you would have hated it, but its fine because they KNEW that people can be basically stuck into two camps now: The liberal, bearded eco-warrior socialist europhile pansexual feminist…and everyone else (who are *bad* people). Their view of the world is a venn diagram where two circles do not even touch.

This is nonsense.

The real world is more complex. You do NOT have to *pick a side* and stick to it. You can absolutely pick and choose. Here are some of my own very mixed-bag beliefs and causes:

I support a 100% inheritance tax (in theory), I support a slightly higher top rate tax. I support limits on immigration, I support staying in the EU. I’m 100% an environmentalist. I’m a feminist but have mixed views on positive discrimination. I am against the death penalty, but have no strong view on fox hunting. I’m for electoral reform, proportional representation, Higher salaries for MPs, against a higher-minimum wage, against rent-controls, pro-choice, pro-legalizing marijuana, pro-sugar tax, anti-gun ownership and so on…

I’m all over the place. I’m 100% environmentalist, 75% liberal (less identity politics please), 25% motorist, 90% capitalist, 65% retired, 5% Young, 1% ethnic minority (ancestors were gypsies apparently), and so on… We represent the way people are all-over-the-place in Democracy 4 in the focus groups like this:

(BTW that is another shot of ‘dark mode’ which some people prefer, still a work in progress…)

My point is, that people are complex. There are not just two camps…or at least there never USED to be just two camps, but we are moving that way. In the US, people seem to increasingly be Woke/Liberal/Democrats OR Trump-supporters. You basically have to pick a side. In the UK we are either remainers or brexiteers…pick a side! And this is silly.

NOTHING about environmentalism makes it a socialist position. NOTHING about animal cruelty is left or right wing. NOTHING about brexit or patriotism, or feminism is left or right wing. Its only a recent phenomena that has taken every issue and tried to polarize it and stuff it into these two violently opposed camps.

I honestly do blame social media. People have become so used to picking and choosing ‘the news thats right for you’, that they are increasingly only fed what they want to hear. If you are a fiscal conservative, you are on the ‘anti-environment’ side, so you get fed FUD and nonsense on the topic, even though in many ways conserving natural resources, increasing energy efficiency, and investing in fuel sources that are free is a very fiscal-conservative point of view.

(Famous right wing prime minister Margaret Thatcher in her pro-EU sweater)

Similarly if you are left wing in the UK, you get fed an exclusively pro-EU agenda, even though there is no real link there. Labour party leader Jeremy Corbyn was passionately opposed to the EU his whole life, and it was seen as a tool of neoliberalism by the hard left, until everyone was told to pick a side, and the capitalists had already claimed anti-EU…

Anyone who thinks you can not be a patriotic socialist or a fiscally conservative environmentalist or a right wing feminist has bought into this stuff. Social media is making it WAY WAY worse. The whole design of social media is to make us all ARGUE and FIGHT and oppose the ‘other side’. Its corrosive. FFS stop encouraging it.

In the last 28 days I did 90 Tweets. That number used be around 300. I’m going to aim for it to be maybe 4 or 5, which will be just links to this blog. Social media is tearing communities apart and forcing everybody to be argumentative and abusive. And like I said before, this is all to make a handful of straight white male American billionaires richer.

Website optimization in 2020

January 02, 2020 | Filed under: programming

Sooo… in a random moment of surfing a few months ago I encountered an article of the webp format and how it was faster, and how it was a Google thing, and they therefore wanted you to use it. I knew I had a server move coming up (long story) so delayed worrying about it until now…

Basically webp is like a super-amazing improved replacement for PNG that is MUCH more efficient. Full details here, but for example one of the files I converted to webp went from 942k to 189k which is not to be sneezed at. I still cannot tell ANY difference when I look at both images. Sadly wordpress is too useless to upload webp, but here is one embedded:

…and here is the png:

…exactly.

So with this in mind, I replaced some of the larger images on the Production Line webpage with webp equivalents to speed up the loading. This IS WORTH DOING, but its also worth remembering that some Luddites may be using stupidly old browsers that cannot cope with webp, and you need to also have the option of a png for these people. You can do this with some magic modern html like so:

<picture>
	<source type="image/webp" srcset="images/thumb.webp">
	<img src="images/thumb.png" width = "1000" height="563" >
</picture>

That basically says ‘show this webp image, unless you don’t have any idea WTF that is, in which case here is an old fashioned png. All of the attributes for your image still go in the src bit.

That got me a nice speed bump, but some test done both with googles site checker and also the popular web speed test showed I was mainly slowed down by third party stuff, specifically humble bundle widget and youtube embeds. (I embed 2 large youtube videos on that page). This is annoying, but after a lot of fiddling I found a reliable way to get around the slow youtube stuff.

What I did was have 2 identical sized elements on the page for each video. One a ‘panel’ and the other a ‘vid preview’, which was basically a big thumbnail made by me (webp obviously) with a fake play button to simulate youtube. The code in the actual page body looks like this:

<div id="panel">
<table width="100%" align="center" cellpadding="0"cellspacing="0">
	<tr>
	<td align="center" width="1000" height="563">
	<iframe id="trailer_youtube" width="1000" height="563" src="" frameborder="0" allowfullscreen></iframe>
	</td>
	<tr>
</table>	
</div>
				
<div id="vidprev">
<table width="100%" align="center" cellpadding="0" cellspacing="0" onclick="myFunction()">
	<tr>
	<td align="center" width="1000" height="563">				
		<picture>
		<source type="image/webp" srcset="images/thumb.webp">
		<img src="images/thumb.png" width = "1000" height="563" >
		</picture>						
	</td>
	<tr>
</table>	
</div>

In practice what this does is say ‘here is an embedded iframe called ‘trailer_youtube’ with NO source. And here in the same place is a big phat image. BTW if we get clicked call myFunction()’.

Then at the top of the page in the header we add some code:

<style>
#panel, .flip {
  font-size: 16px;
  text-align: center;
  color: white;
  margin: auto;
  z-index:1;
}
.vidprev
{
z-index:2;
}
#panel {
  display: none;
}
</style>

…which sets the z index (bottom to top stacking) of the two panels, and then we need some actual code for when the thumbnail is clicked on, also in the header:

<script>
function myFunction() {
  document.getElementById("trailer_youtube").src = "https://www.youtube.com/embed/IhGTKBAC94c";
  document.getElementById("panel").style.display = "block";
  document.getElementById("vidprev").style.display = "none";
}
</script>

…that code basically grabs the youtube panel, sets it visible, and assigns it a proper valid youtube link, handily deferring any connecting to youtube.com until we need to. it also hides the thumbnail. The result is a MUCH faster page load (roughly half the time).

In addition, I used some javascript called ‘lazy sizes’, to make the loading of some items lower down the page asynchronous, so they wont even get loaded until the visitor scrolls down. source:

<picture>
 <source type="image/webp" data-srcset="images/resources.webp" class="lazyload">
<img data-src="images/resources.png"  class="lazyload">
</picture>

and that requires an extra include:

<script src="./js/lazysizes.min.js" async></script>

The result is pretty good, and raises Google’s estimation of my site speed quite a chunk. That will be good for SEO with Google, and they are basically the only search engine that counts so…yay :D. here is the full waterfall chart: