"Game as a service" anecdote

The lesson given here, https://hero.handmade.network/episode/code/day011/#2048, describes the process for thinking about an "operating system as a service" to the game, or a "game as a service" to the operating system. Another way it is described is whether the game abstracts the operating system for itself, or whether the game abstracts itself for the operating system.

The proposition is that the game should abstract itself for the operating system. An argument given is that there is an asymmetry between the flexibility of the game and operating system, especially considering there may be different types of operating systems but probably only one type of the game. Another argument given is that it is naïve or impractical to try and create abstractions of complex things like operating systems, whereas making an abstraction of your game can be fairly straightforward.

I may be missing some of the points that were made since I am going off of my memory from a few years ago when I watched it. But my point is that I think this lesson is such a good lesson and I was able to apply it these last couple weeks at work.

We created a couple of generic AWS Lambda functions with "layers" (AWS terminology) that were abstracting external systems, the first system in the POC being Salesforce. The idea was for these generic Lambdas to make calls into the external system layer, and it was fine until we had to start making multiple calls into the layer and I realized this approach would not do well once new external systems were added. I remembered Casey's lesson and realized we were doing it backwards! The Lambdas need to perform like platform layers because the external systems are the complex, flexible parts of this project, and it would have many headaches if we continued to try and abstract them.

There wasn't all that much code yet (and yet, already complications) so I spent a day and reversed the roles of these Lambdas and "layers" and it was like magic how all the complexity fell away; things I didn't even expect were simplified. Before the change, I could tell my brain was fighting against the abstraction. Now, the mental model is clear and simple.

All of this really just to say thanks for this lesson and all the rest!

Edited by Ahh on Reason: Initial post