Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Written for Consumers: what a mod building against Voidworks can use, or will se

## Unreleased

- A harvest is seen as the void taking the block over a second: the harvested block, drawn over the Voidstone now there, is eaten away through 12 irregular stages until only the Voidstone is left, for a Void Displacer's harvest, a Void Siphon's by hand, and a spent Displacer becoming Voidstone, which eats away its own casing. A solid block sheds crumbs as it goes, in place of its burst; a lava source is a bright cube of still lava, and air the End's starfield receding, as if the void hardened into Voidstone. It is only a look: the position is Voidstone from the harvest's tick, and what it yields and the network it joins are as before. The stage masks, `assets/voidworks/textures/void_taking/stage_<1-12>.png`, are placeholders, each painting what the void has reached by its stage; a resource pack can draw its own. Each such moment posts a `VoidTakesBlockEvent` on the NeoForge event bus, on the server, with the position and what it held, then sends a `VoidTaking` to the players tracking it. (#98)
- An item a Density tag names shows its Density in its tooltip, right under its name, with the motes one yields fed to a Void Displacer, from `densityMotes` in `voidworks-server.toml` ("Density 4: 64 motes"), or its Density alone before a world has loaded the config. Another mod's storage blocks in the `c:` tags show it too; an item of Density 0 shows nothing. (#106)
- A Void Dragon's rider watches it start down into the Well after they jump, sitting on its back as before, and sees the void only half a second after their eyes go below the Well's rim into the shaft (`VoidDragon.VOID_DELAY_TICKS`), the dragon diving on meanwhile; before, the screen went black as they jumped, while the dragon still hovered over the Well. They are unseen from the jump on, now from the jump's own tick. `VoidDragon.inTheVoid()` says whether a presence has taken its rider into the shaft, and its rider stands at its feet only from then; `carrying()` and `DragonRiding.inTheDive` still hold from the jump. (#84)
- A Void Dragon is seen again wherever it is after its presence's chunk unloaded: that presence, never saved, was left out of the world but still counted as the dragon's, so no new one showed, at the Well it was called to or anywhere else, and it came back at its old place with the chunk. A presence where nothing ticks is now taken away, and a new one shows where its dragon is. (#79)
Expand Down
11 changes: 11 additions & 0 deletions docs/spec/void-energy.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ Displacer or the player's Void Siphon, as a small butterfly with flapping wings,
our own sprite, after Boulder Dash's butterflies. They are cosmetic and credited at once, but the
count is exact: like XP orbs, a butterfly stands for 1, 8 or 64 motes by its size.

Every harvest also shows the void taking the block, over 20 ticks, a Displacer's or a Siphon's alike,
so a Displacer's growth reads as a continuous wave. Like the butterflies it is only a look: the
position is Voidstone from the harvest's tick, for its network, the next harvest and anyone mining,
and the motes and what is given back arrive then too. Each client draws what was harvested over the
new Voidstone and eats it away through 12 irregular stages, after Just Dire Things' goo, each face
on its own and turned by the position so neighbours differ. A solid block is drawn as its own model
and sheds crumbs as it goes; a lava source as a full cube of still lava, bright; air as the End's
starfield, which recedes as if the void hardened into Voidstone. The harvest's sound plays as it
starts. A spent Displacer becoming Voidstone shows the same, its own casing eaten away. A chunk that
unloads drops the effect, and nothing of it is saved.

- **End**: places fed blocks into the empty air of its zone. It faces the way its placer looked and
grows only into the space ahead of that face, so it never walls in its other faces.
- **Overworld**: swaps fed blocks with natural terrain in its zone — the blocks in a natural-block
Expand Down
40 changes: 40 additions & 0 deletions scripts/build-textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@
soaking, its cracks spread at each of the four stages and glow the brighter in amethyst, each stage's
cracks a sprite of their own laid over the shell.

The void's 12 stage masks, which a block it takes is eaten away through, are placeholders until they
are drawn (#107): the void spreads from a few spots, each pixel reached as soon as the nearest spot,
its distance roughened by noise, comes to it, the same share of the face more at every stage. A mask
paints, in the void's darkest purple, every pixel reached by its stage, so each covers the last.

Run from the repository root; it needs Pillow.
"""

import random
import shutil
from pathlib import Path

Expand Down Expand Up @@ -113,6 +119,13 @@
EGG_CRACK_DARK = (0x3E, 0x38, 0x30)
EGG_GLOW = [(0x7A, 0x3C, 0xB0), (0xA0, 0x5A, 0xE0), (0xC8, 0x8C, 0xFF), (0xE8, 0xB0, 0xFF)]

# The void's stage masks: how many stages, the spots it spreads from on a face, how rough its edge is,
# in pixels, and the seed that fixes both, so the placeholders come out the same on every run.
TAKING_STAGES = 12
TAKING_SPOTS = 3
TAKING_ROUGHNESS = 3.0
TAKING_SEED = 98

# The abyssium's darkest and middling purples, which Voidstone's darkest and lightest pixels become.
VOIDSTONE_DARK = (0x0F, 0x00, 0x1D)
VOIDSTONE_LIGHT = (0x62, 0x12, 0x50)
Expand Down Expand Up @@ -294,6 +307,32 @@ def drained_dragon_egg():
save(cracks, TEXTURES / "block" / f"drained_dragon_egg_cracks_{stage}.png")


def taking_masks():
rng = random.Random(TAKING_SEED)
spots = [(rng.uniform(0, 16), rng.uniform(0, 16)) for _ in range(TAKING_SPOTS)]
# Value noise on a coarse grid, read smoothly between its points, so the edge is ragged, not round.
grid = [[rng.uniform(0, TAKING_ROUGHNESS) for _ in range(6)] for _ in range(6)]

def noise(x, y):
gx, gy = x / 3.2, y / 3.2
x0, y0 = int(gx), int(gy)
fx, fy = gx - x0, gy - y0
top = grid[y0][x0] * (1 - fx) + grid[y0][x0 + 1] * fx
bottom = grid[y0 + 1][x0] * (1 - fx) + grid[y0 + 1][x0 + 1] * fx
return top * (1 - fy) + bottom * fy

def reached(pixel):
x, y = pixel[0] + 0.5, pixel[1] + 0.5
return min(((x - sx) ** 2 + (y - sy) ** 2) ** 0.5 for sx, sy in spots) + noise(x, y) + rng.uniform(0, 0.5)

order = sorted(((x, y) for y in range(16) for x in range(16)), key=reached)
for stage in range(1, TAKING_STAGES + 1):
mask = Image.new("RGBA", (16, 16))
for pixel in order[: round(len(order) * stage / TAKING_STAGES)]:
mask.putpixel(pixel, (*VOIDSTONE_DARK, 255))
save(mask, TEXTURES / "void_taking" / f"stage_{stage}.png")


def main():
void_siphon()
void_siphon("resonant_void_siphon", RESONANT_CRYSTAL)
Expand All @@ -316,6 +355,7 @@ def main():
void_crucible(abyssium)
void_well()
drained_dragon_egg()
taking_masks()


if __name__ == "__main__":
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/github/_5thlayer/voidworks/Voidworks.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.github._5thlayer.voidworks.network.Conduction;
import io.github._5thlayer.voidworks.pressure.DimensionPressure;
import io.github._5thlayer.voidworks.pressure.VoidPressure;
import io.github._5thlayer.voidworks.taking.VoidTaking;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
Expand Down Expand Up @@ -53,6 +54,7 @@ public Voidworks(IEventBus modBus, ModContainer container) {
VoidworksEntities.register(modBus);
modBus.addListener(WorksTabContents::add);
Displacement.register(modBus);
VoidTaking.register(modBus);
DensityTooltip.register();
Dormancy.register(modBus);
DiveColour.register(modBus);
Expand Down
Loading
Loading