My REST Cache plugin for WordPress makes heavy use of DataTables and makes use of a DOM tree, which was my motivation for writing these two modules and my DOMDocument extension. Now that these components are fully complete, and issues relating to the initial release milestone are almost done with, I’m hopeful to release the plugin on WordPress.org within a matter of days.
Payload is a take on a very old space artillery game which features destructible planets. Traditionally these games would use pixel bitmaps to represent the planet terrain. I wanted to move away from pixel based physics and into vector based physics as they’re more accurate and many, many more tools and libraries exist for working with vectors. I needed a way to break planets (circles) up into smaller parts so that when they’re struck, chunks can be removed giving a nice, destructible feel to the game whilst being able to take advantage of vector based physics.
My initial setup was a circle of vertices, or “sites”, and then random, evenly distributed points within the circles radius, which was then run through Delaunay triangulation to produce a triangular mesh for the physics engine. The idea is to allow parts of the model to be broken off without using expensive techniques like CSG. Unfortunately, it appeared that the triangulation was sometimes creating very, very small area triangles or even degenerate triangles. I used a PRNG to make seedable game worlds in order to have a means of consistently reproducing these stalls. From there I was able to add functions to test for triangles with colinear vertices or tiny areas, reject those triangles and establish that those were the cause of the stalls.
Unfortunately this makes the Delaunay triangulation approach pretty much unusable, so I’ve switched to a Voronoi set instead, which produces more consistent results in terms of polygon area.
This gives much more consistent results, and so far hasn’t given me any issues. I’m somewhat busy getting the REST cache to release and learning Laravel, as well as doing a few freelance jobs, but I’m really hopeful to make some progress with this project soon. I’m considering learning Vue.js, or possibly re-visiting React. Payload would be an excellent environment in which to learn such a framework!