Projects Jams Discord News
Resources
Unwind Fishbowls Forums
About
Manifesto Our values About
Log In

Automated Crash Reporting in Basically One 400-Line Function

Phillip August 12, 2022

Too Long; Tell Me The Downsides First

Sure, here you go!

  • This covers Windows only. The principles map on to Linux, but the code sample doesn't!

  • Spoilers for the rest of the post, if that's the sort of thing you care about --

Disadvantages to having your crash handler be a side-path of your main program's EXE:

  • Missing DLLs. They couldn't possibly be caught by this setup -- the crash handler process can't launch if it's the same process that's missing DLLs!
  • Static initializers. If you have a very C++-y program with a bunch of global variables with constructors that can crash, then you can launch the process, but you can't safely enter main()!
  • Addressing these disadvantages is covered in the article: build the crash hander as a separate EXE.

Okay, on with the full post.


The unexamined app is not worth shipping

As a Windows app developer, you will eventually want to write a crash reporter, so that you can fix bugs i

Read more

Sir Happenlance is released on Steam

Miles October 23, 2021

The game is finally officially done and has just been put up for sale on Steam:

https://store.steampowered.com/app/1663410/Happenlance/

https://www.youtube.com/watch?v=AS9SJyV0obs

I hope you enjoy the game! I will try to write up some technical postmortems soon.

Read more

Sir Happenlence Devlog #5 - Level Editor Tour

Miles July 28, 2021

I'm starting up on devlog videos again after a long hiatus. In this one, I show off all the features we built into the level editor, as well as some of the challenges of making editor tools for a game with extensive 2D parallax.

Read more

How To Make PrintScreen Work In Exclusive Fullscreen

Phillip June 14, 2021

TL;DR: You have to do a "Low Level Keyboard Hook" and then write the screenshot function yourself.

Hey there Happenlancers, this is a quick aside technical post about windowing & fullscreen - more devlogs are forthcoming, promise!

I recently read "Fullscreen Exclusive is a Lie" by Mason Remaley and was happy to discover that Happenlance already offers most of the functionality recommended in the conclusion of the article. It's a good read and I recommend you investigate this on your own project before jumping into this quick blog post.

In the article, Mason dives into the ways you can enable, and test for, "exclusive fullscreen" mode -- the only window display mode that bypasses Windows's compositor, or roughly, "allows screen tearing". As it turns out, most tests for exclusivity are wrong, but one correct way to test is to take a screenshot with the PrintScreen key. If the scre

Read more

Sir Happenlance Devlog #4

Miles January 11, 2021

This one's a doozy. I talk about new editor features, sprite serialization, new enemy behavior, game AI and game design, arrow physics, gif rendering, fast image resizing, and a new method for implementing a foolproof undo system.

As promised at the end of the video, here is the image resizing code as it currently exists:

[code]#include <tmmintrin.h> //requires SSSE3 for _mm_hadd_epi32 and _mm_shuffle_epi8 #include <stdint.h>

typedef struct Pixel { uint8_t r, g, b, a; } Color; struct Image { Pixel * p; int w, h; inline Pixel * operator[] (int y) { return &p[y * w]; } };

Image downsize2x(Image in) { int w = in.w / 2, h = in.h / 2; Image out = { (Pixel *) malloc(w * h * sizeof(Pixel)), w, h }; for (int y = 0; y < h; ++y) { int x = 0; for (; x < w - 3; x += 4) { __m128i p1 = _mm_loadu_si128((__m128i *) &in.p[(y * 2 + 0) * in.w + (x * 2 + 0)]); __m128i p2 = mm_loadu

Read more

Sir Happenlance Devlog #3

Miles December 18, 2020

In this devlog I show off the weekly progress, including level serialization and new editor tools. I also talk at some length about what kind of thought process goes into deciding how to organize and structure the data in a program, and specifically how that applies in the context of this game. I'm sure it will be familiar topic to most people in HMN. And finally I gripe for a bit about some C++ related problems we've been running into.

Read more