WHY USE A DAEMON CORE?
Before starting to explain anything, let me explain what a daemon is for those who are not in the know.
A Daemon is a background hex that continuously evaluates every a set amount of ticks with no direct player input. This is normally done through the use of Hexcassettes, wisps, or genies. I wished to recreate this using spell circles within only the base mod, and I believe I have gone further than just succeeding at that goal.
The Daemon Core is a spell circle meant to allow for simultaneous casting of lists of passive and delayed hexes at a rate of up to 20 casts per second, reusing the same spell circle for countless hexes.
It should, in theory, be the only spell circle you'll ever need, allowing you to reuse its enormous ambit (16 blocks around the player, and a max 300x384x300 around itself with default server config!) for any applications, including even personal hexes, without the logistical nightmare of using multiple circles. Refueling should be especially easy in 0.11.4 now that we have gained media checks.
CORE TERMINOLOGY
- Daemon Core - a spell circle capable of consistently casting multiple hexes every GAME tick, with extremely large ambit around itself.
- Magus - the controller, this is our main loop. It allows for the repeated casting of an almost arbitrary amount of stateless hexes concurrently.
- Daemon - already gone over this, a passive hex casting continuously in the background with no player input necessary.
- Archdaemon - a subsystem running on the Daemon Core, concurrently with all the others. This is (by itself) a stateless hex generally meant to expand the functionality of the Daemon Core, meaning they shouldn't leave behind iotas on the stack. They are however not a strict necessity - a basic Daemon Core can run using just the Magus.
THEORY
(skip this section if you don't care about theory, you do not need to understand this to use the Daemon Core.)
The Daemon core achieves a cast rate of 20 casts/s by utilizing three things:
1) A quine (the Magus), allowing us to limit the necessary work to be done by the slates themselves to Hermes Gambit.
2) A slate loop alternating between Hermes Gambit/no-op. This achieves 1 Hermes Gambit every 4 game ticks.
3) Four cleric impeti, each staggered by 1 game tick from the previous using redstone. This quadruples the cast rate, finally getting us up to 20 casts/s. However, this can be reduced to 2 impeti if you have some method of automatically placing slates with no player input, creating a loop consisting of just Hermes Gambit.
Now, this is all well and good for stateless hexes such as the Archdaemons, but wouldn't be of much help for hexes that need to preserve the stack, if not for the fact that we use shared foci. Although we do not store anything within the Archdaemons themselves, they can use those foci for memory, for example loading a list of Daemons at the beginning of a tick, casting each of them, and saving them (along with their modified stacks) back to the focus at the end of a tick. So although impeti cannot directly work on the same stack, they can still pass values to the impetus evaluating on the next tick with no problem.
Because the Daemon Core is a spell circle, we can use as many item frames with foci as we wish, and we can utilize slates to expand their ambit. Firstly though, we need to trick the spell circle into thinking it has a return path. A spell circle only needs a single return path anywhere within the spell circle for the whole thing to be valid. The return path itself doesn't even need to be valid, it just needs to lead back to the impeti. As a result, we can simply use a directrix that will never truly lead there, and that is all we'll ever need.
Now we can utilize all of our remaining slates solely for expanding ambit. Whether you actually traverse over them or not, as long as they're connected to the spell circle in any way, each slate expands the cuboid that makes up its ambit, so therefore with a default limit of 1024 slates, we can give it an ambit of 300x384x300.
This would all however be very painful to create for each individual hex, though, so we go around this with a relatively simple Thoth's Gambit trick; instead of repeating the same hex over a list of non-special iotas, we cast Hermes Gambit over a list of hexes! Each iteration gets its own stack, after all, so they're even perfectly isolated from one another. Those hexes can then do the same thing over another list of hexes loaded from another focus, and so on, and so forth. The only limit is the evaluation limit, which you will not reach aside from very extreme circumstances anyway (and even then, we have solutions for that too!)
CONSTRUCTING THE DAEMON CORE:
Materials
- 4 cleric impeti
- 1 empty impetus
- 2 mason directrices (can replace one of them with a second empty impetus if you don't care about being able to shut down the Daemon Core with redstone)
- At least 1 focus
- 4 thought-knots (can replace them with foci)
- ~32 slates minimum, ~1024 slates for maximum ambit
- At least 5 item frames
- 1 observer, 1 redstone dust, 2 scaffolding, some solid blocks, buttons and a trapdoor.
Instead of pasting each screenshot, I will link to the album showing and describing every step.
https://imgur.com/a/25v7uBj
Creating the Magus
The Magus should hold a reference to the item frame holding the future Archdaemon list. Note that there is nothing stopping you from putting regular hexes in there; it's just not idiomatic Daemon Core usage. I am using list embeds for optimization reasons.
Code: Select all
Introspection //this constructs the quine
Contemplation
Bookkeeper's Gambit: -
Numerical Reflection: 7
Prospector's Gambit
Surgeon's Exaltation
Hermes' Gambit
Retrospection
Numerical Reflection: 1
Introspection //this is the quine body
Contemplation
Bookkeeper's Gambit: -
Speaker's Decomposition
Chronicler's Purification
Thoth's Gambit
Bookkeeper's Gambit: v
Contemplation
Bookkeeper's Gambit: -
Numerical Reflection: 7
Prospector's Gambit
Surgeon's Exaltation
Retrospection
Numerical Reflection: 1
Introspection //this stores the thoth's code and the focus reference
Hermes' Gambit
Retrospection
Mind's Reflection
Compass Purification
Mind's Reflection
Alidade's Purification
Scout's Distillation //make sure you're staring at the item frame that will contain the Archdaemon list
Speaker's Distillation
Surgeon's Exaltation
Surgeon's Exaltation
Scribe's Gambit

Copy this to three more thought-knots and place them in the item frames on cleric impeti.
Illustrated: a finished Daemon Core with arrows showing the relationships between foci.
Magus -> Archdaemon list
Archdaemons within the list -> foci storing their data
