## Coordinate transforms, still#

Last post was about my attempt at explaining coordinate transforms. Progress has been slow. I've implemented many of the diagrams but I'm still having trouble with the narrative. Last time I said this was my outline:

1. Show a side scrolling game with some cool camera effects.
2. Introduce world coordinates vs screen coordinates.
3. Solve the problem of scrolling: subtract an offset.
4. Introduce transforms. (may need to be later)
5. Introduce inverse transforms, for mouse clicks. (may need to be later)
6. Introduce cameras. More complicated than offsets, but can do more.
7. Show some cool effects with cameras. (may need to be earlier)
8. Introduce chaining transforms.
9. Show some cool effects with chaining.
10. Demo showing all concepts together.

I've been experimenting with different orders for the topics and now think there are two intertwined “tracks”: the concept track introduces mathematical concepts and terminology, and the problem solving track shows solutions to specific gamedev problems. These two tracks are paired up:

Problem solving Concept
scrolling world/screen coordinates, translate transform
following the player cameras, view coordinates
tile grid coordinates scale transform, chaining transforms
mouse clicks inverse transforms
? function composition
? transform matrices

I think in each case I should start with the problem to be solved, then show the immediate solution, then explain the concept behind the solution. The concepts then lead to a reusable solution. Example:

1. Problem: we want to scroll the screen
2. Immediate solution: add an offset before drawing
3. Concept: we're transforming world coordinates to screen coordinates
4. Reusable solution: a translate transform is a function or object that converts coordinates

The next section is:

1. Problem: we want to keep the player in the center of the screen
2. Immediate solution: use the player plus half the screen size as the offset
3. Concept: a "camera" points at the player, using view coordinates
4. Reusable solution: a camera object is placed in the world, and we use that to build the translate transform

What order should I present these topics? I'm not sure. I know I want to put scrolling first. If I put mouse clicks second, then it's fairly easy to solve, and there's less motivation to learn inverse transforms. So I might put that later. If I put tile grid coordinates second, then it leads to chaining transforms together, which will be useful for following the player with a camera. Or if I put following the player second, then it leads to view coordinates, which might further motivate chaining transforms.

I think the main problem is that I'm not feeling particularly inspired right now, so I'm working very slowly.

## Coordinate transforms, again#

Back in 2015, I had attempted to explain coordinate transforms in terms of matrices. In 2016, I started over, trying to focus on coordinate transforms without matrices. That didn't work the way I wanted either, and I wrote a blog post about that, saying that I was going to focus on game cameras. I started that, but lost motivation. The last line of that blog post is: Well, I failed. I lost motivation to work on this so I've put it on hold … again. I think I may take a long break from tutorials.

I did take a long break. I joined a game company as a consultant, mentored people making interactive articles, improved my existing pages, and also worked on lots of other things (2017, 2018). I'm reasonably happy with how things went. I've continued doing these things, but my attempts at making new tutorials have failed. Several times I tried to make a tutorial about differential heuristics for A*, but lost motivation. I tried to make a tutorial about common heuristics for A*, but lost motivation. In both those cases, I realized that it's hard to write a tutorial when I don't really understand the topic nearly as well as I thought I did. I also run into scope creep: I start with an idea but keep adding more topics to the page faster than I can actually write them.

I don't know where that leaves me. Will I ever write a comprehensive tutorial again? I don't know.

For the past few weeks I've been revisiting coordinate transforms. What am I doing differently this time? I'm keeping the scope small. Instead of all topics related to coordinate transforms, I've picked a style of game and limiting myself to the transforms that make sense for that style of game. All other topics I can tackle later.

Here's the rough outline:

1. Show a side scrolling game with some cool camera effects.
2. Introduce world coordinates vs screen coordinates.
3. Solve the problem of scrolling: subtract an offset.
4. Introduce transforms. (may need to be later)
5. Introduce inverse transforms, for mouse clicks. (may need to be later)
6. Introduce cameras. More complicated than offsets, but can do more.
7. Show some cool effects with cameras. (may need to be earlier)
8. Introduce chaining transforms.
9. Show some cool effects with chaining.
10. Demo showing all concepts together.

In parallel with implementing the interactive diagrams, I'm working on the narrative structure. The standard textbook style is to start with definitions and then give examples. I think that can be unmotivating. But it's also hard to talk about an example without knowing what the concept is. I'm still trying to figure out how to best arrange these sections. This part is often harder than implementing the diagrams.

If this page works, I can then add another style of game to introduce vertical scrolling, and then another style of game to introduce rotation or zooming. With enough examples, I think I'll understand the topic well enough to be able to write a reference that covers translate, scale, rotate, skew, etc. But even if I don't get that far, the first page can be useful on its own.

The "first page can be useful on its own" also served me well for the A* page and the hexagon page. The A* page was originally intended to be one part of a much longer series about pathfinding. The hexagon page was originally intended to be one part of a set of pages that covers all grid types. Those pages became useful on their own, and I haven't written the rest.

## Reader experience with 404s#

There are many days when I don't feel like working on my project. I use this feeling to "productively procrastinate" on things that I've been wanting to do but haven't done yet. Earlier this week I decided to tackle two related problems:

1. I want to know which pages are reachable from the home page. I can then review the ones that aren't reachable and consider adding them if they're finished.
2. I want to make suggestions on the 404 page, but only to pages that are reachable from the home page. There are a whole bunch of random pages I have that aren't finished or useful, and I don't want to use those for suggestions.