The site uses cookies that you may not want. Continued use means acceptance. For more information see our privacy policy.

Fun with Context Free

Math is a tool that creates order and chaos in equal (or was it inequal?) measure.

Context Free Art is a simple art-generation context-free language that uses recursion (among other things) to generate images (and videos). I recently saw a post about it, and I decided to try it out. Then I found a folder in my files from 2013 where I had previously come across it and forgotten all about it.

While more suited to the abstract, it’s possible to create more traditional art with it, as seen in two of the four examples at the bottom.

Here is a sample input to the program:

// Sample input
// two slashes make a comment

// command to build:
// cfdg -s 1920x1080 -m 1000000 sample.cfdg sample.png

// cfdg the command
// -s set size to 1080p
// -m set the maximum number of shapes; helps in case of too much recursion
// [file].cfdg the input file
// [file].png the output image

// Required to kick things off.
startshape Sample

// Make a default background color (random)
CF::Background = [b rand(-0.5,-0.25) sat rand(0.25,0.75) h randint(360)]
// b is brightness; sat is saturation; h is hue

shape Sample {
    SQUARE [s 100 x -200]
    CIRCLE [s 100]
    TRIANGLE [s 100 x 200]
}

// s is size; x is horizontal position

There are three basic shapes available. Can you guess what they are?

From left, on a pink background: a black square, a black circle, and a black triangle.

And you can make your own shapes, using path declarations:

path ZA {
    MOVETO(-0.5, 0)
    LINETO(0, 1)
    LINETO(0.5, 0)
    ARCTO(-0.5, 0, -1)
    CLOSEPOLY()
    // STROKE()[]
    FILL() []
}

This example path creates a piece of pizza! Notice it has STROKE commented out. If you want, you can make outlined shapes using that.

From left, on a brown background: a white pizza slice shape, a black pizza slice outline, and a white pizza slice shape with a black outline.

Github: MtnViewJohn: context-free: Wiki has most of the details on how to use the tool, though you can also look at the gallery of the official website (linked above), where users have provided samples that include their source code.


Anyway, just a short writeup. Here’s some pictures I made with it:

On a green background, a cone-looking tornado kind of thing with colors shifting from green to yellow to pink to purple.
A misshapen earth-like figure with water, land, and clouds, seen on a space-like background.
A sky with clouds and sun above dirt filled with plants and a few trees.
A psychedelic swirl of green, yellow, orange, red, pink, purple, and blue.

Review of Death Stranding

In the end, Death Stranding delivers on its promise.

Death Stranding (Wikipedia: “Death Stranding”) is an open-world delivery game set in a post-post-apocalyptic (but also peri-apocalyptic) future. You play as Sam, a porter, delivery guy, carrier of things. The game opens with you already in action, with a reputation, but the game also treats you as though you’re just starting out. This is common in games, where there is a tension between plot and story on one hand, and gameplay on the other.

And there are immediate cutscenes to start building the story. The story is great. The cutscenes, the cinematic nature of the game, which preferenced animation and lots of it, get a bit tiresome. It’s not that there’s something wrong with blending cinema into games, but how it is done is another thing entirely. And the clumsy and untelegraphed nature of Death Stranding‘s cinematics are part of its larger, though mostly forgivable, problems.

The basic story is there is rainfall that causes accelerated decay (and timeflow in general) of whatever it touches, and in those storms there are ghosts that, if they grab you, can cause matter-antimatter explosions. The world (though we only see America) has been devastated by these events, which also involve other supernatural elements. It is your job as a cargo carrier to help reunite humanity and hopefully put an end to the supernatural stuff. It’s more involved, of course, and beyond the scope of the review. But it’s a nicely told story.

You don’t have too much knowledge or control of when the next set of cinematics will come, and they tend to come on top of completing some lengthy cargo run, just as you need to go make dinner. Surprise! Here’s a ten minute short you didn’t expect to watch right now!

I’m not sure what the best way to handle the issue would be. One might be warning the player that “after this mission are about ten minutes of expository scenes.” Another might be to make it easier to skip them and come back and watch them after the fact. (If you search, you’ll find people online explaining how they watched some cutscenes on YouTUBE as there was no in-game way to watch the ones you skip.)

The only other note on cinematic presentation is that every time you first encounter the rain ghosts, a ten-second animation kicks in to make sure you’re properly warned. You can disable it playing every time you leave and return to the same storm-area (this was apparently added in a patch), but you can’t turn it off entirely. It’s quite annoying, as were the longer-than-needed animations for getting in and out of the truck. There are a few other spots where this over-indulgence crop up: deliveries, recycling, and the private rooms (including activities in the private rooms). The only place where it was completely forgivable was the interactions with the “BB” (bridge baby), as (some) babies are adorable and silly.

The other big problem of Death Stranding sits in the interface. I played the game on PC, on Linux through the Proton (WINE) translation layer, but my impression is that my experience is representative of the PC experience, and it may well apply to the console experience as well. The interface often fights you by being less clear and more complicated than necessary.

One example is crafting. Because of the time-corrosive rain, you have to craft replacement items fairly often. There are six or so resource types, which are available at various locations to craft items. Each craft location has a finite amount available and a maximum. You can recycle. But if you want to recycle and the resource is full, the excess is discarded. But the game doesn’t let you recycle, fabricate, and then balance whatever’s there. If you need to maximize resources, you need to fabricate, then recycle.

Of course, maximizing resources is not required. If metal’s already full, you’re probably not going to run out by trashing a bit. But if you’re playing faithfully (diehealthy.org: “Faithfulness in Games”), you shouldn’t waste resources. The game warns you if recycling would spill, and the game should wants you play faithfully, right? If it doesn’t matter, the game shouldn’t set the artificial limit to begin with. It’s unnecessary to the player experience, but it tripped me up until I lowered my faithfulness.

Another example is vehicle repair. You return to a distribution center, and you can store your vehicle and retrieve it to repair it to new, to recharge the battery. When you do this, it also deposits all vehicle cargo in the private locker, meaning you have to move it back on the vehicle every time (or you forget to, get half-way to your destination before you realize you left something behind). You can also rest in a room to refill your ammunition and canteen. I say can, but I should say must. You have to do these silly little interface dances to improve your status rather than the game simply being honest with the player and giving you a repaired vehicle and full stats and resources because you got to the place where, if you wanted to do the interface dance, you could have gotten them.

I assume both of these things have something to do with how multiplayer works in Death Stranding, which is among the coolest parts of the game. The game features a kind of metaverse for areas you have connected to the in-game network. Other players can build several types of structures, as can you, and these structures are shared between your world and theirs. You can upgrade their structures, and they and you get “likes” (equivalent to experience points) based on these (and other) interactions.

But why would the problems be caused by this novel multiplayer system? My guess is they wanted to encourage it to be used and therefore certain interface choices were made to distinguish consequences. If you don’t store your vehicle, a multiplayer might find it sitting out. If you do, they might retrieve it from their garage. If you could overfill the resource coffers, you might start sharing the extra resources via postboxen and shared lockers, and there might be overabundance.

Whatever the reason, the game suffers from the kind of extra-steps-necessary interface that was quite annoying. At one critical point in the plot, if you don’t decide to sleep in a room, you miss a cutscene that gives you critical information about what to do. You will fail the mission and be put back at its start, but still won’t be told to go sleep in a room.

The mail interface is about as annoying as e-mail in real life, except there is no spam filter in the game. The “Likes” system can feel spammy sometimes as well, though it’s generally nice and the game does a good job of making you feel appreciated by receiving “Likes.”

The interface also did a poor job of surfacing useful information. You can’t tell the health of items at a glance, so you have to poke around at each one to see if you have items falling apart, lest you be caught without critical kit when you need it.

And when you select orders to take on, there are several types in separate menus, which you cannot select in one go. You have to take on some orders, go through the end of the process (mandatory crafting screen, vehicle selection, load up those items, exit interface to world) and then go back and add the next set. This may have been done to try to avoid you overburdening the character with too many orders, but in practice it was a messy way to fix that problem.

The other interface issue was the HUD color of light blue being of terrible contrast in snowy areas. That should not be a thing. Either add a shadow to the HUD or let me change its color or change its color yourself. But don’t put invisible stuff on my screen and say, “Go ahead, try and read that.”

There were a few smaller gameplay-feel issues worth noting as well. The reverse-trike vehicle felt terrible to drive other than on roads. (Though the few speedruns I found after beating the game seem to prefer it.) The truck felt fine, except it could get funky on some slopes. (Slopes in general could be a problem. Walking down a snow-covered slope, I somehow managed to slip-and-slide at high speed causing a death event at one point, even though it wasn’t that steep, but that was an aberration.)

The non-human fights, against boss-style “catcher” BTs (beached things, or monsters) were often annoying, particularly because the character would not always respond to commands during them. On more than a few occasions, I had hematic grenades aimed and primed, but they would not throw, and as a result I got sort of stun-locked and suffered for it. I was mostly able to salvage those encounters, only having a few deaths and only one voidout (i.e., matter-antimatter explosion).


All of that said, Death Stranding was mostly a fun game that I enjoyed. I don’t play big games very often. The graphics were excellent. The world feels nice and big. The different take on multiplayer is a step forward and something that other games must explore. It’s a fun game.

I think I would have enjoyed it more if it had been a slightly-purer delivery sim than it was, but the story was a good one and I adjusted my game-faith to the annoyances over time. It took me 135 hours to get all 63 achievements. It’s worth a look.

Dark Days in Alabama

“… l’obligation est voide, eo que le condition est encountre common ley…” —Judge Hull, 1414.

9 August 2023.

Montgomery, Alabama.

Overnight, the streets of Montgomery, Alabama, were filled with beams from flashlights. They were not for a vigil, but to see by. The small electronic devices were passed out by a special mission from the United Nations as Alabama entered its second week with minimal electricity—in the words of the state supreme court’s judgment, only what’s “necessary for the protection of human life” if it’s generated by polluting methods.

While Alabama continues begging to its grid partners for as much clean energy as can be had—a tough ask as most of it is already dedicated to reducing other states’ carbon emissions—most of the state’s generation capacity remains mothballed. And to the extent the state can buy more clean juice, unless and until it can get enough to power essentials it simply displaces the fossil fuels. Dirty power is allowed only to power some traffic lights, the state’s water works, and fire stations. Hospitals get juice, but only to care for those on life support or needing stabilization.

The legislature is among the exceptions. Immediately following the ruling by the Alabama Supreme Court, Governor Ivey had called a special session to draft and propose a repeal or replacement for Alabama Amendment 930, the heart of the confusion and the chaos in this state of five million people. Given the dysfunction the state is experiencing, it took until this morning to gather a quorum in both chambers, following the arrival of several lawmakers who had been away on extended vacations. They landed at Dannelly Field on a special flight arranged and piloted by the Alabama Air National Guard.

The UN’s humanitarian mission has included setting up special solar-powered cooling tents, which have become a literal lifesaver in this southern state known for its hot summers. The lack of air conditioning has made many indoor structures unsafe during the hottest hours of the day, with some cities declaring don’t-stay-home orders requiring everyone to find their way to one of more than 2000 cooling sites throughout the state. Outside of the major enclosed stadiums and arenas, which have capacities from several thousand to ten thousands, the UN tents have a maximum capacity of 500 persons. Regular shade tents are erected in the vicinity so that citizens can rotate in and out of the cooled tents. School gymnasiums and megachurches are also part of the mix of cooled spaces available.

With refrigeration limited, food preparation sites have been put up in parking lots of many major grocers, allowing people to cook hot meals away from home. Despite this, there are massive food shortages and the relief efforts includes distributing no-cook or pre-cooked foods to accommodate the state’s residents. The one saving grace is that water service continues uninterrupted, meaning taps still work, though hot water is unavailable as most buildings use methane heaters.

Those with illnesses requiring medication to be refrigerated, including insulin for diabetics, have been forced to make trips to nearby pharmacies or hospitals to receive their doses, which is a major hardship given the lack of transportation options. As a result, as many infirm as possible have been evacuated to nearby states.

The ruling by District Judge Nima Shelley in Mobile had come two months ago in the next-friend class-action suit by expecting persons in the state, for the protection of their health and welfare. Judge Shelley had stayed her ruling pending appeals, but the state attorney general has repeatedly mocked the decision, and the state solicitor general gave only a perfunctory rebuttal at argument once the case reached the high court three weeks ago. Following a week of deliberations, the seven-member majority laid down the law: the district court ruling stands, and all contracts that threaten the unborn in Alabama are, “avoided, inoperable, and illegal.”

Contract is the basic means of commerce throughout the world, including ordinary exchanges of goods for money. It requires two or more persons to agree on an exchange that offers some cost and benefit to each party, and has been the cornerstone of society for hundreds, if not thousands, of years. Under normal circumstances, they could rely on the state to enforce contracts. While commerce could continue on a voluntary basis, most corporations, including suppliers, are unwilling to proceed on that basis, that they might deliver either payment or goods and rely on good will to see the other party keep up their end.

The result has meant curtailing all nonessential activities and commerce within the state that cause pollution capable of causing harm, defect, or death of unborn life. The scientific term, toxic abortion, refers to the ability of pollutants to cross the placental barrier and damage fetal tissue, disrupting the delicate balance involved in growing the womb’s fruit, in addition weakening a pregnant person already under the strain of supporting an incipient life (or lives, in cases of multiple pregnancy). Responsible for both spontaneous abortions (miscarriages) and stillbirths, estimates put the figures nationally between 40 000 and 200 000 per year, though the exact figures would be impossible to calculate. Now, the courts have said, the state constitution demands protection.

That’s because of the specific language used in the amendment, which passed by plebiscite in 2018, made it the explicit public policy of the State of Alabama to prioritize unborn life. “Although the Alabama Constitution has a provision barring the impairment of contracts, the language of Amendment 930 was clear, and its later adoption gives it priority,” the seven-member majority wrote. Had it been a mere statute, it would have been unable to reach to avoid contracts. But, “[U]nless amended, nobody in this state may enter into any contract for goods or services that threaten the unborn. Due to the widespread disruption this conclusion requires, we further hold that there are limited exceptions. Services and commerce that is essential for protection of life is excluded. And thankfully, beyond our law’s reach are all federal facilities and federal operations.”

That last exception refers to the long-standing conceit of law that federal activity is protected from violation of state laws under cases arising from the Neagle rule, established in 1890. Though not insulating federal employees from lawsuit, the state amendment establishes rights not affirmed by the US Supreme Court, and so while at work federal employees are blameless and, for now, federal activity is protected.

The state legislature expects its main duties to be finished by the end of the day, though some of the state’s pundits have speculated they will find good reason to remain in session all the same. Spouses, family members, and major donors have all been seen entering the legislative offices carrying changes of clothes and bottles of soap as they seek the creature comfort of a shower. The sounds of hair dryers and electric razors echo through the halls.

The legislature must also pass a law allowing the governor to issue a writ of election to call for the statewide special election specifically to ratify an amendment. The bill is expected to make allowances for the election to be conducted without much, if any, electricity. The exact date of that election remains up in the air, due to the unusual circumstances. Turnaround time would normally be a few weeks, minimum, and time would be allotted for campaigning, but there’s both no time to lose and the problems of pulling together the materials without normal transportation or electricity needs.

The case, Alabama v. the Unborn Child of Moggs, was only the latest trouble caused by Amendment 930. There have been more than one hundred cases of convicted persons freed on deferred sentences after lawyers sued for the false imprisonment of their unborn children. They will be required to serve their time only after giving birth.

That loophole had led to a criminal gang of pregnant persons, known as the “Mother’s Mafia,” forming. They robbed convenience stores and other small businesses, causing mayhem. They duct-taped pregnancy tests to their chests to warn off any law enforcement officer who might attempt to arrest them.

At their peak, they numbered in the dozens (more if one counts their fetuses as accomplices, something the district attorneys avoided and the attorney general advised against). They were eventually brought to something approaching justice by the “Preggers Posse,” a vigilante group of pregnant women. Following the high-profile apprehension, they imprisoned the Mother’s Mafia in a vacant strip mall in Hysteria, Alabama, where the Pregnant Posse acts as jailers, providing prenatal care until each has their delivery day, at which point the group says they will be handed over to law enforcement.

Asked what he thought about Amendment 930, Posse leader and transgender rights activist Marki Malone said, “It’s deranged. I’m glad to be having this child, but you can’t put unborn life ahead of those who are already here. I’m as against pollution as anyone, but we have to build clean energy. Shutting down the dirty stuff doesn’t make that happen any faster.”

Outside of the state, energy economists have questioned that logic. They say that if the ruling stands and Alabama can’t change the law, they estimate a nine-month effort could bring the state to 80 percent generation capacity, provided the federal funds come through. It would prove a remarkable turnaround for a state that as recently as 2022 was generating about 56% of its electricity using methane and coal.

Ground transportation would take longer to replace, and even electric vehicles cause some PM2.5 emissions through road wear and other mechanical emissions like brake dust. At what point is the air and other toxic risks to fetuses deemed safe enough to satisfy Amendment 930? It seems unlikely Alabama will find out, as the legislature and voters seek to replace it with something less burdensome and return to modern life.

At the latest press conference this morning, the Alabama House majority leader said he expected as many as six proposed amendments to pass. “We don’t want to leave this thing to chance. We need to make sure the voters pass at least one of these, so that our state is not held hostage by the courts.” The amendment language was being carefully considered, both to guard against further lawsuits and to work constructively if more than one were to pass.

The main option discussed was outright repeal, followed by a softened version of 930 that would make it non-policy. Another option would declare there to be no right in Alabama to avoid environmental toxins, even for the unborn. A few would require special steps by pregnant persons. Those included requiring them to wear HEPA filters, or even requiring them to spend their maternity outside the borders of the state. But legal critics say these lesser options, which would leave 930 in operation, would be like resetting the clock on a timebomb rather than disarming it. And environmental scientists point out that HEPA filters do not remove certain pollutants—mainly gasses.

Fetal health is impacted by air pollution in two ways. Air pollution may be directly passed to the fetus by the pregnant person, causing harm. But air pollution can also harm the pregnant person’s health, which makes them a weaker host for the fetus to grow inside of. Air pollutants include particulate matter (PM2.5), volatile organic compounds (VOCs), Nitrogen oxides (NOx), and Sulfur oxides (SOx). Fetal harms include low birth weight, birth defect, spontaneous (toxic) abortion (miscarriage), and stillbirth. Survivors may suffer persistent and chronic health problems throughout their lives.

Sources of manmade air pollution include carbon electricity generation, other industrial combustion, vehicles’ combustion engines (including trains, watercraft, and aircraft), and forest fires.


This article was originally written on ink and paper, without the use of artificial energy sources, and it was transmitted for publication via a solar-powered satellite phone, avoiding any use of polluting energy.