Developer Advocate at Canonical working on Snapcraft & Ubuntu, podcaster, father, separated, cat lover & a geek through and through. Apparently a script kiddie.
2563 words
https://popey.com/@popey

Synergism Devblog Week 1

In my previous blog post, Committing to a Project, I talked about getting started building something. Well, I rummaged through the Vault of Unfinished Ideas and rebooted it. Future posts I make on this subject will likely be shorter, and more bullet-pointy. This one is more of an introduction.

As so often happens, a while back I pinged my good friend Stuart Langridge to get a sanity check on a game idea. I sometimes ping him with ideas, and he does the same with me. Our Telegram chats frequently start with "Hey, here's a game idea I just had". We then discuss it over minutes, hours or days, bouncing ideas back and forth. Finally we squirrel the idea away in The Vault to gather dust.

This one dates back from May 2018. I've dusted it off. It's going to be a game called "Synergism". Thanks to Stuart for the name!

It's an online multiplayer game, which is ambitious, for me. I'm using Construct 3 to develop it. Yes, I could probably have used some other toolkit, language or framework. But I didn't. There's a ton of reasons for choosing Construct 3. It's a "cloud based" development environment. So no matter what computer I'm sat at, I can just launch a browser tab to https://construct.net/ and continue working. 

Construct 3 generates HTML5 & Nwjs based builds for numerous platforms including the main desktop environments, Windows, MacOS and Linux. It can also create builds for mobile platforms and the web. I'd like to make this game as widely accessible with minimal platform-specific changes as possible. Construct enables me do that. 

Construct is also super easy to use. I'm "Not a Developer" but have enough coding "skills" to knock a game together. However I don't want to have to code everything. I like that Construct abstracts away physics, OpenGL, audio subsystems, tilemaps, sprite layering and all those other trixty things.

But we're getting ahead of ourselves. I started work on this a week ago, and have managed so far to knock together a very simple title screen and lobby area. This won't be pretty initially as I'm just trying to make it all work. So if you see any prototypes or demos linked from here, expect them to function, maybe, but look like hot garbage :D

I appreciate I haven't described the game at all at this point. That'll come. It's all a bit up in the air right now. I'm kinda designing as I go. I often fall into a trap of planning everything out too much and not actually getting anything done - see previous blog posts on this subject. This time I've mostly just dived in, followed a couple of tutorials and hacked about some code.

Here's what I have done so far.

  • Start new Construct project
  • Configure saving to the cloud
  • Create layouts for Title Screen, Lobby and Game
  • Create a super basic title screen using a large word and "pretty" font
  • Build Lobby screen 
    • Accept a player name
    • Allow player to Host or Join a game
    • Offer a game code (to share if hosting) or allow picking a game code if joining an existing game
  • Generate Web, and Desktop Linux builds to test
  • Upload game to https://popey.com/synergism

Next up I need to register each player who joins and then allow the players to actually start the game. Then, you know, develop the actual game. Tune in next week to see how far I get! :D


Committing to a Project

In my last blog post titled Paralysis of Choice I talked about my problem with committing to a personal project. I had a bunch of lovely feedback, some via the Twitter thread where I mentioned the post. A lot of it was from people telling me they feel the same way, or that it reminded them of other similar posts. 

So I'm not alone! Good. Phew!

A few days later Liam Dawe, my Internet friend from GamingOnLinux tweeted out "Tempted to make a game. Perhaps a wave based shooter, with some cool effects. Sounds like a good starting point?". This piqued my interest. Liam then says "I've wanted to for years, so now I'm just going to fucking do it. Even if it's shit, I did something."

Can relate!

So I piled in with the suggestion I was "Thinking we should both do something (separately) to help motivate eachother?".

This felt like a good plan! We could both work on our own little projects, in our own time, and provide updates and motivation to eachother when we've made some achievements. I liked this idea. I will be more motivated to know someone else is working on something too. 

Skip forward a week or so and Liam taunts me with "started your game yet? 😇"!

Yikes. All I've done is think this was a good idea. I'd not written any code, or even thought about what kind of game I want to write. But wait, this is supposed to be fun, a distraction, and something I can do in my spare time. I should go easier on myself, while still committing to make something, whatever that is. 

Today I had a chat with my good friend Stuart, who always encourages me to create stuff. I mentioned I was 'falling behind' with the 'Liam Challenge'. Stuart and I have a meeting later on this evening about something else. He has challenged me to have something done by the discussion we're having later this evening. Thankfully the kids are out, which gives me a whole Saturday afternoon/evening to myself. 

So I've rummaged through my Vault of Unfinished Ideas and found one I have been meaning to write for a few years now. Now it's a Small Matter Of Programming. I'll be back when I have something to show. Cheerio!

Paralysis of Choice

On the most recent episode of The New Show (a podcast I do with Daniel Fore and Joe Ressington), one of the listener questions was the following:

Have you ever struggled with the paralysis of choice, especially when deciding on a tool, service or product to use, tech or otherwise?

You can hear the discussion of this in episode 10 from around 25 mins in.

Initially my thoughts revolved around consumption. I have no real difficulty choosing products as a consumer. I walk into a store, find a thing, buy the thing and walk out. I rarely browse, unless it's a shop where I have no intended purchase, like on a recent trip to a game shop or comic store while on holiday.

After Joe talked about his experience of the paralysis of choice when he's creating content, it got me thinking. I have a problem with content consumption, in that I find there's too much choice (Netflix, Spotify, Podcasts) which leads me to choosing the easy option of listening to or watching the same stuff repeatedly.

However, thinking more, I also have the same content creation paralysis too. Mostly around game and application development. Anyone who's heard me online in the last year will know I don't consider myself a "Developer" despite my job title being "Developer Advocate". I can advocate for the tools other people develop, but I don't technically develop them myself, is how I rationalise it.

But in my spare time, I often consider ideas for games and applications. I have physical notebooks and electronic documents going back maybe 15 years, containing ideas, sketches and plans for games and applications - mostly games. Over the years I've made a hundred aborted attempts to turn these ideas into real, tangible things. The problem I think I have, is choice.

As I'm "not a developer" I've not had any formal training or education on software development, at least not for over 20 years. Back in the late 1980's at school and college I learned a bunch of languages like InfoBASIC, Z80 Assembler and even COBOL. I later taught myself Pascal and dabbled with 8088 Assembler on the PC. 

Through my work career I've fiddled with a bunch of languages including SAP ABAP/4, Python and Java, but never to a point where I could plan and develop an application from start to finish. More recently I've played with Godot, Unity, Construct 2 & 3, Phaser, Lua, Love2D and more I've probably forgotten.

There's (at least) two issues here. Firstly, because I don't know any of the tools particularly well, I frequently get stuck very early on. I might choose a toolset / framework, bootstrap a project and then get frustrated because I don't know the language or libraries well enough. I will put that to one side, and maybe come back to it later, but often not.

The other problem is that of choice. Because I have a high level, but surface-deep idea of a bunch of languages and tools, but not in-depth knowledge, I can't pick one. I try one, get frustrated, and go back to the start. The next time around I remember the frustration, and pick a different tool, thinking things will be better. They aren't. 

Part of the problem is not doing this as my day job - not a developer, remember - so not having a bunch of solid experience to draw from. Another part is that I often only have a couple of hours here and there to hack on these projects in between work, looking after the family, and the house. So I never get deep into any of the projects before either running out of time or getting frustrated.

In the past, one solution I used was to pay someone else to do the work for me. I designed the application, wrote a spec and they did the actual coding. I can understand the way it all works once someone else wrote it, but actually starting from a blank page and writing the code, seems like something my brain isn't wired for.

Am I alone? Other people get this? What's the way out? Help!

Counting to 100 Million

About 10-15 years ago, back in the heady days of Hampshire Linux User Group, we had a Wiki. It ran a heavily patched version of UseModWiki that we'd modified to add anti-spam and anti-abuse protection. We'd affectionately called it "AbuseMod". It's still kinda there, but I don't think the content is ever touched.

We used it to co-ordinate meetings, take notes, and some other fun sillyness. One such fun was Hugo's Random Benchmark (Note: Not a benchmark). It was a single line we'd each run on our computers to see whose was fastest (Note: Again, not a good benchmark). It did this by counting to 100 Million in Perl. It's a super simple single-line shell script which just times how long the computer takes for perl to go from 1 to 1e8 (100 million).

Here's the "script":

time perl -e 'for($i=0;$i<1e8;$i++) { }'

Here's the resulting output, as produced on a typical Linux system:

real 0m2.868s
user 0m2.828s
sys 0m0.016s


Again, not a benchmark. It's a single threaded count, so typically won't get any faster if you had a dual core, or many core system. But back in those days, a lot of the systems only had one anyway, so the point is moot. It also doesn't "measure" any other part of the system. It's fun though.

Over time we'd add our own systems to the table on the page. Some (such as myself) would strive to run the "benchmark" on ever faster systems. Others aimed for the bottom of the table, and some went for esoteric or imaginary systems.

With each newer system that was measured, the amount of time shrank a tiny bit. Getting from double-digit times to single-digit was a milestone. Further reducing the total number of seconds by a little with each update. 

The page hasn't really been updated for over 10 years now. It was fun at the time, but many of those people have moved on from the LUG, and the site isn't super accessible to edit anymore. It's a little sad, but I do sometimes still go back and grab the script and run it on modern systems, just to see if it's got any quicker.

The output above came from an Intel i7-6820HK running Ubuntu 20.04 under WSL in Windows 10. I don't think back then I'd have envisaged running the benchmark on a system like this. 

I do wonder what the fastest time we can get out of the not-a-benchmark in 2020 might be? Can you get it under a second?

Multiple GPUs in a Skull Canyon NUC

Every 3 years at Canonical we get a laptop refresh fund. I used my last one to buy a ThinkPad T450. My next one is due in November this year. I was considering replacing the ThinkPad with a desktop computer of some kind. I can certainly keep the T450 for portable work, but I mostly sit at the same desk all day, so figure I may as well get a desktop rather than a laptop.

I recently mentioned to my friend and colleague - Martin Wimpress, that my ThinkPad T450 was becoming a bit long in the tooth. There's a Linux Kernel bug somewhere which causes the GPU to lock up randomly when driving 3 displays (internal + two external monitors) which is annoying when you are trying to work on it. It's also struggling to cope when doing a bit of heavy video work - such as having multi-party video meetings, while other things are happening.

On hearing this Martin told me he had a "spare" desktop I could use, as it's sat gathering dust at his place. Once he explained the specs and what I'd be borrowing, I jumped at it. So now I'm typing this blog post on an Intel Skull Canyon NUC. It's a bit nice! I've never used a computer with an illuminated skull on the lid before :D

The interesting thing about this computer is it features a combined Intel CPU/GPU and AMD GPU on one board. The Intel i7-8809G sports a 4-core 8-thread 3.1GHz main CPU and HD Graphics 630 on-board GPU. However, it's bundled with a discrete AMD Radeon RX Vega GPU too. 

What's even more neat is the NUC has a ThunderBolt port which means I can attach an external GPU should I wish. I wish, so I have. The only GPU I had kicking around was an nVidia GeForce GTX 960 (a hand-me-down from another PC which was recently upgraded to an nVidia 1050Ti).

So now this computer technically has 3 GPUs, Intel, AMD and nVidia.

alan@robot:~$ sudo lshw -C display
*-display
description: VGA compatible controller
product: Polaris 22 XT [Radeon RX Vega M GH]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]

physical id: 0
bus info: pci@0000:01:00.0
logical name: /dev/fb0
version: c0
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=amdgpu latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
resources: iomemory:200-1ff iomemory:210-20f irq:191 memory:2000000000-20ffffffff memory:2100000000-21001fffff ioport:e000(size=256) memory:db500000-db53ffff memory:c0000-dffff
*-display
description: Display controller
product: HD Graphics 630
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm bus_master cap_list
configuration: driver=i915 latency=0
resources: iomemory:2f0-2ef iomemory:2f0-2ef irq:188 memory:2ffe000000-2ffeffffff memory:2fa0000000-2fafffffff ioport:f000(size=64)
*-display
description: VGA compatible controller
product: GM206 [GeForce GTX 960]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:40:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: iomemory:2f0-2ef iomemory:2f0-2ef irq:17 memory:c4000000-c4ffffff memory:2fd0000000-2fdfffffff memory:2fe0000000-2fe1ffffff ioport:3000(size=128) memory:c5000000-c507ffff

Cats and dogs living together!

Bit weird, not gonna lie.

I haven't fully exercised these capabilities yet. I did one quick test to see if I could use OBS to live stream a window being displayed with the AMD GPU, but with the stream encoding done via nvenc on the nVidia GPU. That seems to work well. What a time to be alive! 

Thanks Martin, you're not getting this back. :D