I've kinda been quiet for a while. The main reason is that world events finally got to me. I had been doing ok mentally, working at home, spending a lot of time outdoors, etc., but eventually the COVID pandemic and the California drought+wildfires drained me mentally, and I spent much of the summer unproductive.

I decided to get going again, I should work on easier things. This strategy has worked in the past for me. I spent part of the summer following the reddit r/roguelikedev summer tutorial series. Each week I approached the tutorial topics but decided to implement them differently than what the tutorial did. I implemented "thin walls", a different inventory system, a different ui, a new map generator, tile graphics, and a few other things. It was fun. It wasn't too hard. I wrote up my notes and included a playable version.

After that project, I looked through my ideas list and remembered that I want to make a lot of small updates to existing pages.

Patterns added to A* diagram
  • Rectangle hexagon maps - I've gotten some questions about this section of my page over the years, and I realized that the page was focused on what the loop generates (focus on input) rather than how to get the desired result (focus on output). I rewrote that section and I'm much happier with it now.
  • Cached image regeneration - On my noise-based terrain page, I load the page with images at first, and then I swap them out for interactive versions on the first interaction. This helps the page load faster. The trouble is that I have previously been manually generated those initial images. What a pain! I realized that the pain also meant it discouraged me from updating that page. I decided I should automate the cached image generation. I tried using a "headless gl" library for this but couldn't get it to work, so I switched to running a local webserver and sending the images back to the webserver for saving. It was only 20 lines of code to make a webserver in python, and 10 more lines to remotely control the chrome process. I'm quite happy about this, as I think it'll encourage me to update this page more often.
  • Pathfinding page patterns - Last year I had switched my pathfinding pages from SVG to Canvas in part to make the page load faster and in part because I wanted to take advantage of Canvas to draw more things on the diagrams. One of those things was to use patterns in addition to color to distinguish some areas of the diagrams. I had high hopes for this when I started, but it turned out that a lot of those ideas weren't really practical, so I ended up changing only a few sections.
  • Hexagon page cube/axial merge - Over the years I've realized that I made a mistake in the cube coordinates I presented on the hexagon grid page. I used x,z,y as the names of the axes, but x,y also for cartesian coordinates. I had wanted this connection because I wanted cube coordinates to feel as easy as cartesian coordinates. But cube coordinates are also similar to axial coordinates, which used q,r for the names. So the correspondence was q,r and x,z (not x,y!), which was error prone and was the source of many bugs in questions that readers had emailed to me. I decided to finally switch the x,z,y names to be q,r,s, so that it matched axial coordinates more closely. And I changed the prose to emphasize that axial and cube are essentially the same, but axial calculates s as needed while cube stores s preemptively. While making these changes I also tried to improve sample code on the page. I added definitions of the helper functions cube_add, cube_subtract, cube_scale, and I changed "math like" variable names P, C to "code like" variable names position, center.
  • Map generation: redistribution - On the terrain from noise page I have a section that describes using exponentiation to change the distribution of elevations. I have an interactive chart that shows the function, but I never labeled it! I added labels to that chart and also added that same type of chart to show how terraces work. I'd like to extend the same idea to explain how latitude-based climate, ridge noise, and islands work, but I haven't done those yet. The island section of the page I'm especially unhappy with and want to rewrite it completely.

The main idea here is that my pages aren't set in stone. Unlike an academic paper or a video tutorial, it's relatively easy to update a web page, and I should do it more often. This means both:

  • as I learn more, I should improve my pages
  • I shouldn't wait until a page is "finished" before publishing it

Working on smaller projects works better for me when I'm easily distracted and can't follow through on grander plans. If I do dream up some grander plans in the near future, I'm going to divide them up into small (week-long) independent projects so that I can keep making progress.

1 comment:

NYCynik wrote at November 08, 2021 3:21 PM

Glad to hear you are okay! This has been a very hard year! Especially to get motivated to do projects! Or at least for me! Thanks for the great post!