# Fugue Devlog 12: The World, the Story, and the Game Mechanics

05.10.2021

The last week has mostly been a lot of waffling about game mechanics. Should characters have skills/attributes? Should there be any combat, and if so, what should it be like? Are there any "skill games" (like the hacking mini-games that are so prevalent in games)? I originally threw around the idea of there being these kinds of mini-games for different character skills, like repairing machinery or cooking food.

I'm leaning towards just sticking to the dialogue system as the main "mechanic" and seeing how far I can stretch that. If there's any combat, it could be interesting to use the dialogue system for that—in games like Final Fantasy 7, combat is basically through a set of menus, which isn't all that different than the dialogue system I've set up. Or combat happening through dialogue choices as skill checks, like in Disco Elysium (h/t Matt). This is just an example—in practice, there will be very little combat if any in the game. Other skill games/mini-games could take place through the dialogue system too. I like this approach because it gives me a constraint (and so makes the task of coming up with mechanics a bit less daunting) and also lets me hone the dialogue system further.

I'm not totally confident in that decision; I have a weird premature regret about not including other mechanics because I'm worried the play experience will feel lacking. At the same time, I know that plenty of games that are basically just dialogue are really, really good. There are a couple of systems, like law and organizational resource management, I want to include in the game, but these don't necessarily translate into new mechanics (i.e. they can probably be expressed through the dialogue system). I think I just have to stick with this decision for now and be open-minded about something changing later.

One reason I'm hesitant about introducing more mechanics is that the branching narrative will already introduce a lot of complexity, requiring a lot more dialogue and scenes and what not for each branching path. It might be too much as-is: I've also spent some time trying to think through the world and narrative to have a better feel for how much branching and different scenes there'll be, and it's shaping up to be a lot.

I also started laying out the geography of the world. The various regions are developed according to a few priorities: the aesthetic priority/what feeling that landscape evokes; its implications on the geopolitics and history of the world; how geologically feasible they are. For the latter point everything is inspired by real formations/environments, but the spatial arrangement needs to be feasible, like where should the mountain ranges be? What biomes should be near them?

To help answer these questions I read a bit about how mountains, rivers, and so on work. There were several helpful guides on mountain formation, rivers and watersheds, general advice on the map design and vegetation. This channel has several videos on not only these topics but also on mineral deposits, wind, and more.

This procedural map generator also helped give some base material to shape.

I figure once I have a map it will make sorting out additional details a bit easier. I can ask it questions or think through how the existing factions and cities would maneuver through the world instead of coming up with ideas out of thin air and then trying to make them all fit together. For example: placing one city (Baita City) on a major river that empties out into a bay (Bao Bay) which is the location of another major city. If trade occurs mostly along the coast of the land, then Bao Bay can unilaterally blockade Baita City, so Baita City might want to develop a land route to the other major city. But perhaps the only viable path is expensive or dangerous to develop so Baita City can't do so until some new technology makes it feasible. But once that happens it dramatically shifts the relationship between Baita City and Bao Bay. Similarly, the character and culture of a settlement is going to be influenced by its geography so this also helps me have a stronger idea of what the cities look and feel like.

Here's what I have so far:

I need to work out the two smaller islands, fill in more details of the mainland, and add in settlements. I had a pretty good workflow going using Blender's vertex coloring to paint on different terrain textures, but for some reason the vertex color limit is set to 8 (really annoying), so I have to figure out a different approach now.

This part of the process is such an emotional roller coaster, at times overwhelming from the possibilities/uncertainty, daunting from all the work different decisions imply, frightening because of all the ways things could go wrong, anxiety-inducing from the possibility of foreclosing certain mechanics or world/narrative features by committing to choices, or satisfying when pieces start to click together. In any case, it's not something that I can rush. The world's regions, factions, and narrative arc are coming together...but very slowly.

# Log: 5/7/2021

05.07.2021

This week: Food and revolution, food and injustice, types of academic papers, and Chinese animated cinema.

## The Belly of the Revolution: Agriculture, Energy, and the Future of Communism, Jasper Bernes

Another great essay by Jasper Bernes, partly continuing the line of thought in his essay on logistics with a turn towards questions around agriculture and, to pull on what feels like the main thread, food security (to use an NGO phrase...maybe more accurate to call it "food sovereignty", but I think that means something slightly different than what's discussed here). A lot of the essay reinforces what I learned and came to appreciate while researching fertilizer. Its core is the same general problem found everywhere: the means of individual and community survival/reproduction are disjoint spatially and in terms of control. Echoing the essay on logistics, Bernes notes that any revolution which is not totally simultaneous across the planet will—if can't meet its own needs—have to continue engaging with remaining capitalist countries to a degree of some dependency, and thus remain vulnerable to blockades, embargoes, and the like. If food shortages become an issue, then people become increasingly desperate, making an already risky and frightening project even more so, shifting the calculus for some that they would (probably understandably) rather abandon the revolution for material security. To prevent this happening, the leadership or whatever analogue there is may resort to increasingly violent coercion to prevent that or to pressure food producers to work harder. Thus food independence or food "security" is a necessary condition for any such movement.

## Food injustice has deep roots: let’s start with America’s apple pie, Raj Patel

A tour of the history of various foods and their relationship to colonialism, racism, and labor movements. It's always startling to me how much of food is taken for granted as-is; I still remember how weird it felt to realize that chilis, for example, which feel so foundational to so many culinary traditions, were introduced relatively recently on those traditions' histories. Or how much violence is part of the history of sweet things—which I can't help but think of whenever I see the exorbitant amounts of sugar used on baking shows.

I don't think I've ever seen a food show that really incorporates these histories. The closest I can think of is the podcast Gastropod (which is fantastic). But nothing like a food travel show or one of the many cooking/food shows on Netflix. I did want to pitch a show tentatively called "Planet Food" which would take this on, with episodes like:

• Bananas: about "banana republics", the United Fruit Company (now Chiquita) and its US-backed war in Guatemala; bananas as a vulnerable monoculture and how synthetic banana flavor is actually from a now-extinct variety.
• Corn: a lot to cover here: its importance as a indigenous crop, now a massive crop for livestock and high fructose corn syrup, the latter which emerged out of constant gluts and need for new corn-based products, which then lets you go into the problem of agricultural overproduction more generally.
• Preservation/fermentation: as alternatives to refrigeration: brines/pickles, fish sauce, curing, smoking, etc.
• Fish: overfishing as a common problem studied in economics, fish farms and those conditions, "chilean sea bass" as a case of food "branding", the amount of human trafficking in fishing, and the net as a key technology in fishing (I'm forgetting where I originally read this, but I believe it was nylon nets that were a major change in fishing net technology).
• Not sure what the title of this one would be, but about how dissociated fruits/vegetables/etc are from their plants, centering around an exercise where people have to draw the plant that a given fruit/vegetable/etc is from.

h/t Halah

## "Types of Paper"

I'm enjoying the "types of paper" meme—industry/field-specific memes are a quick way to get a feel for that industry/fields concerns/values/culture and these are kind of an enhanced version of that. If I wanted to review an unfamiliar field's research on a topic I would honestly probably want to start with the matching types-of-paper meme to quickly get situated.

## New Gods: Nezha Reborn

I watched the new Nezha movie (I actually haven't seen the first one yet) and I don't know if I would call it a "good" movie but it did indulge a fantasy of this kind of movie existing when I was growing up. I really only knew about Nezha through Uproar in Heaven/大闹天宫 which I loved growing up. An aside: a few years back I wanted to watch it again and could only find this weird new edited version. The original one wasn't digitized or something, but after digging I managed to find a fan restoration and now I keep a copy on all my backup drives (it's also on YouTube). The intro music is still as great as I remember.

Not too long ago I also watched Jiang Ziya by the same studio with my parents. It wasn't very good—the animation style is great, but we all found the movie too long and very confusing. Interestingly both the first Nezha film and this one are supposed to be anchors in a "Fengshen Cinematic Universe" (i.e. films based on Investiture of the Gods/封神演义). On the animation style: the past Chinese 3d animated films I'd seen all looks like their technology and technique lagged like 5-10 years behind Pixar, but these set of films all have carved out a compelling style that also look (to my untrained eye) technically impressive.

I wonder when/if Chinese cinema will start breaking into either US mainstream or subcultures. Korean cinema has been really high quality for a long time but only as of the past couple years started breaching wider US audiences. Hong Kong cinema has also been a staple of the more art-house film crowd but not much breakthrough to wider US audiences (best I can think of is Infernal Affairs which was "translated" into The Departed). To my knowledge Japanese cinema has also struggled to achieve a larger US audience, even with anime's now mainstream appeal (if not mainstream, then much wider than when I was growing up). The difference I see with Chinese cinema is the amount of money Chinese studios can throw behind projects and the massive captive audience they have (only a few foreign movies are allowed to screen in China each year). To my knowledge this is why we've seen movies like that Jason Statham shark movie with Li Bingbing and I've definitely noticed the increase in Tencent and Alibaba logos at the front of many new movies. QQ was also the messenger of choice in one Marvel movie (see below, I can't remember which one). I wonder if amid rising sinophobia this will become a target of conservative/nationalist backlash or not (something something propaganda).

# Fugue Devlog 11: NPCs and Cut Scenes

04.30.2021

I realized I forgot to build out an important part of the dialogue system: "cut scene" support. These aren't true cut scenes in the sense that they aren't cinematic sequences; here I'm using the term to describe something more like a play: characters moving around, saying things, with audio and animation triggers. This meant expanding the dialogue system to support "stage directions", and that required re-writing a few parts.

The implementation also meant that I had to reckon with NPCs. So far the entities engaging in dialogue were just the player and static objects. Of course it's far more typical that NPCs will be the ones engaging in dialogue. I'd written an Interactable class for things that the player can interact with, but it didn't capture the necessary functionality for NPCs (such as moving around), so I had to re-write that a bit.

Dialogue advancement got more complicated—I wanted to support chains of stage directions (e.g. walking to a place, turning around, walking to another place, etc), so dialogue timeouts and/or manual dialogue advancement don't happen until all of the stage direction sequences are finished.

This all required enough changes that everything felt a bit brittle, so I also spent a bit of time refactoring the code a bit.

Here's a small example of the cutscene system (the moving character is an NPC and the behavior is entirely directed by a dialogue script). The stage directions here are: walk to the designated point, turn to look at the player, then run the "pick up" animation.

Stage directions can be attached to any line in a verse:

Sometimes NPCs should move around etc without saying anything, so I've added a special speaker name of <none> for these cases. The general syntax for a stage direction is npc node name:target node name (excluding directions that don't have an actor, e.g. playing an audio clip). If there are multiple directions for a single actor attached to one verse-line, they're executed in sequence. If there are directions for multiple actors, they're executed in parallel. I'm hoping this doesn't relinquish too much timing control, but who knows at this point.

One problem here is that these are just open-ended text inputs. There's nothing checking that these actor or target nodes actually exist.

I updated the dialogue editor script validation to now require an associated scene, against which all references of speakers/actors and target nodes are checked against:

That should now cover all the systems that'll be necessary no matter how the world, narrative, and other game mechanics shape up. Before moving forward with the rest of the development I need to sort those out to figure out what exactly I'll need.

# Log: 4/30/2021

04.30.2021

This week: prescribing math for gamblers, the hustle economy as a search function for capitalism, economic planning and control, beef and climate change, and the emerging phenomenon of acquisitions of Amazon sellers.

## Mathematics for gamblers, Catalin Barboianu

I always like reading about randomness and probability because it's so counterintuitive and uncertainty/risk management (more broadly, "security") seems to be a decent explanation for so many behaviors. Gambling is one behavior that's sometimes pathologized as a kind of innumeracy/ignorance about probability. If that's the diagnosis, then people with gambling problems are told to "trust" the math...when gambling, like any social problem, isn't just an issue of "irrationality" or ignorance but a complex interaction of personal history, biological/psychological factors, etc. The more interesting objection in the article is: what does it mean for someone to "trust" the math when applying mathematical knowledge is a skill in itself? You need to be able to evaluate what relationships are relevant to what situations, for example, and because probability is so counterintuitive, it's very easy to misapply or misunderstand what you learn about it.

## The Hustle Economy, Tressie McMillan Cottom

A great overview of the "hustle economy", where "economic opportunity" as code for "opportunity to hustle" and is increasingly just "the economy" for many people. Existing hierarchies and oppressions are reproduced if not compounded within the hustle economy, e.g. through "subprime" services that provide financing at a higher cost to those who are ignored/excluded by existing entrepreneur infrastructure.

There is a weird romanticism around "the hustle" in a lot of media representations and I wonder how oppressive relationships come to be represented in that way (I'm kind of thinking of Nomadland right now).

In line with above, the hustle economy is risk shifting en masse; e.g. with Uber and other gig economy companies shifting as much risk as possible to their drivers/workers (I take it that the gig economy is a subset of the hustle economy).

One thing that's been in my head wrt to the hustle economy is its "search" function for capitalism: if profits are harder to find, you need more people searching for opportunities for profit. With the hustle economy you have millions of people trying to find a big opportunity for themselves; if they hit upon success they often hit a wall in terms of scaling rapidly. Larger firms or more resourced entrepreneurs are able to swoop in, scale quickly, and push the original people out.

## Planning and Anarchy, Jasper Bernes

Planning, or "economic calculation", is a common point of disagreement on the left. "Planning" usually implies "central planning" and evokes a shadowy bureaucracy of distant politicians sending down quotas and reprimands, hoarding and number fudging among local officials or factories, and catastrophes of scarcity and ill-met needs: that is, complete dysfunction. The recent "algorithmization" of life has brought a renewed interest in the idea that perhaps instead of people, computers can do the planning (this is a fun read on how difficult this is in practice). There are varying degrees of this belief: that planning exclusively be left to a single or consortium of AIs à la Iain M. Banks' Culture or that computers have some role to play in planning (seems reasonable). Though I've found the former more extreme position to be fairly common, at least as a desire if not a belief in something that will realistically happen soon, I've seen very little discussion on how that would come about or what that might look like (though there's this article, The Problem of Scale in Anarchism and the Case for Cybernetic Communism, that goes into more technical details). I say this as someone who still views Cybersyn, a cybernetic planning system (incompletely) developed under Allende, as a valuable if flawed utopian project. This article by Jasper Bernes is probably the best thing I've read on this topic lately.

But planning is not just about knowing what resources you have and where (the measurement part of planning) and deciding how much to make of what and where and how those affect whatever it is you're optimizing (the calculation part of planning)—it's also about whether or not those plans can be executed. Bernes puts it well:

Beneath problems of calculation lay much deeper organizational issues. At stake in planning is not simply the question of whether or not all resources and all needs can be recorded and measured in terms of labor time or some other numeric marker, not simply the transparency of that data or its legibility in terms of a single measure. The more important question is about control—whether and how that measure can effect changes in the distribution of those resources in order to satisfy those evolving needs. Inasmuch as humans are involved, this is not only a technical problem to be solved by mathematical formula and computation algorithm but a political one to be solved by class struggle.

This really becomes a question of how you get people to follow the plan, and when states want people to behave a certain way they generally resort to violence:

inasmuch as people are involved in producing things, and inasmuch as those things have as their final end the satisfactions of the needs and desires of people, one cannot so easily separate the administration of things and the administration of people. The USSR had a broken system for administering people, and did so irrationally, relying on violence, and often gratuitous violence, to move the levers of a machinery inherited from capitalism.

This may not look all that different than the typical violence of life under capitalism: the commodification of needs, the linkage of waged labor and survival as a way to "incentivize" your participation as a worker.

Bernes also goes through the more fundamental challenges of planning:

there is a deeper epistemological problem here: preferences are not stable, nor are the types of things available to people. Once one leaves behind the assumption of a fixed and unchanging set of commodities organized by stable preferences then mathematical calculation confronts strong limits: one can't really know what people may want in the future when one doesn't know what will be available. For short-run calculation, one might mobilize the technologies of contemporary logistics, developing algorithmic systems that monitor inventories and stocks and make predictions about needed supply and future demand from such observations. But this would do little to guide decisions about long-term investments in plant and infrastructure, nor the allocation of labor, which can't simply be whipped about from site to site, like a pallet of toilet paper. At some point, the planners themselves would have to choose between incompatible developmental paths based on only speculation about the future. Though they would be advised by referenda and juries, one might question whether a group of people should have such power in the first place.

Or that with central planning: "the planners would make themselves a target for capture by groups or factions wanting to gain privileged access to social wealth."

"Planning" is of course not the same as "central planning", and so these indictments are not against planning more generally. The possibility is left open of some kind of intensely local planning, for example, where it seems that at least some of these problems become more manageable. But it seems like some minimum scale is necessary to reliably fulfill all needs, and that local planning will eventually hit up against a more macro-level planning.

## Beef Rules, Jonathan Foley

Beef consumption is a very hot topic wrt to climate change—massive pools of manure creating waste management and contamination problems, huge amounts of agricultural productivity diverted towards feed for livestock, flourishing conditions for disease and antibiotic resistance, methane emissions, not to mention horrendous conditions in CAFOs (concentrated animal feeding operations). As a solution you have people like Bill Gates advocating for synthetic and/or plant-based meat substitutes. These are problems of industrial beef production and not beef production in general. I'd read about cattle's value in field preparation, e.g. consuming cover crop and incorporating it into the soil, so clearly there are alternatives. But it seems clear that current levels of beef consumption can't be sustained in any other way (I'm not familiar enough with synthetic meat production to comment on that, only that in general we should be skeptical of these proposals). I left my understanding at that until I had more time to read about the topic.

I came across this piece and this Twitter thread by Paige Stanley on the topic via Max Ajl, which mostly confirmed my understanding. Grass-fed (grazing) beef can be beneficial in terms of climate change but can't meet existing levels of consumption, though potentially up to 60% of it, possibly more with improved grazing techniques and with reduced wastage. Maybe the biggest challenge is that grass-fed beef requires more land, but as pointed out in the piece, this land might not have many competing uses (in terms of food production, at least).

## The Great Amazon Flip-a-Thon, John Herrman

An emerging phenomenon in the Amazon ecosystem is the acquisition of sellers by investment firms. This isn't something that I'd ever thought about but makes sense in retrospect—surprising to see, via the chart below, that this is really something that only took off over the past year. I wonder what impact it'll have.

h/t Moira

# Fugue Devlog 10: Scene Setups and Outdoor Environments

04.28.2021

## Scene portals

One of the last two scene components were "portals", i.e. the connections to other scenes. I didn't give this a whole lot of thought; I just used Areas that have an associated scene that the player's sent to. It works fine, though there were a couple small snags at first.

The first was infinite scene looping: when the player leaves out of one portal and enters the new scene, they spawn in the portal of the other scene. That immediately sends them back to the previous scene, where they spawn in the portal, thus sending back to the other scene, and so on. I just needed a bit of code that starts with portals deactivated until the player leaves the entrance portal area.

## Scene boundaries

The other last scene component was scene boundaries, i.e. preventing players from walking out of the camera's view or falling off the map. I don't know what the best practice around this is, but I just used static bodies and collision polygons; basically invisible walls. Godot's collision polygons were pretty frustrating to use at first, but eventually I got the hang of it.

I took a shot at creating my own grass wind shader to emulate the Ghibli effect I talked about last time and didn't produce anything worthwhile. Shaders are still really confusing for me! I ended up following this grass shader tutorial for Godot which gave me a bit more insight into how to implement a shader for a particular effect, but still way above my knowledge level. In any case, it looks amazing and I gave it a try in the outdoor environment. The performance lags a bit (20-24fps) but it's not nearly as bad as I thought it'd be.

What I need to think on more is whether or not the effect needs to be reproduced in the background, and if so, how best to do it. I might be able to layout levels so that I don't even need to do that. For example here I shaped the terrain so that it looks like you're at the top of a hill, which is why you don't see any more grass in the closest part of the background. This is just a trick so I don't have to render more grass than absolutely necessary (I'm realizing a huge benefit of the fixed cameras is that you can do many of these kinds of tricks).

Throughout this whole process I'm learning a lot about how challenging emulating light is, especially in video games where you are far more resource-constrained (i.e. you need to hit a certain number of frames per second). I've kind of known that light/shadow is where a lot of the focus is in better video game graphics (e.g. raytracing) but didn't really appreciate it until now. I thought that by sacrificing mesh complexity and detail I'd have more room for light/shadow effects, but I had it backwards: the light/shadow effects were always the primary bottleneck. This is all to say that one problem with the grass/wind shader above is that shadows aren't cast onto the grass! But I think I have to let that slide. I did have a sketch of a very simple cloud shadow shader for grass; maybe I'll try to combine it with this one in the future.

## Background environments and skyboxes

I'm still working on figuring out my general approach to these outdoor environments. I thought I should design the foreground to be more like an "indoor" environment with elements like the grass shader and then just have a pre-rendered skybox as the background. I'd create all the terrains in Blender, then just export the environment render and load it in Godot as a skybox.

I was not very successful at this. I tried creating a terrain of karsts, which itself was fun to do in Blender. The shader system there is powerful and you can generate a variety of environments with noise textures (probably much trickier to do if they have to have concave elements like overhangs though). The snag came when importing into Godot—it just looked terrible. I think skyboxes are literally just for skies.

This was really discouraging...I wasn't sure what to do. Eventually I decided to try just exporting the terrain as a mesh rather than as a background image or skybox and that worked surprisingly well.

There are still some issues with textures here (banding, doesn't seem to be the right resolution), and I simplified the geometry too much (way too pointy). But this captures the gist of what I was going for, and more importantly, the workflow is promising!

## What's next

This terrain/environment process needs more tuning, but I'm happy with it for now. That was one of the last big unknowns for me in terms of the art asset workflow (the other one is character design, but I'm holding off on that for now). I think I'll take a step back from the art/game development and dig back into the world-building/narrative side.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24249449372291565, "perplexity": 2068.3579055044256}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991737.39/warc/CC-MAIN-20210514025740-20210514055740-00582.warc.gz"}