• How to Make Auto-Resizing Text Panels in Godot

    In Godot, have you ever wanted to make a panel that automatically resizes to its text contents, such as in a description panel? While you may initially think a Panel node might work for this application, that particular node lacks the necessary resizing functionality. Rather, somewhat obscurely, you can instead use a Label node, then override its normal theme style to make it look like a panel.

    How to Make Auto-Resizing Text Panels in Godot
  • Physics for Pits in Top-Down 2D Games

    Lately, I’ve been interested in making a game with 2D top-down platforming elements, with the ability to jump similar to The Legend of Zelda: Link’s Awakening. To do this, one of the problems I’ve needed to solve was how to model the physics of holes or pits. This post explores some realizations I made while attempting to tackle this problem, along with the resulting physics.

    Physics for Pits in Top-Down 2D Games
  • An Approach to Randomly Distributing Game Collectables

    At first glance, the problem of distributing game collectables throughout a cell-based procedurally generated map with predefined collectable spots may seem simple: for each collectable, simply draw a random collectable spot and assign the collectable to it. However, this approach is not without its pitfalls. For instance, if the collectable spot density throughout the map is non-uniform, the distributed collectables will also have a similar non-uniform density. Furthermore, a random distribution does nothing to prioritize placing treasures off the main path, in nooks or dead-ends, as an actual game designer might place them. To compensate for these shortcomings, rather than placing collectables purely at random, we can assign higher or lower weights to each collectable spot based on their desirability, then draw random spots based on these weights. This post presents an approach to allocating collectables based on such weights.

    An Approach to Randomly Distributing Game Collectables
  • Wire Sag-Tension Algorithm

    Sag-tension calculations are a significant aspect of transmission line design. Whether evaluating line clearances, structure design loads, or providing section stringing information to construction, sag-tension calculations must be performed. However, often, documents covering the process only present a high level concept of the variables involved without presenting a concrete or exact calculation algorithm. On occasion, the calculations are presented in old publications that do not cover more modern approaches and considerations. Or the exact details of the calculations are not presented for proprietary reasons, hidden within the design programs of the companies that developed them. This post is intended to present a complete algorithm for performing sag-tension calculations, laying out all of the equations necessary to perform the calculation. If you plan to implement the algorithm, a programmatic approach will almost certainly be required since iterative calculations are necessary.

    Wire Sag-Tension Algorithm
  • How to Use Jupyter Notebooks for GitHub Pages Posts

    Due to their ability to directly incorporate code and code-generated visualizations, Jupyter notebooks are an excellent tool for technical blogging. However, some extra steps are required to setup and convert Jupyter notebooks to a format that can be used by Jekyll, the site generator used by GitHub Pages. This post provides the steps necessary to prepare a Jupyter notebook for conversion to a markdown document that can be used by Jekyll. In addition, it provides a script by which all posts for a GitHub Pages website can be converted via automation.

    How to Use Jupyter Notebooks for GitHub Pages Posts
  • Minimum Distance Between Ellipses

    This post provides an approach for calculating the minimum distance between two ellipses using gradient descent to optimize the square distance equation between points on the ellipses.

    Minimum Distance Between Ellipses
  • Minimum Distance Between Ellipse and Point

    This post presents two iterative methods for finding the minimum distance between a point and ellipse. The first method (Method 1) uses gradient descent to optimize the square distance formula between the point and a point on the ellipse. Meanwhile, the second method (Method 2) uses Newton’s method to find the minima using the square distance formula’s derivative.

    Minimum Distance Between Ellipse and Point
  • 1
  • 2