Repository navigation
Releases
v3.8.1
- The level spawner places a level, follows the game's order and draws the blocks' own pictures. (1) Placing: a click on the level's picture shows the level as a half-transparent copy of its own pictures that follows the cursor (it has no body, so nothing collides with it, and the ground cuts it off as it does the real blocks); Return, Space or a click puts it down there, Escape goes back to the panel (
levelSpawner.placement = falseturns it off; Return in the panel still spawns at the cursor at once). (2) The order the game loads them in: folders and levels come in the order of the game'slevelOrder(levelOrder.packsandlevelOrder[pack]), so Level7 is the 9th level of pack1 and the panel says1-9; files that are not in the game's order follow, sorted by number. (3) The picture uses the blocks' own images (static blocks, which the game fills with the theme's texture, are bars; the giant Red Bird is maroon where a picture is not available). Blocks that stand turned (the thin ice and wood pillars) were drawn about the wrong point and missing from the picture; they turn about their middle now, and the picture and the copy match the level.
v3.8
- The level spawner is fixed and has a picture. (1) Spawned objects are made the way the game's own level loader makes them: they are turned to their saved angle, get their material and the theme's texture (static blocks had none), their damage sprites, and pigs count as level goals. (2) The birds of the spawned level join the line-up: each gets the next start number, waits as the other birds do (static) and stands on the ground behind the last waiting bird (
levelSpawner.birds = falseleaves them out). (3) Up / Down walk through every folder of thelevelsfolder that has level files (before, a folder was only found when it had a file with the same number), Left / Right through the files of the folder in number order, and<,>,folder -andfolder +buttons do the same with the mouse. (4) The panel shows a small picture of the chosen level (levelSpawner.preview = falseturns it off). (5) A dropped level file is read from wherever it is, the console saysspawned <file>ornot spawned (not a level file?)for each file that is dropped, and a drop while the panel is open closes it. New script functionlistDataFolder(path).
v3.7.3.1
- The screen wipe is gone from the level editor of Classic 1.6.2. Choosing a level on the editor's level pages, playing it from the editor (Shift+P) and coming back with the pause button or Esc still ran the wipe: the editor's level pages set the editor's mode before the level is loaded, and the way back loads the level while the play test is still the mode, which the check of 3.6 did not look at. The wipe now looks at the mode and at
startedFromEditorwhen the level is loaded (screenwipe.editor = falsebrings the wipe back). Checked by loading a level withstartedFromEditorset (no wipe starts) and without it (the wipe starts).
v3.7.3
v3.7.2
v3.7.1
- Saved levels put birds back properly. Four faults are fixed: (1) the object a variable points to (
flyingBird,selectedBird,cameraTargetObject) was written under the wrong key, so a level saved while a bird was flying came back with no flying bird and the Blue Bird's tap did nothing; (2) a variable that was empty when the level was saved (the bird that is sent to the slingshot first) kept the value of the freshly loaded level, so the level's first bird jumped to the slingshot and took the place of the first bird; (3) the body type was not kept: the games hold the birds that wait as static bodies and make the next one dynamic, so a restored bird that was launched did not move (and a Blue Bird split in that state ended in an invalid position); (4) the trail of dots (birdTrajectory) andallowTrajectoryClearingare saved, so the trail is still there.getBodyType(name)is the new counterpart ofsetBodyType. console = falseinconfig.luacloses the command prompt window that opens with the engine, so the game runs with only its own window (true, the default, keeps it;--promptkeeps it too).
3.7 was published on GitHub; this section is everything after it.
v3.7
- Blue Bird split fixes: when a level is restarted, the pieces of a Blue Bird that split (the one that is
flyingBirdfirst) move back to where the Blue Bird stood when the level loaded, like any other object. A saved level brings back birds that did not exist when it loaded, so split Blue Birds are kept instead of deleted, andflyingBirdand the other saved references find them. - Level spawner (F1): in a level, F1 stops the game and opens a picker: Left / Right choose another level of the folder, Up / Down another folder, Return (or a click on the panel) puts that level's blocks, pigs and joints into the level that is being played, around the cursor; Escape closes it. It is made the way the vehicles of Red's Mighty Feathers (3.3.0) are: every object is created with
createObjectunder a new name (levelSpawner.prefix, a number and the old name) and every joint is tied to the new names. The ground and the birds of the spawned level are left out. A level file dragged onto the window while a level is played is spawned at the cursor the same way (levelSpawner.drop = falsebrings back loading it as the level).levelSpawnerinextra_scripts.luasets the key, the skipped definitions and the texts.
3.6 was published on GitHub; this section is everything after it.
v3.6
3.5 was published on GitHub; this section is everything after it.
- Blocks with holes (any outline, holes of any shape at any position):
createShapeWithHoles,registerHoles, the wood blocksWoodBlock16(a square with a square hole) andWoodBlock17(a wooden circle with three round cut-outs). The hole is real: the physics body is made of the convex pieces that are left (polydecomp::CutHolesinsrc/physics/polygon_decompose.h: the outline and each hole are split into convex pieces, the hole is subtracted piece by piece and neighbouring pieces are joined again), so the mass is lower, a ball goes through, and the block collides along the edge of the hole. The outline can be a box, a circle (a 32-sided polygon) or any polygon, concave too, and a hole can be a box (with an angle), a circle or a polygon, fully inside, in the middle, across an edge or a corner (the top-left corner of a box, say), outside (it does nothing) or overlapping another hole.createShapeWithHoles(name, sprite, x, y, outline, holes, density, friction, restitution, collision, controllable, zOrder)makes one from a script (shapes in world units about the body's origin);registerHoles(sprite, holes [, vertices])gives every block that starts with that sprite its holes (shapes from 0 to 1 over the block), so a level file orcreateObjectmakes it withcreateBox,createCircleorcreatePolygonas before.createPolygonSpritetakes the holes as a seventh argument and leaves them clear in the sprite, with the darkened edge along the hole as well. A block with holes counts the contacts of its pieces with another body as one hit.docs/SCRIPTING.mdhas the shape format;extras/extra_scripts.lua(section 5,shapeBlocks) takesholesin an entry; physics tests for masses, hole positions and the ball passing through are intests/physics_world_test.cpp.
v3.5
3.4 was published on GitHub; this section is everything after it.
-
Save states, in the engine, for every game: leave a level half played and come back to exactly that (
src/lua/save_states.cpp, the Lua tablesaveStates). While a level runs, its state is written tosavestates.luain the save folder every 5 seconds, when the level is left (the game mode leavesupdateGame) and when the game is closed; loading the same level again (the key is the path it was loaded from) puts it back in the first frame the level runs, also after the game was closed and started again. Kept: every object ofobjects.world(place, angle, speed, at rest or not, and every number, string and flag in its table: strength, damage sprite, start number, ...), the script variables insaveStates.globals(the bird queue, shots fired, the score, the timers, the camera zoom), the tables insaveStates.tables(the score table, the camera), the objectssaveStates.objectGlobalspoint to (the flying and the selected bird) and the camera function; what was destroyed is removed again (also frombirds,otherBirdsandlevelGoals). A restart (a level loaded again withinsaveStates.restartWindowseconds of leaving it, or aftersaveStates.forget(), which the mod's restart button calls), finishing and failing a level clear the state. Objects the scripts made after the level began (the halves of a Blue Bird, debris) are not part of it. Everything is a field of thesaveStatestable that a script may change (enabled,file,autosave,restartWindow,readyVariable, the lists of variables,skipWhen), plussave(),apply(),has(),forget()andclearAll(); seedocs/SCRIPTING.md. The variable names are the ones the games share (the Classic, Seasons, HD, Rio, Space and Star Wars game scripts all use the same bird queue and score variables). Checked on Angry Birds 1.6.2, level 1-1, with two separate runs of the game: in the first a Red Bird was removed, two blocks given 3 and 5 strength, a block moved, a damage sprite set and the score table set to 1234; in the second, started from nothing, the log said the state was put back and the blocks had their strength and sprite, the bird was gone and the score was 2334 (1234 and the 1100 of the weak block that then broke); leaving to the menu wrote the state; a restart left no state to put back. Not yet tried in the other games. -
Hooks for the remaining Box2D joints:
createJointtypes 6 to 11 (pulley, gear, mouse, line / wheel, friction, rope). The game editors only know distance, weld, revolute, prismatic and the destroy-attached link (types 1 to 5); the other joints Box2D has can now be made from Lua with the same call, take their fields from the table, writeobjects.joints[name]and can be changed withsetJointParameters(gear ratio, mouse target / force, friction limits, motor and limits of the line / wheel joint). The line joint exists in the bundled Box2D 2.1 (Classic, Seasons, Space), its successor the wheel joint (with a suspension spring) in 2.2 (Rio, Star Wars, Friends); type 9 makes whichever the game's Box2D has. The rope joint is new to 2.1: Box2D 2.2 has it, and it was back-ported to the bundled 2.1.1 (b2RopeJoint, same solver as 2.2.0 written for the 2.1 joint interface, marked as an altered version in its source), so type 11 works in every game. A gear joint is destroyed together with either joint it couples (including when a body is removed), the mouse joint pulls against a fixed body made on first use. Reference and an example indocs/SCRIPTING.md, "Extra joint types". Checked with new tests on both Box2D versions (a pulley lifts the light side, a gear carries a hinge's rotation, a mouse joint brings a body to its target and moves it when the target changes, a line / wheel joint keeps the body on its axis, a rope stops a falling weight at its length, removing a gear's base body leaves no joints behind) and on level 1-1 through Lua (createJoint{type = 8, ...}moved a wood block from y = -11.21 to the target -15.21 and lifted the pig tower with it).
v3.4
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 (withgit grepover 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 withgh; without the message it only builds, tests and checks.make_release.battakes the version (it was fixed at v3.1), writes the release notes from the version's## New insection of this file torelease-notes.md, and withpublishrunsgh release createwith the zip.docs/RELEASING.mdhas 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 numberinmakeExplosion). The game's explosions go through everything in their radius and compare itsstrengthanddefence; 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 zonestrengthanddefenceof 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) andWoodBlock15(chevron) are registered inblockTable.blocksas polygon blocks with their own cut sprites for the four damage stages, and the wood group'slastIndexis raised for the editor's keys; add your own inshapeBlocks.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:
rayCasttakes a shape (newShapeCastAllin the physics), and the laser is an octagon.rayCast(x1, y1, x2, y2, all, shape)with ashapetable ({radius=},{sides=, radius=},{w=, h=}or{points={...}}, plusangleandskip; seedocs/SCRIPTING.md) sweeps that shape along the segment instead of a bare ray. Box2D has no shape cast, so it is built fromQueryAABBover the swept area andb2TimeOfImpactagainst each fixture (the bundled 2.1 solver reports onlyt, 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. Withoutshapenothing 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. Inextras/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 = 0gives 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 inlaserMod.beamTime(0.15 s) withlaserMod.beamEase("inCubic"), and whatever it crosses is hit as the head passes it. Needs a rebuild.