Skip to content

v3.4

Choose a tag to compare

@BurnerAccount-dec BurnerAccount-dec released this 15 Nov 04:29
· 10 commits to main since this release

3.3 was published on GitHub; this section is everything after it.

  • Release tooling and documentation: publish.bat, make_release.bat <version> [publish], docs/RELEASING.md. publish.bat v3.4 "what changed" builds, runs ctest, checks (with git grep over every file git would commit) that the Windows user name is nowhere in the files and that git has an author e-mail, commits, pushes and makes the GitHub release with gh; without the message it only builds, tests and checks. make_release.bat takes the version (it was fixed at v3.1), writes the release notes from the version's ## New in section of this file to release-notes.md, and with publish runs gh release create with the zip. docs/RELEASING.md has the one-time setup (tools, gh auth login, a commit identity that is not yours, the remote), each step by hand, and a table of what to do when a step stops.

  • Fix: TNT crashed with the gravity zone (removeBlocks: attempt to compare nil with number in makeExplosion). The game's explosions go through everything in their radius and compare its strength and defence; the zone's sensor circle has neither (it is not a block), so a TNT near the zone raised a script error (first seen on level 2-20). The mod now gives the zone strength and defence of 1e9. Reproduced on level 1-1 with a TNT next to the zone (error with the mod, none without it or with the zone off; none with the fix, the TNT explodes and scores).

  • Concave and large polygons everywhere, a no-limit shape cast, and star / wedge / chevron wood blocks. (1) Physics: createPolygon (and the polygon parts of compound objects) used to give Box2D a concave outline as it was (it made the convex hull) and cut an outline of more than 8 points into a fan from the first point (right only for convex shapes). A concave outline is now split into the fewest convex pieces of at most 8 points (src/physics/polygon_decompose.h: ear clipping, then Hertel-Mehlhorn merging), one fixture each on the one body; convex outlines keep the old paths, so existing levels are unchanged. Checked: a 10-point star of outer radius 2 / inner radius 1 and an L of area 7 get masses 5.878 and 7 (their real areas), a cast into the notch of the L hits the arm and not the hull. (2) Shape cast: the 8-vertex cap is gone, {points = ...} takes any convex or concave outline (up to a few hundred points; each convex piece is swept with the time of impact, the earliest touch counts) and {sides = n} goes to 128. A T-shaped caster sent down at a star stops with its spike tip on the star's top point (y = -35.075 for a tip 3 below the centre and a star top at -32). (3) createPolygonSprite(newName, source, points [, outline [, darken [, fill]]]): a copy of a sprite cut to a polygon (anti-aliased, optional darkened edge, optional fill of the source's holes). (4) Shape blocks (extra_scripts version 16, section 5): WoodBlock13 (star), WoodBlock14 (wedge) and WoodBlock15 (chevron) are registered in blockTable.blocks as polygon blocks with their own cut sprites for the four damage stages, and the wood group's lastIndex is raised for the editor's keys; add your own in shapeBlocks.blocks. Spawned over level 1-1 they fall and come to rest on their real edges (the star on two points, the chevron on its legs). Needs a rebuild.

  • Shape cast: rayCast takes a shape (new ShapeCastAll in the physics), and the laser is an octagon. rayCast(x1, y1, x2, y2, all, shape) with a shape table ({radius=}, {sides=, radius=}, {w=, h=} or {points={...}}, plus angle and skip; see docs/SCRIPTING.md) sweeps that shape along the segment instead of a bare ray. Box2D has no shape cast, so it is built from QueryAABB over the swept area and b2TimeOfImpact against each fixture (the bundled 2.1 solver reports only t, the 2.2 one a state; both are handled); the hit comes with the centre of the shape at the moment of contact (cx, cy), the contact point and the normal. Without shape nothing changes. Checked on level 1-1 with a horizontal cast at a plank column: ray hit at x = 39.47, circle of radius 2.5 stops with its centre at 36.92, an octagon of radius 2.5 at 36.82, a 5 x 5 box at 36.82. In extras/extra_scripts.lua (version 15) the laser is now an octagon the size of the bird (laserMod.shapeSides = 8, shapeRadius, nil = the bird's own radius; shapeSides = 0 gives the old thin ray), so it is stopped by rock and immovable things at the width of the bird, and it eases in to the cursor position cached when it fires: the head travels there in laserMod.beamTime (0.15 s) with laserMod.beamEase ("inCubic"), and whatever it crosses is hit as the head passes it. Needs a rebuild.