1 2 3 4 5 6 7 8 9 10 11 12

Writing Code for Fun and ... That's It

30/07/2023

Supreme Commander: Forged Alliance is a real-time strategy (RTS) game released in 2007. It is also the last good RTS, and potentially game, ever.

Despite this most gamers — not realizing gaming reached a pinnacle in 2007 and has since descended into a mess of RPGification, Loot Boxes and bloom over-use — have moved on to other games and more importantly other genres1.

One need only look at the modern-game design horrors unleashed on the Dawn of War genre to see the decline of RTS and gaming generally more clearly. From the high-point of Dawn of War: Winter Assault in 2005 to the best-forgotten mess of Dawn of War III in 2017 everything has been ruined irrevocably. Nothing is good anymore, food doesn't taste the same, music isn't what it was2. I'm not getting old, things are getting worse. I'm still cool and relevant!

Few things in gaming quite match the state of stressed, overwhelmed, misery induced by Forged Alliance. Thankfully the Forged Alliance Forever (FAF) project has continued to develop Forged Alliance, providing graphical updates, balance changes, matchmaking, performance improvements, new maps and more.

Because gamers have departed from the True Path matchmaking generally takes a while. A small active user-base means that depending on the time of day and day of week you can be waiting anywhere from 10 minutes to over an hour for a lobby (the pre-game matchmaking bit) to fill.

It is generally necessary to be ready to balance and start the lobby within a few minutes of it filling. If there's too much of a delay everyone will leave again and the waiting time will have been wasted.

Which brings me to the justification for my project, FAF Lobby Sim. While the lobby is running on my desktop I don't want to have to sit checking it every few minutes. It would be good to be able to do other things elsewhere while having a way to check on the occupancy status.

...

Blog Update

29/07/2023

As this blog entered its tenth year it was desperately in need of a facelift. I had effectively stopped writing new posts because the overhead of remembering how to upload a new post each time was off-putting enough to stop me entirely.

For that reason it has been updated with new - hopefully more consistent - CSS. In addition the code and posts are deployed on each commit by GitHub actions. This means I no longer need to SSH into the server to do things by hand. This should mean the blog is editable from wherever I have git access. I also removed the terribly insecure previous method of uploading posts directly onto the server which was using a plain-text username and password.

Most importantly privacy-invading Google Analytics has been removed along with almost all JavaScript. I no longer see the need for analytics on this blog. The only remaining scripts are for code highlighting client-side as well as Disqus for commenting. Disqus is opt-in so will only load in if you click the "Load Comments" button at the bottom of each post.

Unfortunately I still rely on Google Fonts for the title font but the main body font has been updated to use the system font stack.

Finally it has been updated to .NET 7. The previous version was running .NET Core 1.1 and hadn't been updated since 2017. So much for keeping software up-to-date! The new version is on .NET 7 and the upgrade process was surprisingly easy.

While the changes between the ASP .NET versions have been a little hard to keep track of with Startup.cs being removed and everything moving into Program.cs the migration was made simple by my lazy cheat. I just created a new ASP .NET 7 application from the template in Visual Studio and moved most of the files without any changes, except to update the namespaces.

I also took the opportunity to add caching. Previously it loaded every post file from disk repeatedly just to show a single page. Now, because posts are only updated whenever the app itself is deployed and restarted, cache invalidation is trivial.

I have added the images into git too which generally causes a lot of squawking from people who use git properly (nerds), but keeping things simple should hopefully mean I fall into the pit of success. Each PNG image has been compressed further where possible.

...

Visual Studio 2022 Debugger Freezes

18/02/2022

Wow, blogging with any kind of regularity is hard I kind of hard I guess. Who knew?

Anyway this was just a quick note for a problem I had recently.

I found that my Visual Studio 2022 debugger would hang, freeze or become unresponsive intermittently. Prior to the last update the process would freeze completely, however even after updating it would freeze though the IDE itself would remain responsive.

This freeze seemed to trigger more frequently when using time-travel debugging.

As usual when weird things happen the antivirus was to blame.

Excluding the process named VsDebugConsole.exe seemed to resolve at least all the debugger hangs after adding the exclusion. No doubt some more will occur but at least VS22 is usable again.

To get to exclusions on Windows 10 (old-skool) go to Windows Security -> Virus & threat protection -> Virus & threat protection settings -> Manage settings -> Exclusions -> Add or remove exclusions.

...

Attention Bubbles (Or Why Everything Happens So Much)

31/01/2020

horse_ebooks tweet "Everything happens so much"

Like most side projects that devour hours of time and end up being entirely useless, this one started with a simple question:

Can recessions be predicted by increased interest in news stories about recessions?

The background behind this question -- and you'll have to forgive my complete ignorance of basically the entire field of economics -- is that recessions are a feature of capitalist economies. From what little I've read (and understood); during a boom, businesses scale up their operations to produce more and more "stuff". At a certain point the amount of "stuff" exceeds the demand for "stuff" and businesses and sectors are left holding a load of plant/equipment/employees they no longer need.

...

Bezier Curve Bounding Boxes

18/12/2019

One of the challenges for generating accurate character sizes in a PDF document I encountered while building PdfPig was working out the bounding box for a cubic Bezier curve.

A cubic Bezier curve is defined by 4 points; the start, end and 2 control points.

We can number the points for use in the formulae in this post:

  • Start: P0
  • Control 1: P1
  • Control 2: P2
  • End: P3

This gives the formula for the Bezier curve:

formula from Wikipedia

...
1 2 3 4 5 6 7 8 9 10 11 12