Loading...

Follow Cliffski's Blog on Feedspot

Continue with Google
Continue with Facebook
or

Valid

If you follow me on twitter you will know I bang on about electric cars a lot, specifically Teslas, and why I get angry at the FUD and nonsense spread about them online. Why do I care?

Lets get the disclaimers out of the way. Yup, I own one (A 2015 85D Tesla model S with autopilot 1) and yup, I own some tesla stock. Obviously I am biased because I don’t want people to criticize my purchase choice (I am human) and because I have some financial interest (although TBH thats a relatively minor concern. I have stock in Microsoft and Nvidia too but I don’t bang on about em…). So given those obvious points, why else do I care?

Climate Change

First up..the obvious one. Climate change is real. Its also predominantly caused by humans, specifically CO2 emissions, and if you actually ‘do not believe’ that, then please think about what other widely accepted scientific conclusions you would like to dispute. Maybe you don’t believe in magnetic forces either? or perhaps even gravity? maybe the earth is not a sphere but flat? There is a wealth of scientific consensus on this, and you should not only accept the fact, but be absolutely terrified of the consequences. Don’t think about ‘it getting a bit warmer’ think about agricultural yield collapse, food price spikes, food-rioting, mass immigration, resource-wars and global upheaval. This should scare the crap out of you…

…and one of the things we as individuals can do is switch to a cleaner form of transport, notably: an electric car. They are not practical for everyone right now, but will be very soon, and once you buy one you dramatically cut the amount of CO2 you personally are stuffing into the atmosphere. Its a great way to do your bit.

Pollution

Secondly…Pollution. EVs not only emit no CO2 at the tailpipe (and electricity grids get greener every day), but also zero fumes or pollutants of any kind. That means cleaner cities, quieter roads (less noise pollution!) and fewer kids with asthma. And the car behind you on the road is no longer sucking up your exhaust fumes and blowing them into the driver & passengers faces. Plus the newer teslas have HEPA filters in that mean the air in the car will be substantially cleaner than the air outside. ideal for polluted cities.

People sometimes repeat some FUD about cobalt, implying its all from congo, and batteries are full of it. Actually its a mere 3% now, and dropping to 0% soon. Plus its dramatically less of a problem than the impacts of oil dependence

Convenience

This is the one people just do not get, and will NOT accept…until they own an EV. The caveat here is assuming you have off-road parking at home, OR you work somewhere that has an EV charging point in the car park. (This is getting much, much more common).

Charging an EV is super-cheap (here in the UK I work it out to be just under £0.04 per mile in ‘fuel’, assuming 100% home charging), and actually MORE convenient than owning a petrol/diesel car. The fact is, with an EV, you have a fuel station *at your house*, and it can fill up while you sleep. In some cases you can set the car to charge during off-peak (cheaper) electricity times! The fact that the car charges while you sleep means every day when you get in the car, it has a full battery, so you can drive maybe 200-240 miles before recharging (real-world range in UK).

That 240 sounds low compared to your petrol car, until you realize that petrol car has to go to a special recharging place to get fuel (which costs a fortune), and where you have to stand there like an idiot holding a trigger to fill it up. Oh BTW that fuel is smelly, environmentally damaging and catastrophically dangerous.

On the average day, you do NOT drive 240 miles, and if you *do*, you are likely on a motorway, where you can stop and charge your car (still cheaper than petrol) while you grab a coffee and a donut. Charging speeds are getting faster than ever:

TBH, like 99% of tesla owners, even though I have access to the amazing supercharger network (which the car auto-navigates me to if it thinks I need power), I hardly use it, unless I drive to London and back with passengers in the car. Even then, I don’t *wait* for it, I just pick up an extra 50-60 miles while I have a coffee that I’d have stopped for anyway. No queuing to pay, no holding a pump, no logging in or barcode scanning, just stick the cable in and go grab coffee…

Technology

Electric cars have phenomenal batteries. These are NOT the same as the batteries in your mobile phone or laptop. They do not noticeably lose any charge (in fact the range of my car has gone UP since I bought it…thanks free software upgrades over the internet!). You do *not* have to give even the slightest thought to replacing your battery. You will likely need several new batteries for your old petrol car in the same time that you would notice even a minor degradation in your EV range over time. Battery tech in 2019 is amazing.

Performance

Holy crap they are fast. You might not care (I only care a bit), but since owning my EV, going back to my wife’s car (lexus CT200H hybrid) feels like driving a horse and cart, even in ‘sport mode’. EVs have instant power, real throw-you back in your seat with some force’ levels of power. For real car-geeks who want something sporty, trade in your petrol-car now, its history.

Tesla roadster Fastest stock vehicle in the world! - YouTube

Maintenance

LOL. Whats that? I’ve owned my car 3 and a bit years now. It had an intermittent screen problem which is being fixed this week (under warranty), but apart from that and a minor thing with one door handle (see above, fixed), nothing has gone wrong. It was serviced once, but TBH it didn’t need it. Annual service? LOL. why? whats going to go wrong? the exhaust (nope)? radiator (no)? the drive shaft? (no)… EVs are actually WAY simpler than petrol cars. They are electric motors, a battery…errr and seats and doors I guess. The maintenance costs on them are *trivial*. Oh and satnav updates are streamed automatically while I sleep. For free, obviously.

The Future

Tech like EVs represent tipping-points. Right now they seem niche, but the sales are accelerating FAST, despite a super-well-funded FUD and bullshit campaign by multiple dying industries. Right now finding a petrol station for your old-tech car is easy, ditto a mechanic but that will crossover soon. The future of cars is undeniably electric, and we aren’t far off the point where the re-sale value of a petrol car starts to drop when people realize their next car will be electric, even if they won’t be able to buy one for a few years.

Safety

The top 3 safest cars on the planet right now? All EVs:

…oh and no engine in front of you means your body is not crushed in a front impact, plus the whole front of the car is a crumple zone. And the battery in the floor makes them bottom heavy, meaning they *do not roll*. Oh and I nearly forgot the complete lack of 50 liters of highly flammable liquid that just isn’t in an EV. You want a safe car? You want an EV.

Oh and BTW all electric cars are automatics. Learning to operate a clutch and a gear stick is so 1970s. This isn’t a skill we need to bother learning soon. I thought I’d hate an automatic but OMG I love it. Assing around with gears feels like being in some costume drama fiddling with cumbersome stupid old technology for a joke. I don’t miss it one bit.

I feel very strongly about electric cars mostly because there are so many lies spread about them. Mine is my favorite purchase of all time, except perhaps my house, and I’m not a car guy. I still don’t really know what torque is or what any bits of a traditional car do, nor do I care. But I like cutting edge tech that is so cool it makes you laugh out loud.

If you ever get an opportunity to try one, do so. Even the harshest skeptics are won over the minute they drive one.

BTW if you do buy a tesla, using this code ( http://ts.la/cliff7605 ) gets you some free supercharger miles. I already have unlimited for buying an early one, but at the time of writing this earns you 1,000 free miles.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

People do not want to hear this. It will not be popular. There will be denial. I have spent a long time, in phases over the years, in denial about it. I have wanted to believe it was not true, because realizing the truth is often very depressing, and if you are like most passionate and committed indie devs, you associate a lot of your personal self-worth with the success of your game, and you absolutely do not want to hear what I’m about to type. You may disagree, you may REALLY disagree, and for all I know, I may be wrong, I’ve certainly been wrong many times, but I assure you that when I type this, it is absolutely what I believe to be the case right here, right now in 2019 making an indie game for the PC.

The #1 metric for your indie game, in terms of determining its success is how good it is.

There. I said it. Unleash the rage hordes.

There are a whole host of reasons why we may try to argue that this is not true. Maybe luck is the biggest factor (seriously? you can do better than that, especially as some developers,/studios then seem to be weirdly consistently lucky…), Maybe its marketing spend (definitely a factor, but not #1. what was minecraft and flappy birds marketing budget?), maybe its nepotism and who you know? (really? was notch super-connected? was he a regular at GDC parties before minecraft) Maybe its originality (seriously? is rimworld a huge hit because of the original art style?) Maybe its timing? (seriously? when did making a game about income taxes gel with the zeitgeist of gaming tastes then?)

Face facts, we WANT the reason for a games success or lack of success to be something OUTSIDE our control. We want it to be something that we can shake our fist at, and complain about to our friends down the pub. “My game would have been a huge hit, if only I was friends with Mike Bithell, or if I lived in San Francisco, or if I had a bigger art budget, or if I had released it a month/year/decade earlier/later.”

I’ve made loads of games. Seriously loads. Many more than people realize. have you tried Kombat Kars, Space Battle 3001 and Kudos: Rock Legend? Probably not, but I’m responsible for all of them. None of them did that well, and they all kind of suck. I did a game called Planetary Defense, which kinda did ok considering the super-short dev time. It was ok, but the gameplay was fairly shallow. Kudos:Rock legend couldn’t decide if it was serious or casual. Kombat kars was hampered by my total lack of understanding physics programming. Space battle 3001 looked like someones first space game, and played like it too.

There is an absolute art form, to which many devs acquire olympic style skills, to come up with reasons that your game failed. People could write whole books on all the various outside factors that were beyond their control, which meant that inexplicably their last game was not a success. Its quit impressive to see the mental gymnastics. The only factor that is never considered? The actual game. maybe the game is just not good enough. It might be good, but not good ENOUGH.

Its a topic for a whole blog post in itself to explain why if you game is 90% good enough you will get 10% of the sales, when its 95% good enough you get 20% of the sales and when it hits 100% you get 100% and buy a sports car. Just trust me, its true, I have long experience of each stage of that.

And now before you hurl abuse at me, I’ll explain the nuance of what I mean when I say ‘not good enough’. Its probably not polished. The gameplay is not balanced just right. The tutorial is not good enough. The player options are not comprehensive enough. There may not be enough content. The art style may clash. The sound effects may be annoying. The music may be too repetitive, or annoying. There may be big obvious missing features where players expected things to be in the game. There may not be enough tooltips or hotkeys. The translations may be of poor quality. The performance may suck for some players., and so on and so on…

Production Line was started over 3 years ago. about two years ago it was a good game I was very proud of. it got better and better during early access. it was released this year and I considered it to be a very good, polished, high quality game. It got extremely good reviews. I could easily have moved on, but I have not, and I’m still working on it every day. It is not good enough. It is very good, and has made a profit, and sold a lot of copies, but it is not good enough.

I’m on update 76 right now (started working on it today), which is based around changes to some charts and graphs that display data about the component import costs. This is a tiny part of a tiny part of the game, but I am aware that its a bit obscure and confusing and some players have said so. The games reviews are very positive and the vast, vast majority of players have no problem with those charts, or do not care, but some players think they suck, and dispassionately I agree. They need to be made better.

That wont be the last thing I improve or tweak. I’ll be working through my polish list for a long time. As I work more and more on the game, and finesse it more and more, the sales go UP not down (as is the curve with most indie games). I’m not awaiting the imminent demise of the games sales, but the absolute opposite. I’m 90% there and heading towards 100%. Quality is all that matters.

I know this isn’t an option for everyone because: experience & economics. Not everyone has 39 years of coding experience, not everyone has a financial cushion that allows them to spend a bit longer to make a game higher quality. I know this. I know the position I am in, very acutely. The reason for this blog post is not to criticize but inspire. I want people who are struggling as indie devs to do well, and I feel thats best achieved by pointing out the truth.

We all lie about ourselves, even to ourselves. I think I am much funnier and better looking than I really am. I also think I’m thinner than I am, and probably kid myself I have some hair. We also lie about stuff we do, and stuff we make. The problem is, when your own sense of self-worth and your own pride get in the way of seeing reality, you are doing nobody any favors. Your indie game is probably not good enough, and deep down, you know it.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

There is a disparity between the information people outside a creative industry have, and the truth about working in that industry. This is because the views of people who are very successful in an industry get more coverage, both through conventional media (because reporting on what multi millionaires like Adele or Tom Cruise or Gabe Newell does gets more clicks) and organically through media like twitter, where we naturally follow ‘celebrities’ who are inevitable wealth and famous.

(I am as guilty as anyone. I follow Elon Musk and Brad Wardell and Mike Bithel on twitter. If you are a struggling indie who hasn’t had a hit game ever, I’m unlikely to follow you unless I know you personally…partly because I just *do not know who you are*.)

To compound the problem, there is the whole issue of ‘fake it till you make it’, where indies and other creative types project a false narrative of success in the hope that success will breed success. This is just playing to human nature, and is understandable as a marketing strategy, but its damaging in terms of giving the false impression to people who want the real facts.

And to add to all these factors (as if they were not enough), we have a natural human tendency to want to place emphasis on our successes and minimize our failures. I am much more likely to tell you about all those times I did a share deal and made money than admit just how many times it went badly, badly wrong… This is just how humans operate.

The reality is that there are a number of big downsides to the freelance/self-employed/start-your-own company life that probabl;y need re-emphasizing from time to time. Here are the big ones

Low income

You probably, on average, will not make much money as a game developer, writer, artists, actor or any other creative pursuit. Its just harsh economics. Lots of people want the jobs and few are available. by jobs I also mean sales, so lots of people want a hit indie game and there are only so many buyers. Simple market forces mean most people do badly. In this article in 2018, Mike Rose found that 82% of indie games didn’t make their creators the minimum wage. What makes you so sure you are in the top 18%?

Unstable Income

People often equate unstable income with ‘you earn $5k one month and $3k the next month. sheesh!’ but the reality can be way worse. Think more like this: You earn $32k one month, and then absolutely zero for a year. Or maybe two years. Can you be *that* disciplined with money to live like that? I’ve seen my own income double in one year, then halve the next year, and I’m a stable indie with 20 years experience and many shipped games.

A typical indie games far-from-stable earnings

Isolation

You may well work from home. Whole days may pass without you talking to anyone. You have no work ‘colleagues’ and no workplace chat or gossip. There are no social groups in the evening of people grabbing a quick drink or food after work. There are no workplace parties or works events or trips. You may do 95% of your socializing through a web browser. Not normal or healthy

Financial Planning

You will not have an employers pension, so should set one up. How do you do that? Can you get a mortgage? how do you prove earnings? Who gives you a loan when your income is so unreliable. How can you set up things like subscriptions, or direct debits for bills, or book holidays when you have no idea what you will earn. Even if you get a mortgage, how can you know if you can afford it?

Nobody understands your job

Meeting with friends in normal jobs will start to feel weird. Most of their work-chat is about how they hate their job, or colleagues, or boss. You cannot relate to this at all. They claim to be envious of your lifestyle, but have no idea what it is like. They do not understand why on earth you would work at the weekend, you do not understand why they have to rush back because they have a pre-set lunch *hour*. They don’t know what its like to pitch for work, or a publishing deal, you cant remember what performance reviews are like, or why flexi-time is so valued. They think you have made the wrong decision. You think they have no ambition.

The business facade

You are conscious of always having to represent your business side. You cant get drunk and tell people your job is pointless and the work boring. You are always thinking about your public image, and not wanting to upset potential customers, or investors. Every dumb or sensitive comment you make on twitter could lose you business, even wreck your career. Your views on social media are inseparable from the public face of your employer, which is you.

Nobody to blame

When everything goes wrong and nobody hires you or the game flops, or nobody buys your art, it is your fault. You cannot tell yourself, even subconsciously, that this is the fault of X in marketing or Y in sales, and how you did a good job. Ultimately there is nobody to pass the blame onto. You can come up with excuses and rationalizations but ultimately the whole company is you and there is nobody else to blame. Failure feels much more personal, and harder to shake off. Even when you are successful you worry about failing in the future.

Ultimately, its a choice that depends very much on your personality. Working for yourself in a creative field can be very rewarding, financially as well as personally, and i would DREAD to go be an employee again, but it really depends so much on your personality. I am very self-motivated, I don’t mind (within reason) the isolation, and I’m very risk tolerant, so it works for me.

Also do not forget that the reverse applies. I have personality characteristics that mean I don’t like working as a normal employee at all. I can be argumentative, arrogant, short-tempered, I hate being told what to do, I hate working in noisy places and hate commuting. I can be very moody, and not good at working with extroverted people… there are so many reasons for me to choose the lifestyle I have, despite its many shortcomings.

It is very easy for people who are successful in a field to forget the many downsides for those who are more typical. I probably vastly understate the effect that low income and unstable income has on people. If money worries can lead to stress and health problems, which leaks into relationship problems (which can lead to more stress)… then this can be all consuming. Sometimes these things compound. Trying to be extroverted and upbeat and SELL SELL SELL when inside you are worried about paying for food and that your partner is disappointed in your career choice…. cannot be easy.

My top tip: TALK to other people in similar fields, whether you are in the industry already and struggling, or considering leaving your job for this business. It can be very enlightening. No reading of blogs or twitter is as good as real world ‘pub-chat’ with people in the same position. Even just hearing other people agree with you about the negatives of the industry can be strangely re-assuring. Somehow us humans like to know that we are not suffering alone, even if we are still suffering.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Today is the day! At last someone has taken the time to think of the billionaires… We release an expansion for ‘Production Line’ today, which adds the following features…

Support for Gull wing doors like these:

And for Scissor-wing doors like these:

And also Butterfly-wing doors like these…

And not least a brand new body type called ‘supercar’. It looks like this:

This is the first DLC for Production Line, and it will be available direct from us at www.positech.co.uk/productionline/dlc.html as well as the humble store, GoG and Steam. its $4.99. I did get in touch with a bunch of youtubers and streamers and sent out some keys, but if you want to see exactly how it all works with my smiling face involved, you can check out this blog video I made about the expansion here:

Production Line Developer Blog: 102 : Doors that go like this - YouTube

I honestly have no idea if this DLC will be of interest to just a few super-car geeks or to everyone playing the game, so its a bit of a gamble, but I do like having a stupidly expensive car to build myself, and I definitely think it adds to the late game, and adds to the experience for people who want to build super-sprawling factories with some incredibly high-end options.

The DLC actually launches at 9.00AM PDT which is apparently 5.00PM where I am in the UK. here is the link to grab it or wishlist it:

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

They need to clear away building materials by the looks of it, and do some painting and other bits, but the structure of our second school is now complete. Image quality not great because rainy season in Cameroon is not ideal for high end HD photos :D.

More details on the school here:

Here are the photos!

A reminder that the charity we use is called ‘Building Schools For Africa’. Link below:

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Apparently no.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

So unless you have not heard, i’m making an expansion pack for my car factory game ‘Production Line‘ which adds a new car type (supercar) and also some new door options as features for various car models, and those door types are Scissor-wing doors, Gull-wing doors and butterfly doors. I’ve done a video that shows these off (below) and also we have a web page for the dlc that you can find here.

Production Line Developer Blog: 102 : Doors that go like this - YouTube

I thought I’d put down in writing how this came about and why this was the DLC I decided to do. Personally I’m a fan of DLC, but only if its actually ‘adding’ to the game, or giving the player options, rather than just tweaking some numbers and selling a few text files for $5.99. That seems a bit exploitative, so I always focus on doing DLC where we have new art content at the very least. There is a LOT of art that goes into a single car body design in Production Line, because every car is completely different in terms of where the wheels are, what the headlights look like, even what the axles and drive shaft looks like and where they go. Nothing currently gets simply re-used between body styles.

Adding a super-high end car to the game makes sense from a design and balance point of view, because it means we can leave the balance of the existing game in place, and effectively just add a new style option for the luxury cars, and add a tiny section of the public who only want to buy a super-car shaped vehicle. In the real world, most sales at that price point already are accounted for by people buying sedan and sports style bodies, but there are some people who would want to spend the same budget on a car with a crazy shape.

Plus crazy designed cars are cool right?

Once I knew we wanted a supercar, having crazy doors is pretty much a no-brainer. people love cars with mad doors, and some research showed that butterfly, gull and scissor were the most common options on modern real world supercars. In theory putting all this in the game was going to be mostly artwork, and then some balancing by me. pretty easy huh?

It turns out..NO! This was extremely tricky because of the way the design of those doors overlaps other parts of the car when they are open (which involved a lot of re-ordering of existing components), and the nightmarish fact that gull wing doors actually require a different ‘roof’, to allow for the cutouts n the side for the door hinges. This means I had to redefine these door ‘styles’ as roof types, which also ensures you cant have gull-wing doors and a panoramic sunroof…

As a result, door styles have to be like drive-trains: set in stone when the car chassis is first created and unchanged for the lifetime of that existing chunk of metal. In game-terms, this means that switching your luxury sedan to use gull wing doors will not have any visible effect for a while, as the cars right at the start of the line are then set to be gull-wing, but they have to get all the way to the door panel slot for you to notice.

This also involved a huge amount of special case code-spaghetti, because if you have gull wing doors, then certain other things change. You cannot stick normal windows or wing mirrors on a gull-wing door, and so-on. There was quite a bit of complexity involved in swapping some components for others to accommodate the new system.

I like to give my artists total freedom to create cool stuff and tell them I will worry about making it work. I get better art that way, but more work for me… It turns out that yes…its very cool that the supercar’s engine is behind the driver, but that caused me some hassle to ensure that when the engine gets fitted, its the back part of the car (trunk) that opens up to have it fitted, and not the front… (99% of players wont notice, but I like to surprise the 1% who do). As we were doing this anyway, it made sense to support the same capability for the sports cars, which also look like they have the engine in the back.

So all of that stuff is now DONE and tested and working in the game. The installer is done, and I’m working on the steam build, and mod-panel integration. All I need to do before release is keep testing the balance of this stuff to ensure that the doors are expensive and awkward to fit (but not unprofitable or too annoying) and that demand for these features and for the supercar makes sense.

Right now, the game is being tested with supercar sales only taking place in the luxury price band (well yeah…) and with a market size of 4.76%. I think thats maybe a bit high, and obviously in the real world its <1% but this is a game and needs to be fun :D

In terms of balancing the doors, they are currently just ordinary door panels..BUT the slot-upgrades are pretty expensive ($195,000 for a slot upgrade for scissor doors compared with just $3,480 for central locking) and they require sensors and servos, which lead to a bit of a bottleneck (intentionally). Plus the actual fitting time to add those doors is considerable, more than doubling the max-optimized time to fit ordinary door panels.

The final piece in the puzzle is the design cost. All door types need to be researched separately and also you need to research the new supercar body style. These are quite lengthy research items, but there is nothing stopping you skipping all the other car bodies and making supercars or gull wing doors your early game priority!

If you like the sound of all this stuff you can wishlist the DLC using the widget below.

If you are a youtuber looking to cover the game and want to make a key request you can get in touch through keymailer (below) or email me your steam curator name.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Its always worth occasionally grabbing a full run-time-profile of your game to see whats taking up all that processor power. Today I dug into it a bit with aqtime and wanted to see what was chewing up the PC the most on a (fairly) big map.

If I ignore child threads (that take a lot of the load-off in terms of route-finding and other things) and just concentrate on the main thread, I can see that 73% of a frame is in the drawing code, and 22% is processing. I suspect on crazy big maps that processing chunk goes higher, as the drawing code scales to some extent with the screen size, and a big map on a small laptop is still my target for improvement.

If I break open that 22% I get this:

SlotManager::Process is obviously the biggest problem here. Its also something that scales quite badly because on really jam-packed maps, there is a lot of slots, and for my sins, EVERY item placed down is a slot, even if its just a conveyor with one entrance and one exit… so whats going on in there…? 95% of the time happens in ProductionSlots (the rest is facilities or supply stockpiles…

…so quite a mixture here, which is a good sign really, as it shows no real obvious glaring screw ups! Because I’m really worried about maps with just a lot of conveyors on them I guess the thing I really need to look at is Processvehicle(), as the other top offenders don’t seem to be related to those theoretically simple slots…

Hmmm. so CheckExitSlotFree() is taking up a lot of time, and some digging around shows that in my short sample run I called that on average of 1,248 times per frame. Ouch. Thats a lot, but to be expected with so many slots, and them all wanting to know their immediate status. The sad thing is, this is likely to be 99.5% of the time, a lot of slots going *is the slot in front of me empty* and the answer coming back *no, just like it was the last 100 times you asked*.

There is a fundamental algorithmic screw-up here, in that polling a value, rather than being notified when it changes, is hugely inefficient. Its also incredibly reliable and fault tolerant, which is why its such a popular method… What exactly takes so long anyway in that function?

Aha… so it looks like a big chunk of the time is actually spent just notifying the popup GUI above a vehicle or a slot, what message to display which is almost *all* cases is none. This seems crazy, and clearly a target for optimization. On its own, this function is taking up a tiny part of total run-time, but a larger part of the main (blocking) thread, and certainly seems to be inefficient. What takes up most of the code? actually its the code that works out the width and height of any of the strings based on the UI font, and thus resizes that notice. Yikes, am I *really* calling that every frame?

Out of 1,992,097 calls to SetType() only 55,280 update it, so only 2.7%, but its still a lot. Inside that function we set the size and the text without even checking if its onscreen, or if we are zoomed in far enough to see it anyway. I can simply set that to be something thats done ‘lazily’ once I know we are onscreen and zoomed in…

Ok done that and…. Hahaha. That function now averages 0.0001ms vs 0.0007ms before the change. Thats a decent hours work :D

That reduces the overall time for a slot processing a vehicle from 0.0012ms to 0.0009ms. For big factories, thats a welcome change.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

It drives me mad when I talk to some younger indie devs how little actual *work* they do. They are hardcore serious game devs, into game jams, and going to games conferences, and maintaining twitter, instagram and facebook pages about their game, and they often talk at shows, or attend talks, or tweet about talks, and watch tons of past talks, and play fellow indies games, and meet up at game dev meetups and try out the hot games and compare them to other games and…

…very rarely they sit in front of a keyboard and code a game.

This is a big problem if you actually want to make a living from games rather than just enjoy the ‘indie lifestyle’. FWIW, the indie lifestyle is easy. Dye your hair (or for extra points just part of your hair) bright blue, get an apple laptop, and cover it in stickers from games shows. Buy a GDC T-shirt (or for extra points, one from a smaller show), and spend at least three hours a day on social media. Bonus points for every 100 posts on gamedev subreddits talking about tech and marketing and design issues. Super bonus points for getting into heated twitter arguments about whether or not games are art or inclusive.

Oh obviously, you need to have a name and genre (maybe even a game jam concept?) for your game, so you have something to talk about.

This is all fine, and reminds me a LOT of the guy who persuaded me to take up learning the guitar when I was at college. He had been playing the guitar for about 3 years and was very cool. He showed me guitar tab one day and I bought a guitar the next month. Within 2 months I was a better guitarist than him. I ended up playing in 2 bands, and working briefly as a session guitarist, as well as teaching probably 100 people to play. AFAIK he never played a gig.

The difference between us was that I wanted to play the guitar and learn how to play well, whereas he wanted to be a guitar player. This was probably related to a desire to be cool, or get women to sleep with him, or both.

My advice is to know which you are. Are you an indie developer because you love the indie scene, and the people? Or are you an indie developer because you want to make games, ideally full-time? I also suggest that if its the latter, you need to lock down and optimize WHERE you do it.

Briefly, when I quit my job to go indie the first time, and my wife was at work full-time, I experimented with coding in coffee shops, because thats what they show people doing on TV and in magazines. It was crap. They are full of mothers with screaming kids, expensive (but average) coffee, no stability, no room, no peace, an environment 100% NOT conducive to C++.

this is not work

You MAY be one of the 1% of people who can program and design games and do real serious *deep work* while in a noisy environment you do not 100% control and surrounded by other people who often interrupt you. You really may be… but you probably are not. Almost everyone can concentrate better when things are quiet. Programming especially requires *deep* concentration, that is easily shattered and hard to rebuild.

In short, unless your environment is quiet, free from clutter, dedicated to one thing (work) and set up to convey that this is a WORK location, not a chill-out zone, then you are not going to get much done.

My tips?

Get a dedicated room in the house/flat if you can. If you cannot, then set dedicated work times, when you are not to be disturbed for any reason except a literal burning building…

Get an office chair, I recommend an aeron but cheaper alternatives are available. Set it up to be perfect for typing and reading, not slouching. You are *not* going to work all day on a beanbag or a sofa. You just are not.

Only people insecure about creativity think beanbags will save them

If its not quiet enough, get noise cancelling headphones and wear them.

Do not fill your desk and office with lots of fun toys and other distractions. Yes, you are making a fun game, but 95% of your time is work and implementation. Don’t confuse your subconscious. Are all those desk toys REALLY making you more creative or just distracting you from actual work.

Most of us are pretty shallow. We really care about what other people think of us, and when we are young, especially if we are single, we obsess about seeming cool. Work is not cool, work is for serious grown-ups who are boring. Thus we spend a lot of time trying to look cool, rather than be effective. If you saw me sat here right now, unless you noticed the framed prints of past games on my office walls, you would assume I’m working in fintech or IT. Its a very un-gamey environment, and it keeps me focused.

When you have shipped game #10 and sold game copy 1,000,000, feel free to fuck around. I *do* indeed have a child-size Tesla model S propped up in my office, and a toy car with toy robots on my desk, and am happy to be interrupted by cats and visitors all during the day. I can afford to be slack, but it was not always the case.

Set your environment up to be worklike, and you *will* get more done. We are simple animals and highly influenced by our surroundings. Stop trying to be cool.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Hey. I’m a games programmer who has been coding for 38 years (yes really) and making indie games for twenty. Thus… I’ve done a lot of it, and learned from a lot of mistakes. I still do not consider myself an expert (who does?) but I’ve stuck primarily with one language (C++) and have used a lot of optimization tools over the years, so I’m simply passing on what I know about making your game run faster in the year 2019.

Disclaimer: if you are making games in unity then… you are on your own. I have no idea what tools are available in unity (although talking to friends makes me suspect they are pretty…lacking). Frankly if you are relying on someone else’s engine code that you can’t change then you are probably fairly screwed anyway, performance wise. For everyone else…read on :D

First of all, its worth getting some perspective. The first modern games I tried to write were on the intel 386dx2 processor. The speed of my current chip (intel i7 6700 @ 3.40 GHZ) compared to that is…vast. I can’t even find stats for such an old chip, so zapping forwards a lot I guess I can compare my current chip to an intel Pentium 4 1500…

So frankly my current chip is about 80 times faster than one from 2009. And lets not kid ourselves that 2009 was the stone age. 2009 games looked PRETTY GOOD. So in the year 2019 (let alone the 2015 of my current chip), everything should be running silky smooth at 60 FPS (minimum) and with a UI that is as responsive as lightning right?

We all know this is not the case. Games still have performance problems. My point is that we should only be seeing performance problems in extreme cases now, when we are really pushing a machine to its limits to process incredible amounts of data, or render insane amounts of pixels, or applying insane effects to them. As an indie game developer, you are unlikely to be making Battlefield V style graphics, so your performance problems should be easy to solve right?

The biggest problem is that many developers just have NO IDEA what options there are out there to work out WHERE your performance problems are. I intend to show you some of them. (Click to enlarge any screens.)

Option #1 The visual studio profiler.

Obviously this is built in, so free with the IDE. I use a slightly older version of Visual C++ to the current one, and the profiler seems…ok, but a little basic. I get the impression its similar to the unity tools. It seems to want to tell you what to do, identifying specific functions that *it thinks* are the problem, rather than just giving you data and letting you investigate. Its very limited when it comes to actual visualization.

(default after-run screen of the profiler. Not much help tbh)

Now sure… this sort of thing is 100x more useful than no profiling at all (or horror of horrors: trying to measure your own code using hacked timers…), but frankly its pretty badly put together compared to dedicated 3rd party tools. Still…its built in I guess? I hardly bother using it.

(one of many uninspiring views in the visual c++ profiler)

Option#2 The visual studio concurrency visualizer.

In my version this is an ‘optional add-in’ which frankly is essential if you do multithreaded code (and if you don’t…omg why?) Its one of the best tools imaginable for visualizing where one thread is blocking another in a specific frame. It has truly excellent support for you adding in your own named sections, markers and events that let you build up really detailed and helpful pictures of why one thread is waiting for another. Given the ‘free’ price, its highly recommended, and probably the simplest tool for visualizing how your game is handling multi-threading.

It also has a baffling but I guess kinda cool view where you can see the relationship between actual threads and physical cores which shows them bouncing all over the place. Frankly I think this tool is made redundant by vtune, but like I say, its free and integrates nicely into visual studio. If you place custom code markers into it, it gets very helpful indeed.

Option#3 NVidia Nsight.

A visual debugging system thats free for nvidia card owners. This is great for GPU debugging, as it lets you freeze your game in real time, and then generate a ‘frame-scrubber’ view, where you can step through each individual draw call in a specific frame and watch every mesh get rendered, one at a time, and see the textures that were used, and what was changed on screen. This is *great fun*. if you ever have a bug where something is being drawn in the wrong order, this is how you spot it. This also allows you to spot those cases where you do far too many draw calls that could be easily batched. I’m doing too many draw calls here:

(nsight scrubber half way through a frame render showing current draw call texture atlas)

Nsight also has a system to let it run on a remote PC (which is cool), and has some nice little visual tools like the ability to visualize overdraw or to set all textures blank to see if its texture memory that is acting as a frame rate blocker. A real-time histogram shows you how many polys are being rendered by each draw call, which lets you spot parts of your games where you need more batching. Its very useful for games that are graphically complex, and where you need to visualize which items are taking up too many draw calls.

(nsight real time view showing GPU busy chart and draw call histogram)

Option #4 AQTime (by SmartBear) (approx $650)

This is commercial profiling software that I’ve used for years. it does an extremely good job of working out exactly what line of what function is slowing you down, which it does over the entire lifecycle of running the program. You can programatically (or manually) turn data collection on or off if you only want to capture a specific part of the run, but you have to do that at run time, not after the event, which is less than ideal if hunting for a specific slow frame.

AQtime has exceptionally good stability, and is very good at visually allowing you to ‘drill down’ into code and see where a bottleneck is. Its absolutely rubbish at concurrency analysis (although you can view the results of each thread individually, you cannot detect blocking). It gives some really cool charts, and will even let you switch to see the source code alongside profiling data, and even the assembly code if you really want to.

I’ve found that owning a copy of this is annoying (it has some serious low level service-based DRM), and its very much aimed at trying to get you to buy a new update every year, but if you can ignore that and deal with the company, and the price, its actually very good. I’ve used it for hundreds and hundreds of hours. Running aqtime WILL slow down your code a lot (especially in line-analysis mode) but its worth it to get the data. Its also quite good at analyzing memory usage.

Option#5 Intel VTune Amplifier.

Ok this one has a free trial that seems to never end so…I dunno. I don’t understand either. In the past I’ve paid the full £800 or so for this, and it was worth it.This is a full-on serious profiling tool that integrates into visual studio but can also be launched externally. Its a very low level beast, and produces gigabytes of profiling data. By default it limits its capture to 2GB of data, and thats *not a lot*. You will not leave it running for hours. Like many profilers, it has multiple modes and methods and rules. I tend to use its concurrency analysis mode which provides incredibly complex data like this:

Frankly the UI for it is as stable as a canoe carrying heavy industrial equipment, but its numerous crashes aside, its a seriously amazing bit of software. Treat it gently and it rewards you with incredible details, and also makes you strongly aware of how your code is just part of the story, with directx, drivers, and the O/S also having to do quite a bit of stuff while your game runs.

Like the concurrency visualizer, you can place your own markers in the code to label each bit of data and you can stack them a seemingly endless amount of times to give you amazing drill-down. For multi-threaded apps, this is a goldmine of information that just is *not* there with a normal, simple profiler.

I also find that its very good at letting you view the bottlenecks in code very well when you only want to select a single, very specific frame where stuff goes wrong. Honestly you could probably spend years just looking at the data of a single run of your game and still be learning new stuff.

Conclusion

Learning to use these tools takes months, and learning to apply the knowledge from them takes years. I’m only part way into the lifelong process of understanding what makes code slow, and how to fix that, but the important thing I want to get across is you need to know how to MEASURE this stuff.

Just running a function a thousand times with timegettime() at the start and end tells you NOTHING, other than that you really need to get a profiler. Increasingly code is running on a machine with multiple cores sat idle and without a really good way to analyze and visualize the inter-relationship between code running on different cores, you are basically trying to optimize with one hand tied behind your back and a patch over one eye.

There are some great free profilers, and even the commercial ones will pay for themselves. Unless your game already runs perfectly at 60FPS even on 5 year old hardware, you absolutely need to learn how to use one.

(if you found this post helpful, check out my games)

Read Full Article

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview