The Day After Dev Report #4

Some good programming work done this week, despite busy-ness. Beware, this is a slightly long and involved post on very many topics!

I’ve been less productive than I’d like recently. After MCing the trivia recently, I had to prepare a few days of teaching and host our weekly D&D session, all of which took a bit of time and a lot of energy out of me. I suspect I have a ninja virus that is hiding in the shadows of my immune system, slowing sapping my energy but not sinking the knife in yet.

My main focus in the last fortnight has been the GUI and Input managers. You know, take mouse and keyboard input in and do stuff. The libraries were linking and loading fine, but there were weird inconsistencies. I couldn’t take screenshots and while unit tests passed, they felt janky. Turns out there were a bunch of easily-fixed components that revealed some systemic issues. It’s like tracking a trail of ants back to a blanket that you whip back and find something horrific underneath. But not as dramatic, I guess.

I wasn’t injecting inputs correctly, and I wasn’t informing my game of things that the OS might like to do (like switch focus and resize the window). That seems to be fixed. In fixing that I’ve combined the InputManager and the GUIManager into one object because they were talking enough to each other to not have to care about the separation of concerns. This has made the GUIManager fairly burly, but as it’s the nexus of a bunch of things (input, graphics and actually doing UI) it needs to be.

In patching this I realised I had gone down two design paths simultaneously. So a game runs on a Game Loop. Every loop is a game tick, which should roughly correspond to a graphical frame. 60 ticks a second is 60 fps. Every tick you redraw the screen, do animations, capture input and do whatever you need to. All of my engine components inherit a structure called Manager. It gives a uniform way of setting things up and shutting down. It also had a tick() function so that every tick, the component gets to do its thing – the GraphicsManager would redraw the screen, the InputManager would capture input and so on.

Now on the flipside, you need to get components to talk to each other. You don’t want to make the engine too rigid for a variety of reasons – for example, a flexible structure allows you to write a dedicated server and the game client using the exact same code and only one conditional statement. So instead of components necessarily calling functions on their buddies, they do things via message passing. One message I had implemented was basically: “Hey everyone who is interested – it’s a new tick!” Your actual game loop would be one line – send that message – and then you could arbitrarily have whoever notice that and respond.

The tick() function and the GameTickEvent more-or-less do the exact same thing. I think I prefer the latter, so I need to move code around and change my unit tests accordingly (who just call tick() on isolated components because that is easy). I am just about to do this code surgery, but I figured I should get a dev report out.

Once I get input, the GUI and the basic game loop sorted and me comfortable with it, I can actually start prototyping menus and gameplay. Which is great, given we’re halfway through the year and I want an alpha version by the end of the year.

Aside from the programming I’ve been looking at graphical style. Alice Carroll drew me some awesome scenes from the game, and I’ve been using them as a style reference. I’ve been promising to show these for ages, so here’s the first one.

The Day After – The Courier and The Twins by ~CognitiveDiscodance on deviantART

You might notice the dirty frame and light texturing, variable-thickness lines and a muted palette. All things I want in the game, so I’m trying to capture the style and figure out how I want to implement and tweak that.

I’ve been writing scenes for different characters. Recent news stories have given me an absolute avalanche of potential character notes for The Hacker, and to a lesser extent, The Spy. Thematically, I slightly prefer the post-Cold War hackers like Kevin Mitnick than the current political ones. In my opinion, the Cold War is the best spy setting, so doing a modern tweak on that stuff and ignoring the quagmire of the modern political cypherpunk movement is perhaps where I want to go with The Hacker/Spy dynamic.

The Scientist – “Evie”
My favourite character has pretty much been cemented: The Scientist. She’s already got this unique voice and approach, and is fun to write scenes for. The Hacker will be lots of fun to write for, but it’s a balancing act of making him just barely likable, whereas Evie (The Scientist) is adorable and admirable. The other characters need my love, but it’ll take a little longer to become acquainted.

After writing some scenes for The Hacker, and in the fallout of Gabe from Penny Arcade being a dick, I’ve thought long and hard about players’ rights. I’d like to figure out a Players’ Bill of Rights for Cognitive Discodance, but it’ll take some time and care. Basically you write games for people to have fun. Maximizing the people having fun or learning something is good. Being a jerk in the arenas of race, sexuality, sex and gender, and religion (amongst others) minimizes fun. I want my characters to run the gamut of nice person to jerks, but have the game be ultimately very respectful of the player. The Hacker, for example, could easily spout off a bunch of dead baby jokes from Reddit. It’s well within his character and could even be used as that bridge between humour and the dark situation the Survivors find themselves. But it could just be really offensive. I think the Penny Arcade guys should know better, but it’s scary to see the anger and violence in the opposition. I want to make fun games that make people think. Can you risk making people volcano-level angry? I dunno. Something to think about.

The Short and Sweet

  • Collapsed InputManager and GUIManager into the latter.
  • Fixing the Manager core code.
  • Fixed various OS hooks.
  • Uploaded The Courier and Twins action scene.
  • Sketching more GUIs and menu flow.