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

Equipment breakdowns in Production Line

Something that I have always wanted to have in Production Line (and which is popular with the players as an option) is the idea of equipment breakdown and reliability. If you have played the game already you will know that having a sudden ‘stop’ in the line is incredibly disruptive to output, and thus profits, so introducing the risk of breakdown would make for an interesting game mechanic. With this in mind, I’m starting to think about implementation.

So to start with, what are my design goals for this new feature in the game? I see them as these:

  • Add a new random event to shake up late gameplay.
  • Add a new research tree option or options to improve reliability
  • Add a new consideration regarding factory design and layout.

Right now, there is a slight problem in that, until world events get coded, the late game is one where you can simply leave your factory to run endlessly at a profit. In some ways, this doesn’t matter, as factorio has proven, the real goal is building fun and efficient layouts, not just achieving a set goal. However, it would be nice to have something that interrupts this otherwise fairly predictable process, so having a key production slot break down would be an interesting way to do this.

New research options are always fun, but I’m not sure which way to go regarding the reliability and repair stuff. On the one hand, I could offer slot-level upgrades which allow the player to (at a cost) buy more expensive robots and parts to reduce the chance of that slot breaking down. On the other hand I could introduce a global factory wide system of researchable upgrades which boosted the reliability of the entire factory? The second option is perhaps a little unbalanced because in the real world, such research would lead to systems whose cost scaled up with the factory size. I already have some upgrades that are ‘one-shot-regardless-of-factory’ like conveyor speeds, and in retrospect, these seem perhaps a little too generous. I should probably avoid expanding that.

 

 

So that would leave me with perhaps the idea of a series of ‘reliability’ upgrades for every slot in the game. Maybe ‘Enhanced maintenance’ ‘Error monitoring system’ etc, which when purchased at a slot would progressively reduce the chance of a breakdown. This might make for interesting decisions because for example if a single paint-dryer in a line breaks down, thats no big deal, so you could avoid paying for that upgrade, but if there is a single point of failure thats critical to the whole line… maybe it would be worth it.

This all leads into my final goal and would make it more sensible to plan for multiple lines, or at least partial lines, as a hedge against single line failure. I sometimes design my factories with parallel lines with cross points, which would allow production to route around broken down slots just like the internet routes around failures.

So given that I want there to be breakdowns, and researchable techs that reduce (but never 100% eliminate) them, how should the actual mechanics of a breakdown take place? The simplest and cleanest implementation that occurs to me at the moment is to give each slot a chance of a breakdown per minute of game-time.  If we assume each slot has a 99.5% uptime, then we are talking about a breakdown of ten minutes every 33 hours.  Very large factories could have maybe 200 slots, which would mean one of them was always broken and in need of repair. That sounds reasonable? (alternatively I could tie breakdown chance to time spent actually running…which makes more sense).

This allows for two different upgrade paths in terms of dealing with reliability. We can have research that decreases the chance of a breakdown, and research that decreases the duration of a breakdown. It would be interesting to have the chance upgrades be a per-slot thing (I’m thinking better engineered robots, better designed processes at the slot…) and the duration upgrades being global (maybe a better trained maintenance team to attend to the breakdowns?).

 

 

In terms of GUI, I’m thinking a new slot status notice (like we currently have for ‘no export room’ or ‘not connected to resources’ ) saying “breakdown!” and possibly a timer next to it (more realistically a circular progress count down thing?) showing how long it will be out of action until the breakdown is fixed. So with that in mind, here is my first-pass thoughts about how to implement breakdowns and reliability into the game, as a todo list for me:

  • Add a base chance for any slot to breakdown and make this trigger a breakdown of some random duration range (say 7-15 minutes?)
  • Add a new global variable for ‘breakdown repair efficiency’ which can be changed by global research items.
  • Add new researchable technologies to reduce the duration of breakdowns.
  • Add new upgrades for each slot that reduce the likelihood of a breakdown.
  • Add new researchable technologies that enable the purchasing of those upgrades.
  • Implement a nice GUI to show breakdowns when zoomed in and when zoomed out.

There are of course a bunch of other options, such as adding a repair-cost that gets auto-deducted when a slot is being repaired (but what if that sends you bankrupt? surely needs to be optional…requiring more GUI…), or requiring new repair-shops to be placed down to ‘unlock’ certain upgrades (but then can you delete them after the upgrades are in effect?). The system as described relies on the player accepting that a ‘hidden’ global variable (breakdown duration and chance) really is changing, unless I add yet more GUI options to show this to the player.

As I type this I realize there could also be the possibility (maybe as a secondary feature to code), of slots ‘silently breaking’, in that every car they work on produces a defect…This would be a bit evil, but also pretty cool, as you would have to introduce regular QA to track down the cause :D)

My biggest fear, (as should always be the case with Early-Access) is that I could screw up and make the game *worse*. I don’t want to make the game unbearable at the start (where a single slot breakdown may be more critical), but then I don’t want to make the game too easy in the late game either. I could just *cheat* and not let slots break down at the start of the game, and actually more realistically, I could just give each slot the first 48 hours or so to be totally free of breakdowns (makes sense as they are new…). Ideally breakdowns become a serious concern, but not annoying, which is an incredibly thin line to walk.

I am as usual always interested in peoples thoughts on this as a new mechanic for the game.

 

An open letter to my liberal friends

I have friends all over the political spectrum. Some of my friends have other of my friends on blocklists. I’ve seen the most antagonistic yelling between people I know on twitter many a time. I recently sat and chatted to an older friend who said stuff that would make my more liberal friends spontaneously combust (they meant well…attitudes change over the generations). When I was young (teenage) i was VERY left wing. Now…I describe myself as a liberal capitalist environmentalist. I feel I can criticize and support positions from all over the spectrum. I don’t feel a need to pick a ‘team’.

So… Theres something I often feel like yelling at my more liberal, left-wing, right-on socially conscious buddies, but I never do it to their face because…I’m actually a fairly agreeable non-conflict person most of the time in real life. So here goes..

FOR FUCKS SAKE STOP FLYING.

Now for the nuance…

If you read my blog you will know I’m a pretty passionate environmentalist, a big fan of electric cars and solar power (and wind power). I invest in a lot of green tech, and I try to be as green as I can in the way I live. This is not without its struggles. On the one hand..I am not a vegetarian…on the other hand, I have no kids, and I drive an electric car. I added it all up once and I’m definitely carbon negative. I’m offset up to my eyeballs, so I shouldn’t feel bad about my own impact on the environment. I recycle, I have LED lightbulbs everywhere, yada yada.

The thing is, a lot of my liberal buddies who also recycle, who also have LED lightbulbs, who also think renewable energy is a good idea, and also say they care passionately about the problem of climate change turn into absolute hypocrites the nanosecond there is an excuse to jump in a plane. Not only do they all fly places without giving it a second thought, they seem actively CONFUSED when you point out that regular plane trips are pretty much the most environmentally catastrophic thing you can do. To put it bluntly, you can wear vegan shoes, only ever eat avocados, and contribute $5 a month to greenpeace all you like, but if you make unnecessary plane trips you undo that good work about a billion times over.

Some stats: (source: https://www.carbonfootprint.com/calculator.aspx and others)

  • A return flight, economy class, from London to San Francisco: 1.38 tonnes of CO2
  • 10,000 miles in a 1.5 liter car: 2.61 tonnes of CO2
  • Eating a cheeseburger every day for a year: 1.58 tonnes of CO2
  • Using aircon all year round:  1.44 tonnes of CO2.

Now obviously you may use more aircon, or less aircon, and you may eat lots, or very few cheeseburger, and you maybe drive a bit less or a bit more, but what people seem to forget is that every time you do a transatlantic flight, that’s the equivalent of 365 cheeseburgers. Your vegan car seats and fondness for avocado go straight out the window if you take just a single transatlantic trip. Instinctively, people are aware that flying is ‘bad for the environment’, but the true scale of it is never acknowledged. The next time you book a flight, realize that climate-change wise, what you are doing is effectively whacking the aircon to max, or stuffing down daily burgers for a whole year.

Now..I’m not exactly untouchable here, as I fly across the Atlantic myself, although I try very hard to absolutely minimize it. I have gone to GDC each year for the last few years, and gone on holiday in south America (and soon will go on holiday to Canada). I do fly a LOT less than most people in my position. I’d never fly domestically in the UK (hey..we have cars and trains!) or France, Germany, Belgium etc. We can drive anywhere in Europe. If I go to GDC I will not fly to any other trade show. I’ve never been to PAX or DICE or to Gamescom. I go to EGX, Rezzed and the PC Gamer weekender sometimes (all drivable). Thats more than enough.

And where possible, if  I can combine one of those biz trips with a holiday, I’ll try and ‘get the most’ from my flight. When I went to Detroit to visit a car factory, it was on the way home from GDC, for example. (with a pit stop in new york to see a friend).

So I’m not saying *do not fly* as much as I’m saying ‘for fucks sake, only fly when there is no other option’ along with ‘think about the consequences a bit more’. I’m lucky enough to be in the position that I could fly to the Caribbean once or twice a year for a weeks chilling out. I LOVE the Caribbean, and the ONLY reason I dont do it is because of CO2 emissions. Those two schools we built/are building in Cameroon? I’ll never see them. never. I can’t justify the flight. I understand why people who dont believe in climate change fly everywhere. What I dont understand is why people who claim to understand it, be concerned about it, and keen to do something to prevent it, think that they can ignore it when they want to jump on a plane.

You really cant.

 

 

 

 

 

Slow file access

If you read my blog often you will know I can be very irritated by poor performance in my code, or for that matter, anybodies. Firefox is possibly the most memory-wasting application in the known universe. Quite why it needs >3% of my entire CPU right now for me to just type these characters is beyond me. Despite this, such performance is not ‘noticeable’ in the same way that a sluggish GUI can be. When you click a button in a game, the resulting action needs to happen IMMEDIATELY for you to feel like you are using the interface, not fighting it. Thus when launching a dialog box in a game, the aim is always to have its initial loading time to be as minimal as possible. often thats easy, sometimes…not.

When you click the ‘load’ button on the main menu of Production Line (my latest game), it loads a dialog with a list (scrollable) of windows for each save game on the disk. There are thumbnails for each one showing the screen grab from when they were saved, plus some data about each save game. Example:

 

This probably sounds like it should be pretty fast to create, but actually its annoyingly, painfully slow. Before you ask, yes I do the initialisation ‘lazily’ in that I am not loading in textures for the save games until I draw them, so the ones that are currently not visible due to the scroll position have not slowed me down. Actually the slowdown is much simpler than that.

There are currently 25 savegames in my list, in a folder with 50 files (a thumbnail for each one is in the folder too). The files range from 600k to 176MB for the actual save games (XML format) and the thumbnails are tiny 50k jpgs. Why so slow?

At the very least I need to query data about 25 files here. The dialog box puts them in order of creation, and to ensure its really accurate, I dont use windows file attributes but actually crack open the XML to take a look at the header data inside. At this point, I extract the date, and time, and do a version check to reject super-old unusable saves. I strongly suspect that the delay I sometimes experience (only when I’ve been doing other stuff, and the files are not in the cache of the hard drive, or in windows RAM already) is actually not even the reading of the files, or the enumerating of them (50 is not many) but the accessing of them.

When you access a file in windows quite a lot of behind the scenes crap happens. Drives may have to be spun up (or not, depending on tech), maybe even network shares may have to be connected to (not in this case), maybe wireless network drivers need kicking out of sleep. Windows needs to check that you have permission to access that file, to compare the desired access against permitted access. It needs to navigate a chain of block links if the file is fragmented on disk, and as it does all of this, the users anti virus program will kick into gear, scanning the file (maybe even the entire thing, like my big 176MB xml?) for malware.

All of this takes TIME.

The worst thing is, this stuff all happens for each individual file, which is why game engines tend to use pak files. (I have support for them in my engine, just not using it yet). The problem is, users save games are one area where you likely really cannot use them. These are files created by the user, and its often helpful (especially during beta) for them to be simple files the users can access, delete if necessary, copy if necessary, email to the dev if necessary. So pak-filing them is not an option. There are many hacks I can think of, including maintaining a summary of the games in a single file I can update lazily at another time, but nothing that doesn’t generate more complexity and potential for bugs.

One solution, if I was really bored and desperate for speed, would be to embed the jpg into the xml, so that the umber of files instantly halved. Certainly a future option. I could also swap to compressed save games that were likely 1/10th (or less) the size, which would make debugging them a tad harder, but would mean much less raw data for windows and file-scanners to deal with.

I’m definitely not happy with this tiny, tiny (under half second) delay when you click that button :D

Playing a ‘role’ on social media

I have a superpower, which is effectively useless. I may have mentioned it before. I have an uncanny, even seemingly impossible ability to memorize dialogue from TV shows and movies, even if I’ve only seen them once, depending on the style of the show. Sometimes its even from shows I just overhear and don’t watch. Its strange. A line of dialogue that comes to mind to me today is this, said by Toby in the west wing:

I asked him about his vote, he told me, I said then if he's asked about it
tonight he
should and only because it's the easiest thing to remember, tell the truth.

 

I like this quote, and I like to broaden it out to a general principle, which is, if you want to make life easy for yourself, you should, because it’s the easiest thing to do, be yourself. I think this applies pretty strongly to social media.

I was chatting to a dev recently about social media profiles, and what you should put on there in terms of your Bio, and whether you should admit to this, or highlight that… and it got me thinking about the fact that I never really bother spending too much time thinking about this sort of thing. The ONLY exception I make, and the only situation where I edit myself, or pay any attention to what I’m sharing or talking about, is that although I’m married, I don’t mention my wife a lot on social media, because I do not feel like I have the right to include her in any public discussion without explicitly asking her. Its generally good form to let people stay in control of their own privacy. I also dont make that many references to exactly where I live…because there are crazy maniacs out there, so why risk it?

But in terms of everything else, I’m pretty much ‘me’ on social media, and I thus tend to ‘enjoy’ it more than many other game devs I talk to. I do *not* spend a lot of time thinking about ‘what to tweet’ or ‘what I should write a blog post about’. My twitter and my blog are basically my diary, and my chats in bars with buddies. I’m not writing the Gettysburg address here, and I dont think what I type here will accelerate or destroy my career in a single paragraph.

There is a brilliant ‘German living in England’ comedian called Henning wehn, who makes a whole career out of affectionately mocking his own Germanness, and he has a great line, which I find very funny, and if you don’t see that its funny, I think you might be taking it the wrong way:

“I’m just one accidental holocaust denial away from ruining my career”.

Which if anything is mocking people who cant see that they are being offensive, whilst also giving a nod to the English view of Germans. He also has a lot of jokes about stalingrad, I’ve seen him live twice, he is awesome.

Anyway…

My point is, you ARE NOT going to lose half of your steam revenue because you say something mildly controversial on twitter, or because you admit that you enjoy a certain band, or comedian, or that you eat meat, or you are gay, or bisexual, or trans, or black, or white, or anything else. 99% of your customers don’t follow you on twitter, and 99% of those who do follow you because you make games/art/whatever. If you are a republican, or Christian, or communist, or animal rights activist, then fine, thats part of YOU, thats the honest YOU. Unless your hobbies include serial killing you are unlikely to shock people with revealing the true you, so go ahead and do so, its incredibly liberating. Plus people are easily blocked and muted on twitter anyway.

I do all of my weekly blog videos in one take, unless something catastrophic goes wrong. I’m not going to go back and edit out things I said that were dumb, or if I swear, or I make an unfunny joke, or I screw my face up and look baffled. I am an unfunny dumb guy who often looks baffled and forgets what he started talking about, and letting me do that on video makes video recording a breeze.

And yes, a non-trivial proportion of my twitter posts are made after a drink or two (especially the really bad ones). I still (sort of) remember this night:

..and hey, thats fine. This is what I’m like, and I think people prefer to really know someone is a real person rather than just a stream of PR fluff like:

“We at positech are so excited to have #ProductionLine in this years #SummerSale. Its our most popular SKU, going forwards.”

Who cares?

And I don’t think it really matters to have some politics in your social media. I don’t hide mine. I’m a liberal-minded capitalist with a passion for environmental issues. I’m sat here typing this wearing a Greenpeace t-shirt and not afraid to say so. You might hate my views on tax, or dislike Greenpeace, or think I swear too much, or be shocked I’m an atheist. Thats cool. everyone’s different, but it makes little difference to whether or not you will enjoy playing production Line, and I’d rather be honest about who I was than spend half my life trying to play a bland inoffensive ‘role’ to add 0.1% to my income.

Be yourself, its not as stressful as trying to be something else.

Youtube: A nightmare for introverts, a playground for the young and attractive

For some context, I’m 48 years old, I’m a game developer who makes and sells PC strategy games, and promotes them through various means, including youtube trailers and a weekly developer video vlog which can be found here.

I worry about youtube. Not just youtube, but the growth of video content in general, and the growth of super-HD globally available video content more than anything. Not in the default ‘new things scare me!’ way, but because I think they are probably skewing society in a way that is harmful, and I see this through the lens of someone who produces a weekly vlog, and occasionally looks at others.

When I was a young gamer, in my teens, there was zero content when it came to covering my hobby. Gaming was for kids (definitely) and the geeky ones at that. I’d guess more boys played games than girls then. The idea of a gaming ‘celebrity’ did not exist of course, because it was pre-internet, let alone the idea of making a living from playing games, and the idea of people knowing who you are, who did NOT go to the same school as you was not even out there. Unless you were Michael Jackson, you were not known to anyone outside you local school as a kid. Not only was fame when really young not achievable, it wasn’t really on anybodies radar. If someone at your school found you attractive, that was great. You could be the best looking person in school I guess, but that sample size is pretty small. I’m reminded of the most beautiful girl in the room:

Gaming now is very different, and video content is very very different. One of the most well known youtube celebrities is ‘Zoella’ apparently. She has 12 million youtube followers, and her net worth is estimated at £2.5 million. She started her youtube channel is 2009, aged 19. PewDiePie is one of the best known gaming youtubers, with 63 million youtube followers. His net worth is estimated at £20 million. I have never sat and watched a whole pewdiepie or zoella video (I’m BUSY), but something stands out about these two, and all the other super-well known youtube celebrities.

They are unusually good looking, and started pretty young.

There is a MASSIVE culture of youtube videos about how to put on makeup. HUGE, like TERRIFYINGLY HUGE. If you wonder why on earth your teenage daughter has the capacity to sit and watch youtube videos for ten hours straight, its because there is a vast, vast rabbithole of this stuff. And if you think its a female-only culture, think again. This ‘one minute beard grooming’ video has over a million views.

When I was in a heavy metal band, I sometimes had a beard. Sadly very few pictures exist, but you know how much ‘beard grooming’ I did? Fuck-all. I occasionally picked out clumps of paint or sawdust from work (I built boats), and that was it. And believe it or not, despite this horrifically minimalist beard-grooming regimen (by modern standards) I did actually meet girls and even slept with some. AMAZING! How could anyone as rough and un-groomed, un-sculptured, with imperfections and a complete lack of a daily skin-care moisteurizing regimen, ever be happy or meet anyone?

It was easy, because frankly our standards were more localized. If I thought I was as attractive as the average dude in the pub, or the average boy at school, then…yeah thats pretty good. I didn’t obsess about my looks or seek out a completely impossible level of perfection that young people do now. I am SO GLAD that we did not have youtube, and social media when I was a teenager. the amount of angst, anxiety, body-image issues, self-confidence issues that I have avoided by simply not being exposed to so many attractive, confident, well-lit, perfectly edited and filmed people who modern day teenagers consider to be ‘just like them’… I feel so lucky.

Anyway, my broader point is that we talk a lot about fake news video, we talk a lot about racist or mysogynist or other hate-fuelled video content, and I think society needs to also take a look at the more subtle confidence and body-image effects that exposing young people not just to the most charismatic and beautiful people in their class (which is depressing enough), but in a class of a BILLION people, is doing. And do not think that because your kid is smart that this isn’t applying to them. I have a confession to make: I worry about how I look in my youtube videos. Should I get my teeth whitened, should I have that tiny lump on my nose lasered off, should I get a hair transplant even… and I am a married fourty eight year old man. What.The.Fuck.

I can only imagine the impact this youtube culture has on teenagers.