[README] An info-dump on reading & writing patterns

Ask for help with your casting of Hexes.
alwinfy
Posts: 2
Joined: Thu Dec 01, 2022 11:54 pm

[README] An info-dump on reading & writing patterns

Post by alwinfy »

Pattern Literacy on the Forum

Welcome! If you're here, presumably you have a decent grasp on the basic tenets of Hexcasting; if not you may want to consult the book first.


Reading patterns

First off, house-keeping: In order to see patterns, you'll first have to use a browser that supports SVGs. That's most browsers, nowadays-- but if they don't show up, you should hopefully still get a little human-readable string of text naming the pattern. (If you don't, let the sysadmins know!) Sadly this also means the rest of this guide doesn't quite apply.


Most importantly: you can mouse over a pattern to see its name! If a pattern is hard to comprehend, doing this will almost always clear things up.

Onto specifics.
Consider the following two patterns:
Thoth's Gambit adada
They represent the same shape (three spikes, sort of)-- but on a real Hexcasting grid you couldn't tell the difference.
So for readability, the last stroke of a pattern is drawn a bit shorter.
In this case the first symbol is drawn left to right ("Thoth's Gambit") and the second symbol is drawn right to left ("Erase Three").

This also lets you see where loops open and close:
Mind's Reflection
In this example, we start at the bottom of the diamond shape and travel counterclockwise.

Patterns can get quite complex with self-intersections:
Gemini Gambit Explosion
Both of these patterns look very similar, but they're drawn with very different stroke orders. Don't worry-- there's a few simple tricks to understanding how they're drawn!

First, let's examine the pattern on the left:
At the central intersection, the top lines join in a sort of curvy formation, as do the left and bottom-left lines.
Additionally, the bottom-right line is truncated-- so the curve must end there.
The only line unaccounted for is the right-most line, so the pattern must start there.
Then it loops around the triangles counterclockwise one-by-one.

For a slightly harder example, let's examine the pattern on the right:
The leftmost line is truncated-- so the curve ends there.
Since we don't have any curves, we can fall back on assuming that straight lines are connected. So the top-right segment connects to the bottom-left, and the top-left to the bottom-right!
So, again, the only line segment unaccounted for is the rightmost segment-- that one must be where we start.
We'll loop around the top-right triangle, continue down-and-left to loop around the bottom triangle, then go up-and-left to finish a loop around the top-left triangle.

So, to sum up:
  • Pay attention to where the curve ends!
  • Follow the curves-- they'll help you understand!
  • At a complicated junction, the start point is the one unaccounted for!
  • If all else fails at an intersection, go straight!

Writing patterns

Thanks to the work of the stupendous @Alwinfy (that's me!), displaying patterns is a first-class luxury on this forum! To do so, we use this syntax:

Code: Select all

[pat={IDENTIFY YOUR PATTERN HERE}]
If you want to get fancy with it, here's the full set of options:

Code: Select all

[pat={PATTERN} dir={DIRECTION} color={COLOR} size={SIZE}]
There are several ways to identify a pattern:
  • By its full name, e.g. "Mind's Reflection"
  • By its in-game ID, e.g. "craft/artifact" (see below)
  • By a sequence of angles (see below below)

To find the in-game ID for a pattern, you can consult the online docs.
Click on the link for a pattern:
Image
The ID will appear in the URL-bar, after the part that says "hexcasting:"
Image

So, if we write:

Code: Select all

[pat=get_caster]
we'll get as a result:
Mind's Reflection


To identify a pattern by a sequence of angles, we use sequences of the five letters "AQWED":
  • W specifies that the next segment is drawn straight onwards;
  • Q specifies that the next segment is drawn at a slight left (60° ccw);
  • E specifies that the next segment is drawn at a slight right (60° cw);
  • A specifies that the next segment is drawn at a sharp left (120° ccw);
  • D specifies that the next segment is drawn at a sharp right (120° cw).

You can look at a QWERTY keyboard for a good mnemonic; using the WASD movement scheme, W is straight forward, A is left, D is right, and Q and E are in between.

For example, to render Archer's Purification, we'd need to go forward, slight-left, sharp-left, sharp-left, forward, sharp-right, sharp-right-- or "wqaawdd". And indeed, if we input

Code: Select all

[pat=wqaawdd]
we get:
Archer's Distillation


To specify a direction for the dir= parameter, we use compass directions: EAST is to the right, NORTH_WEST is up and to the left, and so on. As aforementioned, Hexcasting doesn't care about rotations, so the following patterns all work identically:
Alidade's PurificationAlidade's PurificationAlidade's PurificationAlidade's PurificationAlidade's PurificationAlidade's Purification


To colorize a whole sequence of patterns, you can use this syntax:

Code: Select all

[pcolor={COLOR}] {YOUR PATS HERE} [/pcolor]
This can be useful for, for example, formatting a spell using Introspection/Retrospection:

Code: Select all

[pat=introspection][pcolor=gold]
        [pat=get_caster][pat=entity_pos/eye][pat=get_caster][pat=get_entity_look][pat=raycast][pat=swap][pat=explosion]
[/pcolor][pat=retrospection] [pat=aqaaq dir=se][pat=eval]
Introspection
Mind's ReflectionCompass' PurificationMind's ReflectionAlidade's PurificationArcher's DistillationJester's GambitExplosion
Retrospection Numerical Reflection: 5Hermes' Gambit

Finally, some style guidelines:
  • Render your patterns at a reasonable size-- too big and they take up the page, too small and they're unreadable. The default should work for most cases!
  • When sharing a spell, try to use the default orientations for as many patterns as possible (this is done for you if you use the pattern names/IDs)-- Hexcasting doesn't care about orientation, but a Fisherman's Gambit is far harder to recognize upside down!
  • Similarly, when sharing a spell, keep your patterns all the same size. Color coding sections is acceptable but not required.
That's all-- happy casting!
wdewdwwwwedaqedwadwweqewwdw Seen any suspicious casters around here?