Browsed by
Category: Technical

C# App hangs when BitmapDecoder.CreateAsync is called

C# App hangs when BitmapDecoder.CreateAsync is called

Calling ASync functions from UI event handling routines/the main UI thread in C# turns out to require some basic knowledge to avoid getting into deadlocks. I sort of jumped in without doing much learning, so here were some of my learning resources as I made the inevitable mistakes:

Debugging tips:

C# and Universal Windows App file handling:

The details of fighting game logic

The details of fighting game logic

Making a button-mashing fighting game like Street Fighter has some surprisingly sophisticated logic when it comes to frame-perfect animation hits and combos. Strange Wire does an awesome job describing the difficulties and some ways to solve them.

What are those difficulties? Problems like checking hit and hurt boxes at the right parts of animation frames. Attaching events at the right parts of the animations can be tricky – especially if animators are still tweaking them. And the ever-present issue of keep the code clean.

Definitely worth a read whether you’re doing 2D to 3D fighters.

The interesting possibilities of Google Stadia

The interesting possibilities of Google Stadia

Stadia disclosure at PAX Dev:

Google has released the first round of game announcements for Stadia. But this isn’t your father’s Steam store.

“It was important for us with Stadia that we moved away from the Wild West that exists in some storefronts today,” Bautista said, speaking at PAX Dev. “Just because a studio has a game idea doesn’t mean we’re going to allow them to publish that game on our platform. Just because a developer or publisher releases a game that was a success, we certainly aren’t going to allow ten, 20, 50 fast follows to come after that.”

Google is hand curating their game list. Which is not totally surprising since this is new technology that has been tried and failed before. They require devs to fill out a form – and told them to do so carefully and thoughtfully. It will be reviewed and if accepted, you’ll get an email to submit even more material about your company and pitch. If you pass that stage, Stadia reviewers will then determine which projects to prioritize. If selected after that, you’ll be invited to discussions of a tailored sponsorship package. So, quite a process.

It was mentioned that projects will be evaluated especially on their viability for the Stadia platform. Projects that have specific functionality that is either unique to or shines on Google Stadia will probably be prioritized for partnerships. Example: in Orcs Must Die 3, they have a game mode that allows for orc hordes in numbers not possible on a local system, but easily handled in a cloud environment with massive parallel compute.

Nodes and instances

You can develop directly in the cloud itself or you can use one of Google’s “nodes.” There are two kinds of nodes: server development nodes, which are very large physical devkits that go into a server room at your studio and have four different Stadia instances on them; or desktop development nodes, which have a single instance.

With the near complete takeover of engines like Unity for development, (engines that increasingly have cloud compiling and other cloud services for game development) the creation of a complete cloud-based development environment could be foretelling the next big transformation in game development.

In fact, Google urged applications to consider the unique capabilities offered by running on a cloud-based platform – and put them into your overall game design. Image horde modes on the order of hundreds of thousands of animated characters. Something impossible on a single platform, but easily done on a massively parallel environment like the cloud. The ideas and new gameplay modes that might be generated are really interesting.

New features

Google Stadia will have other features that developers could take advantage of in unique ways. One that’s been shown before is Stream Connect, which shows multiple viewpoints on a player’s screen at once and is ideal for strategic play.

Another is State Share, a function that allows someone to compile game metadata into a shareable link, that can then be shared to others. For example, you can take a capture of a character wearing specific armor, with a specific weapon, at a certain level, and then send that state out via a YouTube stream, text, or email. Anyone who clicks on it can then experience the game in that state, which can be used to share a game with a friend or as a promotional tool.

Crowdplay, a feature that was teased in the initial Stadia reveal at GDC. It allows a livestreamer to play a game and viewers can queue up to play with or against them, jump in, and join the game instantly. 

Unanswered questions

The biggest selling point of creating a game for Stadia, or other streaming service, is that it has instantly been ported to any platform that supports Stadia. Consoles, PCs, mobile devices, etc. Anything that accepts input and is powerful enough for low-latency video streaming.

However, as has been discovered before, interface/controls are 70% of a game’s experience. Accounting for countless different display form factors and input schemes made game development extremely painful and error prone on early Android devices. A typing tutor game makes sense on a PC with a keyboard, but would probably be a terrible idea on a phone.

There is also the elephant in the room – latency. The United States is a huge marketplace, and internet latency and bandwidth can be radically different from place to place. Even in fairly ideal situations, latency on GoLive was deemed no substitute for local gaming experience. However, turned based games like Civilization and other non-twitch reaction time games (Civs, etc) should work just fine.

I think there’s some really interesting work going on and am excited watching the development of these ideas. I have doubts about latency issues, actual portability of games to different devices, and the costs for the platform/subscriptions; but the ideas of developing in the cloud and new game modes based on massively available compute are really compelling.

Time will tell which pan out.

This is how graphics used to be done kids

This is how graphics used to be done kids

Back in the day when I was learning, there wasn’t much (or any) hardware acceleration for graphics. Programming graphics back then, on 8088/286/386 processors was much like this. Bisqwit gives it a shot.

In this tool-assisted education video I create a simple FPS style walking and jumping scene for OpenGL, with DJGPP, in DOS. In a 256 colors 320×200 VGA mode. This is my first OpenGL exercise. Apologies about some little mistakes in the program (such as reloading the textures on every frame). I noticed them when this video was already late in production, and it would take several days before the new version would be available if I were to fix them, and I’m itching to get this video out and into making the next video already, and none of the mistakes actually prevent the content being understood, so I’ll leave them be. Most people don’t even notice. Twitter: Patreon: (alternatives at Twitch: Homepage: I wrote a FAQ after this video was picked up on Reddit the first time in 2012. Here it is:… Source code and prebuilt lightmaps: (Compiles and runs on Linux):… (includes also a superior ellipsoid-based collision testing, and a buggy WIP for portal rendering: I’m not good with the math.)

Removing the 60fps limit in Dead by Daylight

Removing the 60fps limit in Dead by Daylight

It seems that as games target more platforms on release, they are increasingly dumbing down the controls and limit features to the lowest common denominator platform. For PC’s, this mean frame rates are often capped at 60fps. Dead by Daylight goes even further by not even allowing you to change the FPS limit in the PC game. Those that have tried increasing the limit have run into various animation/physics bugs – indicating that this limit on the PC is due to lack of validation/issues.

The good news is you can remove this limit. If you want to change the VSync or FPS limit then edit GameUserSettings.ini located in your user directory:


Change the following line to whatever you want your max frame rate to be. I have a 144hz display, so I set mine to this:


This next step is not required if you just want to set the FPS limit, but you can also to turn vsync on/off by changing this line to true/false respectively:


Save file. Play game.


Dandy, the inspiration for Gauntlet

Dandy, the inspiration for Gauntlet

I’ve met Ed Logg before, the programmer/creator behind the arcade classics Gauntlet and Gauntlet II and attended his GDC talk in 2012. (I was the one that asked him the question about those that could play forever at 42:53)

Logg was inspired by this Atari 8-bit game called Dandy, developed by John Howard Palevich as his undergrad thesis project at MIT. Some have suggested the ‘inspired by’ was a lot closer to ‘directly copied’, but it was resolved without lawsuit – Palevich got a free Gauntlet arcade system and is now listed with ‘special thanks’ in the credits.

Check out some of the gameplay from Dandy (below) and see how many similarities you see (4 play co-op, monster movement, etc)

For a little extra fun, check out Ed Logg’s first, unreleased, Atari game – called ‘Maze Runners’ and to see how he developed