Page 1 of 1

Object's FAQs

Posted: Sun Jan 22, 2023 7:57 pm
by [object Object]
This thread is a collection of answers to questions I see often on the Discord. Answers are meant for Hex Casting 0.10.x (Minecraft 1.19.2) and may not work on earlier versions (Minecraft 1.18.2). Feel free to add your own answers to it if you want, but try to follow the same format as my posts. Please ask questions on Discord or in a separate thread to avoid cluttering this one up.

Terminology

Posted: Sun Jan 22, 2023 10:03 pm
by [object Object]
Q: What do all these words people keep using mean?

Basic terms

Iota
An iota is anything that can be on the stack, including numbers, vectors, booleans, entities, lists, patterns, null, and garbage.

Pattern
A pattern is a single thing that you draw on the grid. Patterns can be put on the stack as iotas using any of these patterns. For example, Mind's Reflection is a pattern.
qaq

Spell
A spell is a type of pattern that produces some effect in the world. All spells are patterns, but not all patterns are spells. For example, Explosion is a spell.
aawaawaa

Hex
A hex is a bunch of patterns that together do something. Usually, a hex is stored ingame as a list of patterns (made using Introspection and Retrospection) that can later be executed with Hermes' Gambit or put in a Cypher/Trinket/Artifact. Sometimes people (and the mod itself) refer to hexes as spells, but since this can be ambiguous, I try to avoid doing this. For example, my Smart Railgun is a hex.

Advanced terms

Ambit
Your ambit is the places in the world that you can affect. For example, you can only get entities that are within your ambit, and you can only cause explosions within ambit. Normally, your ambit is a sphere centred on your eyes with a radius of 32 blocks. Additionally, a sphere around your Greater Sentinel with a 16-block radius is part of your ambit. Finally, with a couple exceptions, the ambit of a spell circle is the smallest 3D rectangle that contains every active block/slate in the circle (ie. its bounding box).

Recursion (meta-eval) limit
Hexes have a limit of 512 meta-evaluations, after which you get the Delve Too Deep mishap. This is often referred to as the recursion limit or meta-eval limit, and is an important limiting factor when designing some large-scale hexes. For example, you can only cast Hermes' Gambit on 512 pattern lists in a single hex, or cast Thoth's Gambit on a 512-element list, before the hex mishaps.

Iota limit
The stack has a limit of 1024 iotas. Lists count as the number of items they contain, plus one for the list itself, so the largest possible list would have 1023 items. Everything on the stack counts, so you'd exceed the limit with two lists containing 512 iotas (total of 1026 including the lists themselves). This is an important limiting factor when designing some large-scale hexes.

Finding Ancient Scrolls

Posted: Sun Jan 22, 2023 10:14 pm
by [object Object]
Q: Where can I find Ancient Scrolls?

Ancient Scrolls, required for casting great spells and completing Hex Casting's progression, can only be found in loot chests, with varying chances depending on the type. See this code for the default configs, also listed below (accurate as of 0.10.3).

Many
  • Stronghold libraries
Some
  • Bastion treasure rooms
  • Shipwreck map chests
Few
  • Jungle temples
  • Dungeons
  • Village cartographer chests

Using Greater Teleport

Posted: Sun Jan 22, 2023 10:30 pm
by [object Object]
Q: How do I use Greater Teleport without ending up in a mountain thousands of blocks away?

The most important thing you have to understand when using Greater Teleport (GTP) is that it takes a relative vector, not absolute coordinates! For example, if you drew the following patterns, you'd move exactly one block east, not to the coordinates (1, 0, 0).

Code: Select all

Mind's Reflection
Vector Reflection +X
Greater Teleport
qaqqqqqqeawwwqqqwwwqqeqqwwwqqwqqdqqqqqdqq

You can still teleport to arbitrary coordinates, though! It just takes a bit more work. Say p is the vector representing your current position, and t is the vector representing your desired target coordinates. Then t - p gives you an offset vector pointing from you to the target coordinates, which you can pass to GTP. (For more help with vector math, see A Primer on Vectors).

In practice, here's what this might look like: a hex that teleports you to the coordinates stored as a vector in a focus in your offhand. Note that we use Compass' Purification II to get your position, so that your feet end up at the target position, not your head.

Code: Select all

Mind's Reflection
Gemini Decomposition
Compass' Purification II
Scribe's Reflection
Jester's Gambit
Subtractive Distillation
Greater Teleport
qaqaadaaddaqqqqqaawddwddwwwwqqqwwwqqeqqwwwqqwqqdqqqqqdqq

Web Book

Posted: Sun Jan 29, 2023 2:12 am
by [object Object]
Q: The ingame book is hard to read. Is there a better way?

The ingame Hex Notebook is also available online! You can read it here. This is particularly useful when you're looking for a pattern by name, since you can just use the find function in your browser (usually ctrl+f). Note that this page is only for the latest version of the mod, so if you're using an older version (such as any version available on Minecraft 1.18), some things won't make sense. Also, as the message at the top of the page says, beware of spoilers!

Angle Signatures

Posted: Tue Mar 14, 2023 3:02 am
by [object Object]
Q: How do I read "raw patterns"?

Angle signatures are how we represent patterns as text. You'll commonly see these on your stack if you're making a list of patterns: for example, HexPattern(NORTH_EAST qaq) (that's Mind's Reflection). Here's how to interpret them.

Reading

Start with a single line in the starting direction. EAST is right, NORTH_WEST is up and left, and so on.
To read the letters, look around wasd on your keyboard. Each letter represents one line drawn at an angle relative to the previous line:
  • q: slight left
    Minimus Distillation
  • a: sharp left
    Bookkeeper's Gambit: Drop 1
  • w: forward
    Bookkeeper's Gambit: Keep 2
  • e: slight right
    Maximus Distillation
  • d: sharp right
    Nullary Reflection
Here's an image by PoisonNettle on Discord that might help.
Image

Examples

NORTH_EAST qaq (Mind's Reflection)
Mind's Reflection
SOUTH_WEST qaq (also Mind's Reflection, just upside down)
Mind's Reflection
EAST wqaawdd (Archer's Distillation)
Archer's Distillation
EAST wwaqqqqqeawqwqwqwqwqwwqqeadaeqqeqqeadaeqq (Craft Artifact)
Craft Artifact

Alternatives

Don't want to laboriously translate angle signatures by hand? Me neither! Luckily, there are other options:
  • The Discord server has a bot called HexBug that can render patterns. Type /pattern raw to get started.
  • This forum has pattern rendering (as seen above). Here's a guide to using them (also has another explanation of how to read angle signatures).

Embedded iotas

Posted: Wed May 17, 2023 9:01 pm
by kristi fristi
Q: What is an embedded iota? How Do I embed an iota?

Why embedding iotas is a thing

Hermes Gambit, Thoth's gambit and the casting items can only execute (lists of) patterns. If they run into anything that isn't, they mishap. So the only way to have code that directly pushes an iota to the stack is to "escape" it. This means using a pattern that tells the hex "push the following to the stack instead of trying to execute it". These patterns can be found in the "patterns as iotas" section of the book.

Which patterns can be used for embedding iotas

Consideration, Introspection and Retrospection escape iotas.
Consideration does a single iota, introspection and retrospection make a list of everything between them. Because consideration's behavior is more complex, introspection and retrospection are usually used for embedding iotas.

An example

drawing the following will output a pattern list that, when executed returns a reference to you(even if someone else casts it!)
qqqqqqBookkeeper's Gambit: Keep 1eeeqwaeawqeeeNumerical Reflection: 1qaqwqaeaqw
It works as follows:
-When drawing, inside the inner introspection and retrospection is a placeholder for the iota.
-The index of the placeholder and a reference to yourself is put on the stack.
-Surgeons exaltation is used to replace the placeholder with the desired iota.
When executing the resulting pattern list:
-Introspection and retrospection will escape your player reference, and put it as a list onto the stack.
-Flock's disintegration will get rid of the list and leave behind only the reference on the stack.

This is the general flow of embedding iotas. Put Introspection, Bookkeeper's gambit: -, Retrospection, Flock's Disintegration wherever you intend to embed the iota, and after creating that pattern list replace bookkeeper's with the iota you want to embed by using surgeon's exaltation.

Using Thoth's Gambit

Posted: Sat Jul 08, 2023 4:03 am
by Robotgiggle
Q: How does Thoth's Gambit work?

Thoth's Gambit is a powerful tool, but it's also notoriously difficult to wrap your head around. This post aims to explain how it actually works, and to provide some examples of how it can be used effectively.

The Simple Explanation

Thoth's Gambit takes two inputs: a list of patterns (referred to as the "spell list" from now on) and a list any kind of iota (referred to as the "data list" from now on). The spell list should be provided first, and then the data list - providing the two lists in the wrong order is a fairly common mistake.

When you cast Thoth's Gambit, the spell list will be executed once for each iota in the data list, on a special temporary stack with that iota on top. This allows you to do things like provide a list of monsters and an "explode entity" spell, and then explode all the monsters in the list. However, you might have noticed that Thoth also pushes a list onto the stack when it finishes. To explain where this comes from, we'll have to go a little deeper.

So How Does It Really Work?

For each iota in the data list, a temporary stack is created. This stack consists of anything that was on the stack prior to the Thoth's Gambit - apart from the spell and data lists - along with the currently selected data iota, which is placed on top. The spell list is then executed on this temporary stack. After the execution of the spell list resolves, any iotas remaining on the temporary stack are collected and stored for later.

This process is repeated for every iota in the data list. Finally, once all the iterations are finished, all of the iotas collected at the end of each iteration are combined into one output list, which gets pushed onto the stack.

How Can I Use This?

A simple but very effective use for Thoth's Gambit is, as previously mentioned, applying some sort of nasty combat spell to a large list of monsters. With the knowledge of how it actually works, however, there are plenty of other uses for Thoth.

Since the stack at the end of each iteration is collected and returned at the end, you can use Thoth to apply some sort of operation to all the iotas in a list - for instance, you could make a Thoth spell that converts a list of coordinate positions into a list of numbers representing the distance from you to each position.

Since each temporary stack starts out with all the iotas that were already on the stack before you cast Thoth, you could make a spell that takes number inputs from the stack to determine what effect it should apply to all the targets in the data list.

These, of course, are only a few of the things you can do with Thoth's Gambit - now that you know how it works, feel free to experiment and find out exactly how you can put it to use!