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

Solar farm update: earthworks!

Its been a while since there has been any progress update on the farm. I could write at length about my frustration on this topic, but to sum up what I think about the general lack of urgency in the world to get stuff like this actually BUILT, I’ll just use one graph:

Anyway…

We are actually back working on physical stuff, rather than just people arguing over email, which is a change of pace. I am still waiting for the REGO application, which everyone in the industry I talk to says ‘is tedious and bureaucratic and torturously slow’. Amazingly, nobody has ever fixed this, and our government actively despises the environment, so it will likely not be fixed until after a general election (ha…not even then I bet). So no, I do not have ANY progress after MONTHS in trying to get a bureaucrat to say ‘yes, those are definitely solar panels’. Amazing.

The last few MONTHS have been basically a lot of back and forth arguing about earthing design. The site itself needs to be earthed, in case of lightning strikes (almost inevitable given 25+ years of 60 tons of solar panels on a hilltop), and the substation building also needs earthing. There are 2 substations, one owned by us, and one by the DNO (distribution network operator). They have totally separate earthing designs, and electrical experts fret a lot about if they could interfere. They also get very concerned about metal perimeter fencing, CCTV camera towers, and anything else metal in the vicinity.

After a LOT of email back and forth, which frankly drove me crazy, we seem to have finally agreed on everything. That means that we can build the base for the substations, which is the only bit of concrete involved on the farm (except maybe a tiny, tiny amount for CCTV tower bases). Because the substation base has to happen before we install switchgear, the substation itself, or move the overhead line which eventually allows the last few panels/frames…. its been holding up the entire project.

Here is a thrilling picture of a digger digging some substation foundations:

Here is an even more exciting picture of a trench being dug that will be needed for cabling to the substation.

There are also trenches needed for CCTV communication and power, and of course the trenches that link up the final cable runs from each of the inverters to the main switchgear stuff. Obviously its cheaper to get all your earthworks done in one go, and also we have the horrible English weather to battle against. Its been bad.

I have tried exceedingly hard to make this whole project run faster by doing things in parallel. I was hoping to get the PPA (power purchase agreement) sorted at the same time as the earthing, at the same time as the legal stuff, at the same time as the REGO stuff. It seems impossible to do this, unless I spent my whole life trying to hard to stay calm on the phone while literally begging people to get things done. Its infuriating to the extreme, especially given the hugely bureaucratic nature of all the involved businesses. Nobody at the DNO, or Ofgem, or any law company gives a damn if this project gets done on time, or at all. The potential for improving the whole process is epic, but it would require a change in culture.

I have high hopes that we may actually get the earthing done, the switchgear done, and the substation done in the next month. It looks like we wont be connected to the grid until next year. Don’t worry. Its not like we have a climate emergency, or sky high energy bills.

Programming in just ONE language should be lauded.

I recently read about the news that garbage collection support, which was added to C++, is now actually being removed from it. Apparently most people didn’t use it, or even knew it was officially added, so it is no great loss. It always shocks me to read articles about C++ with a version number, because as far as I am concerned, C++ has no version number and never will, in the same way that a language such as English has no ‘version number’. I’m 54 and its pretty rare that I add a new word to my English vocabulary, and its even rarer for me to learn something new about C++ that I start to use in my code.

Back in the early days of modern computing. I worked in IT. My CV was basically: CNA, MCSE. That was it. That was all you needed to earn £54k a year 30 years ago in IT. There were basically 2 big computer systems, run by Microsoft and Novell, and your IT dude ideally knew them both. That was a long time ago now, and the amount of buzzwords and brand names the average IT admin has to put on their linkedin profile is probably quite ridiculous. However, I think its worse in the land of software engineering.

Again, go back a while and you were probably pretty employable if you could just mention C and C++. Then Java became a big deal, then a bunch of other stuff appeared. I have no idea whats cool now, but it feels like Python, Rust are much in demand. Then you have to add all of the recent methodologies. Do you know Agile and Scrum? How familiar are you with AWS? Whats your AI/ML skills like? PyTorch? Do you know the buzzword technologies that will get you hired this year? You better get a job quick, because the buzzword technologies will change every 2 years. Did I say 2? I meant ever year. No sorry, month.

I recently found myself thinking about poetry and code. My wife writes poetry, so I am exposed to this stuff. As a writer, she spends a lot of time… a LOT of time deciding what words to use in a sentence. Its a big deal. Sentence-by-sentence writing is an absolute skill that takes most people there entire life to perfect. Its worth noting that few poems are praised because they use the latest hip words. Good writing is not a matter of having a large vocabulary. Needlessly obscure word-choice is rightly seen as pretentious and alienating.

We really need to take some of that perspective and apply it to code

Take this sentence: “It is a truth universally acknowledged, that a single man, in possession of a good fortune must be in want of a wife.”

Thats considered literary genius, and it is. But its not using arcane language. Every word is commonplace. And idiot could have put that sentence together! but it took Jane Austen, and considerable experience, and huge skill to do it. We do not mock Jane Austen because she could only write in English. We do not mock her because she only wrote from a woman’s point of view. We do not mock her because all her novels were contemporary, in a similar setting, set in a single country, with a linear narrative. We accept all of those limitations and accept that she brings incredible skill to use a limited set of tools to create genius.

Imagine a modern programmer trying to get their first novel published. “English, yup I could write it in English, French, Italian, Chinese or South Korean if you like? I can do all the genres, yup, no problem. I can do first or third person if you like, and I’m familiar with fractured narrative or linear. If you want it funny I can do that, or harrowing, or in short story form too if thats what you are looking for.”

Madness

For some reason, people think that ‘proficiency’ in a programming language is something as superficial as being able to say ‘hello’ or order a beer in another language. This is insane. I am able to say ‘Hello’ ‘Thankyou’ and ‘Sorry’ In Korean, but you wont see me apply for a job writing Korean-language fiction.

If you have under ten years experience in using a programming language, let me be blunt and tell you that you don’t REALLY know that language. 20 years is better. 30+ years is ideal. Do you really think you speak French like a native after speaking if for a few hours a day for a few years? Of course not. Thats laughable. And here is the thing: A mistake in a language can cause confusion and maybe embarrassment, but unless you are a lawyer writing contracts, its not CRITICAL. Miss-using C++ can cause rockets to crash, reactors to overload, and god knows what else.

Why do we accept a superficial understanding of a language that is safety critical, but expect mastery of a language by anyone paid to use English?

I know C++. Thats it. A little bit of php, but a trivial amount. I use container classes and std::string from STL but thats it. A very few macros. My C++ vocabulary, even after 28 years using it, is tiny. The amount of std library stuff I know is very small. And yet… I can type C++ with as much confidence and speed as I type this blog post. In fact I can write C++ faster, with fewer mistakes than I can English. In many ways, I am MORE fluent in C++ than English. I code almost every day, and love it. I feel absolutely that I know what I’m doing, after 28 years, and a subset of C++.

The world is full of people claiming to have that fluency with 12 languages, and they are often literally half my age (I’m 54). This is utter bollocks. None of those people should be allowed ANYWHERE near mission critical code, or any code even tangentially involved with safety or security. I am sure that they ARE doing those jobs, every single day, because they all confidently think they are experts, and the people hiring them do not know any better. It a recipe for disaster, and its why year-after-year, software gets WORSE. Windows 11 runs dramatically worse than Windows 3.11 did, and it does it on hardware ludicrously faster. Skype is running at about 0.1% of its potential efficiency, has scrollbars that do not function as well as windows 3.11 did, and uses easily 100 times the RAM it needs.

Your computer is an absolute trainwreck of clusterfucks crashing into a dumpster-fire of wasted resources. All the people involved in arranging the trainwreck think they are multi-skilled geniuses, but hardly any of them have any real understanding of the code they write.

It doesn’t have to be that way.

We don’t appreciate Picasso based on how many colors he used, or how many styles he knew. We don’t berate any musician for only knowing one style. In Japan, people who make the SAME SUSHI DISH their entire lives, without variation, are considered legends, and experts. Its the norm in South Korea for restaurants to only serve one dish (but do it WELL).

I beg of you: If you are involved in recruiting software engineers, for the love of god only employ people who have real, genuine experience, measured in years but preferable decades, for stuff where you expect them to be able to code from day 1. No, they will not ‘pick it up quickly on the job’. Hiring interns or juniors is different, obviously.

I know I’m an old man yelling at a cloud, but sometimes old people know a lot about the cloud. I’ve been coding since I was 11, and its taken me this long to realize that programming languages should be treated like any other language. It might not be a popular view, but I want to put it out there. Experience really matters.

Gratuitous Space Shooty Shield tweaks

Maybe there is an easier way to code this, and I’m sure 99% of devs would just unity and copy paste some asset store effect, but I like to code these things myself becausae I like the intellectual challenge, and it gives you total freedom and zero dependencies so here we go:

I just finished coding a ‘shield impact effect’ for Gratuitous Space shooty game, and thought I’d explain how its done. The idea is that the ships are surrounded by energy fields, with various grid patterns, and when laser bullets hit them, they generate a sort of encapsulating ‘wash’ effect over that portion of the shield. To pull this off, I need two things: It needs to be clear where the impact hit the ship, and it needs to feel like it wraps around the target in 3D.

How do you do that in a 2D engine?

The first challenge is getting a graphic that looks like a ship shield in 3D. This is easy. You just get any pattern you want, such as a hex-link pattern:

Then you use the photoshop sphereize distortion filter to give you a nice alpha channel map of a cool space shield:

If I just blap that on top of a spaceship thats hit by lasers, you get a nice effect, but the problem is its non directional, and its pretty clear that its just one image placed on top of another. What I need to do, is to draw this image, but only bits of it at a time, and to wash over the image, revealing it over time.

The way I found was best to do this was to enlarge that texture a lot so it had a ton of empty space, and then use it at twice the size. The reason for this will become apparent, but I’m not working with this:

What I then do, for my shield effect is to use a sort of 2D mesh to wrap around that image over time. That wrap-around effect will originate from the point where the bullet hits the shield. To do this, I get the bullet position, then get the angle from shield center to bullet center, and travel the exact shield radius along that angle from the shield center. That gets me an EXACT location on the perimeter of the shield, even if the bullet is super fast and has already moved inside the perimeter. This is important!

So I now have the impact location, and I want to kind of ‘wash’ the image of the sphere into the players view over time like this:

The red dot is the impact point, the yellow rectangle gets thicker over time as it washes over the sphere. To do this, I ‘virtually’ place the sphere texture on the screen, but do not render it. Its there just as a placeholder for where the ‘full’ sphere would be if it was all revealed. I then calculate how to position that rectangle, and over time I stretch it so it completely covers the target sphere. In order to render the composite image, I render the yellow rectangle, but when I get the UV values of each vertex in the rectangle, I actually look up where they are in relation to my oversized virtual sphere and use that UV value, but the texture of the sphere.

This is why I had to enlarge the canvas the sphere is on, so that those UV values make sense and are still 0 to 1 in both directions. When I do this, I get a cool effect, but its basically a watermelon (shown here with early rubbish shield texture)

To fix that, I just need to set the color values of the ‘inner’ vertices at the top of the rectangle to be fully transparent, and I then get a nice fade effect over the sphere. To be honest, that looked fine, and I was happy with it, but even though NOBODY would notice, something annoyed me…

When you imagine something wrapping around a sphere like this, from a top-down view, you would notice that the speed at which the ‘frontier’ washes over the sphere is non-linear. In other words, I’m not taking any account of the curvature of the sphere itself. To do things right, the speed at which that rectangle washes overs the sphere should vary along the length of the top of the rectangle. To do THAT, I need the rectangle to actually be a tri-strip, so I can curve the top edge. And not only that, the speed at which the center point of that edge moves needs to be a nice curve defined as a sine wave…

In other words I need to achieve this:

That wireframe thing is my yellow triangle. Over time it will wash over the whole shield right to the back. here is two overlapping impacts:

You can see whats going on quite easily in the wireframe version there. The game is way too fast and gratuitous for anyone to notice, and TBH I am still tweaking it.

One of the really fiddly bits was getting that curve just right. I had to start at the left hand top of my yellow triangle, and go across the top edge, noting my progress along there. I then interpolated between the extent to which the ‘height’ of the rectangle came from a fixed point (I picked the top left at the ‘back’ of the shield’) or from my sine-eave inspired non-linear curve of the point that represented the center of the rectangle.

At the end of all that I then basically have a single tri-strip. I then run some separate code to derive UVs from the ‘virtual’ sprite, and just render it. For those who care about the details, here is the code for what I’ve described:

void GUI_ShieldRipple::CalculateVerts()
{
	//place relative to the shield
	float radius = PParent->GetGlowSprite()->Width / 2;

	//we have a tristrip here that is angled at RippleAngle and whose bottom center is at
	//InitialImpactOffset from the current shield center;
	float shieldcenx = PShip->GetWorldPosition().X;
	float shieldceny = PShip->GetWorldPosition().Y;

	//derive bottom center
	float radangle = D3DXToRadian(RippleAngle);
	float cosangle = COS(radangle);
	float sinangle = SIN(radangle);
	//note this is the inverse because the angle is from offset to cen and we want the reverse
//	WorldPos.X += (sinangle * ourspeed);
//	WorldPos.Y -= (cosangle * ourspeed);

	float botcenx = shieldcenx - (sinangle * radius);
	float botceny = shieldceny + (cosangle * radius);

	//now turn 90 degrees to the left to go to the start
	float angletostart = RippleAngle - 90;
	if (angletostart < 0) angletostart += 360;
	radangle = D3DXToRadian(angletostart);
	cosangle = COS(radangle);
	sinangle = SIN(radangle);

	float botleftx = botcenx + (sinangle * radius);
	float botlefty = botceny - (cosangle * radius);

	//invert for right
	float botrightx = botcenx - (sinangle * radius);
	float botrighty = botceny + (cosangle * radius);

	//how wide is each block of the tri-strip
	int prims = (MAXVERTS - 2);

	float chunkwidth = PParent->GetGlowSprite()->Width / prims;

	//now deduce chunkheight, which is basically our travel over the shield at the center point
	//we have non linear progress here, and we deduce that from a cosine wave curve imagined from 
	//Pi to 2xPi
	float cosinput = D3DX_PI + (D3DX_PI * Progress);
	float adjusted_progress = cos(cosinput);
	//now convert to 0 to 1 instead of -1 to 1
	adjusted_progress = (adjusted_progress + 1) / 2;

	//this gives us the center value, of the middle of the sphere
	float chunkheight = radius * 2 * adjusted_progress;

	//get top of the strip above the botleft
	radangle = D3DXToRadian(RippleAngle);
	cosangle = COS(radangle);
	sinangle = SIN(radangle);

	float innerx = botleftx + (sinangle * chunkheight);
	float innery = botlefty - (cosangle * chunkheight);

	//start botleft then up, then to 1 along and down...then up
	float currx = botleftx;
	float curry = botlefty;
	
	float offsetx = (botrightx - botleftx) / (prims/2);
	float offsety = (botrighty - botlefty) / (prims/2);

	unsigned long fullcolor = RGBA_MAKE(20, 234, 221, (int)(255.0f * Intensity));
	unsigned long nocolor = RGBA_MAKE(20, 234, 221, 0);
	for (int n = 0; n < MAXVERTS; n+=2)
	{
		Verts[n].dvSX = currx;
		Verts[n].dvSY = curry;
		Verts[n].color = fullcolor;

		//to get innerx we need to adjust between the full corner value and the middle adjusted
		//value based on our progress
		float progress = n / (float)prims;
		//convert that progress to a nice curve
		progress = sin(progress * D3DX_PI);

		//thats the extent to which we get the adjusted value rather than the base value of   chunkheight being radius
		float newheight = (radius * 2 * (1.0f - progress)) + (chunkheight * progress);
		float newinx = currx + (sinangle * newheight);
		float newiny = curry - (cosangle * newheight);

		Verts[n + 1].dvSX = newinx;
		Verts[n + 1].dvSY = newiny;
		Verts[n + 1].color = nocolor;

		currx += offsetx;
		curry += offsety;
	}
}

Its a lot of C++ to just generate that effect, but I love coding this stuff. I might change it so that the top left and right points of that rectangle are in fact the mid point, so the curve goes flat then inverts. I think that may look better. Also I’ll fiddle with render states and lightmaps to make it fizz more. In the meantime I uploaded a video to twitter showing it with, and without the wireframe. There is a lot going on, and there can be multiple overlapping effects at once. Thats another reason I needed to use a virtual shield texture for UVs, this way everything lines up perfectly, even with multiple impacts:

Gratuitous Space Shooty Game will be on sale on itch soon

Your corporate communication policy is bollocks

I’ve had the misfortune recently of having to deal with two gargantuan and completely terribly run clusterfucks of inefficiency recently here in moving my mothers TV network from one company to the other. I will not bore you with the details, but the process of quitting company A and enabling company B was, at a conservative estimation, 100x as difficult, and costly (to them) as it should be assuming a simple baseline of a competently run company.

At the same time, I am also running my little one man games business, AND overseeing the construction of a solar farm, which involves at least 5 different companies including mine. Having all this happen at once makes for an interesting comparison, and its even more interesting to do this while I’m also reading the Elon Musk biography, with lots of discussion of Twitter/SpaceX/Tesla etc.

Its no great revelation that big companies are often run badly. I think the situation has got worse, especially in the UK (or is that just the western world in general?) in recent years. We seem to have completely forgotten about free markets and competition, and the role of governments in ensuring that oligopolies and monopolies do not exploit their market position, and this has made things much much worse.

Having dealt directly with both google and facebook, I can tell you both companies are incredibly obtuse, bureaucratic disasters with absolutely no idea how to do anything any more. Its impossible to communicate with them, or get anything fixed. From the point of view of a customer (in this case for ads), both companies seem 100% computer-run, with no humans at all. At any level.

Running a company is about efficient communication. Companies that cannot communicate with their employees, or customers degenerate into inefficiency. The most obvious example is when something is fundamentally broken, but you, as the CEO of a company do not know about it. With my mothers TV, there was a simple mistake on their part. They had set a limit of phone call costs at which point the TV and phone would be disconnected. You could pay the costs to re-enable the account, but their website failed if you tried to pay in the first month, before the first bill. So there was an infinite loop on non payment, and non-connection.

In any sane organization, there would be actual humans who would respond, understand the problem, and fix it immediately. Instead it took 3 days and about 6 hours of my time, numerous furious phone calls, dozens of emails, a complaint to the government regulator, you name it. I was not a happy customer… But me being an extremely angry customer, and therefore the complete destruction of any potential goodwill is only 1% of the cost to the company. They now have to respond to, and deal with an official complaint with a government regulator. They have tried to call me to apologize 6 times, and left messages and sent emails. This has taken them time, effort, money. In theory the regulator could fine them, costing even more time, effort, money.

The fix is obvious, but unfashionable. You simply hire staff to deal with complaints. The obvious rebuttal is that this would cost money, but the cost of NOT dealing with a complaint will always be higher than the cost of dealing with one.

The compounding error for large organizations is that even when their staff do communicate with customers, they are not empowered to do anything. Nobody you ever speak to on a phone call to a large company has any discretion, authority or power to do anything. They have to fob you off with excuses or use tools like long wait times, annoying hold music and no ringback, and infuriating AI chatbots pretending to be typing… all to hide the fact that even if you get to talk to a human, they cant fix the problem.

My email address is cliff at positech dot co dot uk. I make no secret of it, and give it freely to people who ask. I don’t put ANY barriers between me and people who want to talk to me. Its my decision whether I reply, and some emails I do decide not to respond to, but the idea of making it hard for customers and potential customers to contact you, when you SELL things, is just insane. Amazingly, I am not overwhelmed by email, nor annoyed by it. Many, many times, I have got emails that have been VERY helpful, or profitable, that I may never have got if I tried to screen my contact with the general gaming public.

One of the best sizes for a company is one person. This doesn’t just mean ‘smaller than 2’, its an actual qualitative difference. There is something special about a company where every role is handled by the same person. My game designer and game programmer and engine programmer and QA lead are all me. That means we can have a 4 way meeting to evaluate the potential of a idea while I’m making coffee. We communicate between us at the speed of thought, and there are no egos. Sometimes the game designer gets their way, sometimes the QA dude. Its all me.

This is absolutely fundamental, and something very few people seem to really understand. Going from a one person team to a two-person team not only doesn’t make things much faster, it may actually make everything slower. Maybe much slower. Even if there are no egos and both people get along, and they never interrupt each other and never disagree, communication moved from the speed of thought to the speed of speech, or typing. Incredibly slow.

Communication between everyone working towards a common goal is absolutely vital. The idea that people in dept A cannot talk to people in dept B is lunacy. Strict unskippable hierarchies and org-charts are nuts. In so many companies, barriers to internal and external communication are put up by managers who want to be left alone. The impact on the company’s success is colossal, but individual managers in huge megacorps are not invested in the success of the business so rarely care.

It should, in theory be absolutely impossible for a single individual like me to commercially survive making and selling video games when huge companies like blizzard and epic exist. And yet here I am. I think a huge part of this is due to the huge huge gains in efficiency when a company is basically a single individual. It MIGHT be possible to replicate it with an extremely driven, loyal team of super-like-minded people led by someone who is super-inspiring, but thats amazingly rare. Maybe space/tesla are one example.

So whats the conclusion? Corporate communication is critical. Its almost impossible for it to work in large companies, unless you fight hard to ensure information flows freely. If you are thinking of growing your company think very hard if thats the right decision. And communication with customers is vital. You want to hear when there is a problem immediately, so its fixed immediately. Putting barriers between you and your customers is insane.

Kudos 2 is now on steam! omg.

So here is a bit of a random thing but… I just put a game on steam that I made a LONG time ago, and was never actually released on steam….drumroll… on steam.

Its called Kudos 2, so obviously its a sequel. Back in the early days of indie gaming, before steam was a thing, I was already making games. I’d already made a bunch before this one, namely Asteroid Miner (Star Miner), Starlines INC (Starship Tycoon), Rocky Racers, Kombat Kars and Kudos. Then eventually came Kudos 2. Kudos 2 was the first game that was a proper success for me. I remember when it was on all the casual game portals, like iwin and yahoo games etc, getting a check for $20,000 one month, which was insane for a ‘shareware’ game developer. These days thats 10minutes royalties for Rimworld :D.

Kudos 2 is a pretty interesting game. It was one of my actual good ideas. The sims was a great game, but it was mostly a game of urgent problem solving and time management. It was a life-simulation game, but it was only ONE way to do the idea of a life simulation game. Nothing is set in stone that lifesims have to have 3d worlds and an animated character. The way I saw it, a life sim was about decisions.

If you think about your life, its not really a time-management or arcade game that comes into mind, but a series of decisions made throughout your life that impact how things turn out. The decisions might be huge (who to marry) or minor (do I eat healthily tonight?). The point is, that life can be seen as merely a series of decisions.

Weirdly the concept for this game came from the movie Donnie Darko. A great movie, that I can never rewatch because it really freaked me out. This is before the term ‘triggered’ became a thing. For me, Donnie Darko is a film about the struggles of mental health. I wanted to make a game that took the struggles inside a person’s mind, and made them a strategy game.

Many years after releasing Kudos 1, a teacher emailed me to tell me she used the game in a school for students with autism to teach them how to maintain friendships and relationships. I thought this was amazing. It still didn’t occur to me that I may be autistic, and wouldn’t do for another 15+ years. Madness. I literally made a game where friendships are represented by progress bars and stats, and didn’t realize what that said about me :D

Anyway… I think its a cool game. Its very different, and its obviously something you can just play on a laptop. I have NOT updated the game at all, but it runs on my windows 10 and 11 PCs ok. The screen resolution might be a tad annoying, but its playable. I don’t expect the game to rush to the top of the bestseller lists, but some people who like life sims are going to really enjoy it.

Also, I’m really not going to go through all the process of getting steam keys for old customers etc. Its just a huge admin nightmare, because the game was sold through so many different services and sites, and I’d just be spending all day doing that. Its only $5.99 on steam, so I guess anyone who actually genuinely wants to play it again will happily pay that.

So there you go, another new game release from positech games haha. Maybe I’ll release my space shooty game this year as well. Anything to keep busy when I’m grinding my teeth about solar farm delays :D